【玩轉Ubuntu】02. Ubuntu上搭建Android開發環境

來源:互聯網
上載者:User
 一. 基本環境搭建

1.官網http://developer.android.com/sdk/index.html ,下載adt-bundle-linux-x86_64-20130729.zip

2. 解壓sdk

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft$ unzip adt-bundle-linux-x86_64-20130729.zip

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft$ ls -al總用量 1098596drwxrwxr-x 6 bixiaopeng bixiaopeng 4096 8月 21 11:48 .drwxr-xr-x 26 bixiaopeng bixiaopeng 4096 8月 21 13:06 ..drwxr-x--- 4 bixiaopeng bixiaopeng 4096 7月 29 15:23 adt-bundle-linux-x86_64-20130729-rw-rw-r-- 1 bixiaopeng bixiaopeng 458006784 8月 20 20:59 adt-bundle-linux-x86_64-20130729.zip

3.配置環境變數

vim ~/.bashrc  把下面這些環境變數加進去
export ANDROID_SDK=/home/bixiaopeng/soft/adt-bundle-linux-x86_64-20130729/sdkexport PATH=$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools:$PATH

4.測試一下

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft$ adb shellerror: device not found

返回以上資訊就表明你配置成功了

 二. 使用android提供的eclipse

使用android提供的綁定ADT的eclipse開發,這樣就不用在eclipse裡安裝ADT外掛程式了

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/adt-bundle-linux-x86_64-20130729$ lseclipse sdk


三. 使用Android Studio

1. :http://developer.android.com/sdk/installing/studio.html
我下載的是: Android Studio v0.2.xfor Linux

2. 下載下來後怎麼樣開啟Android Studio呢?
#  到android-studio/bin目錄下執行studio.sh

bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft$ cd android-studio/binbixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/android-studio/bin$ ls -al總用量 128drwxr-x--- 2 bixiaopeng bixiaopeng 4096 8月 21 13:24 .drwxr-x--- 7 bixiaopeng bixiaopeng 4096 7月 12 00:27 ..-rw-r----- 1 bixiaopeng bixiaopeng 136 7月 11 23:48 appletviewer.policy-rwxr-x--- 1 bixiaopeng bixiaopeng 22791 7月 11 23:48 fsnotifier-rwxr-x--- 1 bixiaopeng bixiaopeng 29155 7月 11 23:48 fsnotifier64-rw-r----- 1 bixiaopeng bixiaopeng 4176 7月 11 23:48 idea.png-rw-r----- 1 bixiaopeng bixiaopeng 6913 7月 11 23:48 idea.properties-rwxr-x--- 1 bixiaopeng bixiaopeng 281 7月 11 23:48 inspect.sh-rw-r----- 1 bixiaopeng bixiaopeng 8531 7月 11 23:48 libbreakgen64.so-rw-r----- 1 bixiaopeng bixiaopeng 6807 7月 11 23:48 libbreakgen.so-rw-rw-r-- 1 bixiaopeng bixiaopeng 0 8月 21 13:24 libpeerconnection.log-rw-r----- 1 bixiaopeng bixiaopeng 2275 7月 11 23:48 log.xml-rw-r----- 1 bixiaopeng bixiaopeng 282 7月 11 23:48 studio64.vmoptions-rwxr-x--- 1 bixiaopeng bixiaopeng 6505 7月 11 23:48 studio.sh-rw-r----- 1 bixiaopeng bixiaopeng 290 7月 11 23:48 studio.vmoptionsbixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/android-studio/bin$ sh studio.sh

提示:JDK一定要用1.6的,第一次開啟的時候會讓你指定JDK1.6的路徑

3.配置Android
Studio環境變數 

#查看路徑bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/android-studio/bin$ pwd/home/bixiaopeng/soft/android-studio/bin#編輯.bashrcbixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/android-studio/bin$ vim ~/.bashrc#在底部增加下面的配置export ANDROID_STUDIO=/home/bixiaopeng/soft/android-studio/binexport PATH=${ANDROID_STUDIO}:$PATH#讓配置立即生效bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~$ source ~/.bashrc#在任意路徑下都可以直接開啟studiobixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~/soft/android-studio/bin$ cd ~bixiaopeng@bixiaopeng-To-be-filled-by-O-E-M:~$ studio.sh

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.