Ubuntu 16.04 搭建Android開發環境

來源:互聯網
上載者:User

標籤:

1、Installing Java

sudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java8-installer

After that

  sudo apt-get install oracle-java8-set-default

2、Installing Android Studio

   (1) Download Android Studio from here or here,use All Android Studio Packages

  (2) Extract the archive file into an appropriate location for your applications, eg: /opt. Use the filename of your downloaded archive, in my example android-studio-ide-143.2739321-linux.zip

  sudo unzip android-studio-ide-141.2178183-linux.zip -d /opt

  (3) To launch Android Studio, navigate to the /opt/android-studio/bin directory in a terminal and execute ./studio.sh. Or use a desktop file, see below.

You may want to add /opt/android-studio/bin to your PATH environmental variable so that you can start Android Studio from any directory.

3、Create a desktop file 

  gedit ~/.local/share/applications/android-studio.desktop

and add the lines below

  [Desktop Entry]
  Version=1.0
  Type=Application
  Name=Android Studio
  Exec="/opt/android-studio/bin/studio.sh" %f
  Icon=/opt/android-studio/bin/studio.png
  Categories=Development;IDE;
  Terminal=false
  StartupNotify=true
  StartupWMClass=android-studio

4、Installing Android SDK

  use Android SDK manager or download from here

5、Add adb PATH

  (1) sudo gedit ~/.bashrc

  add this to the file

  # Android SDK
  export ANDROID_SDK_HOME=<your sdk path>
  PATH=$PATH:$ANDROID_SDK_HOME/tools
  PATH=$PATH:$ANDROID_SDK_HOME/platform-tools

       and then

  source ~/.bashrc   

  (2) cd /usr/bin

  sudo ln -s <your adb path>

  (3) adb devices

  if you get like this:  

  List of devices attached
  0123456789ABCDEFno permissions

  then you should just try this:

  sudo adb kill-server

  and then 

  sudo adb start-server

  if you still get like this:

  List of devices attached
  0123456789ABCDEFunauthorized

  maybe you should open USB debug on your phone

 

參考資料:
1、http://androiddevtools.cn/

2、http://askubuntu.com/questions/634082/how-to-install-android-studio-on-ubuntu

3、http://stackoverflow.com/questions/9210152/set-up-device-for-development-no-permissions

4、Ubuntu 14.04 安裝genymotion

Ubuntu 16.04 搭建Android開發環境

聯繫我們

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