Ubuntu 16.04 搭建Android开发环境

本文详细介绍了在Ubuntu系统中安装Android Studio的方法,包括安装Java、Android SDK、ADB,创建桌面快捷方式,以及配置环境变量。还提供了安装过程中可能遇到的问题及解决策略。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、Installing Java

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo 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
  0123456789ABCDEF no 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
  0123456789ABCDEF unauthorized

  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

转载于:https://www.cnblogs.com/droi/p/5399975.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值