LInux配置ANDROID環境

來源:互聯網
上載者:User
  • 開啟命令列終端Terminal, 進行第一次系統更新並安裝開發必要的軟體包

    shawn@e014-anle-lnx:~$ sudo su# apt-get install aptitude# aptitude update# aptitude full-upgrade## aptitude -y install sysv-rc-conf subversion subversion-tools python-svn git-core git-svn binutils binutils-dev binutils-static libncurses5-dev libncursesw5-dev ncurses-term ncurses-hexedit g++ gcc automake1.9 dialog bison build-essential zlib1g-dev flex gperf libwxgtk2.6-dev libcurses-widgets-perl libcurses-perl libcurses-ui-perl libcurses-ruby libruby1.8 libsdl1.2-dev valgrind ncurses-dev libtool libx11-dev vim-gnome exuberant-ctags tree meld pbzip2 wget unrar unzip wmii dwm# exitexitshawn@e014-anle-lnx:~$
  • 擷取JDK1.5, Eclipse, Android SDK, repo,把下面幾個檔案copy到本地檔案夾
    jdk-1_5_0_22-linux-i586.bin
    eclipse-linux.tar.tgz
    android-sdk-linux.tar.tgz
    repo
  • 安裝JDK1.5
    shawn@e014-anle-lnx:~$ sudo su# chmod 777 jdk-1_5_0_22-linux-i586.bin# ./jdk-1_5_0_22-linux-i586.bin# mv jdk1.5.0_22 /usr/local/# ln -s /usr/local/jdk1.5.0_22 /usr/local/jdk1.5# exitexitshawn@e014-anle-lnx:~$
  • 建立Android工具目錄 /home/android/, 並拷貝指令碼repo到/home/android/bin
    shawn@e014-anle-lnx:~$ cd /homeshawn@e014-anle-lnx:/home$ sudo mkdir androidshawn@e014-anle-lnx:/home$ sudo chmod 777 androidshawn@e014-anle-lnx:/home$ mkdir /home/android/binshawn@e014-anle-lnx:/home$ mv /home/shawn/repo /home/android/bin/shawn@e014-anle-lnx:/home$ chmod 777 /home/android/bin/repo
  • 解壓縮Eclipse到/home/android/eclipse/, Android SDK到/home/android/sdk/
    shawn@e014-anle-lnx:/home$ tar xf /home/shawn/eclipse-linux.tar.tgz -C /home/android/shawn@e014-anle-lnx:/home$ tar xf /home/shawn/android-sdk-linux.tar.tgz -C /home/android/
  • 配置環境變數
    shawn@e014-anle-lnx:~$ sudo su# echo "PATH=/usr/local/jdk1.5/bin:/home/android/sdk/tools:/home/android/sdk/platform-tools:/home/android/bin:/home/android/eclipse:$PATHCLASSPATH=/usr/local/jdk1.5/lib:.JAVA_HOME=/usr/local/jdk1.5ANDROID_JAVA_HOME=$JAVA_HOMEGIT_SSH=sshexport PATH CLASSPATH JAVA_HOME ANDROID_JAVA_HOME GIT_SSH" >>/etc/bash.bashrc
  • 驗證是否安裝配置成功, 重新開啟一個命令列終端
    shawn@e014-anle-lnx:~$ eclipse &    ##可以啟動eclipseshawn@e014-anle-lnx:~$ android &    ##可以啟動Android AVD Manager

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.