0%

Ubuntu-16-04上搭建Android开发环境

准备工作

  • 下载 Android Studio,android-studio-ide-145.3276617-linux.zip
  • 下载lantern , lantern-installer-beta-64-bit.deb
  • 下载genymotion ,genymotion-2.8.0-linux_x64.bin
  • 下载virtualbox,virtualbox-5.1_5.1.8-111374-Ubuntu-xenial_amd64.deb
    链接:http://pan.baidu.com/s/1jI16beI 密码:in90

安装

安装lantern

1
2
sudo apt-get install gdebi-core
sudo gdebi lantern-installer-beta-64-bit.deb

启动lantern

lantern

安装Studio

解压文件并执行下面的命令即可启动Studio

1
2
3
4
# sudo tar zxvf android-studio-bundle-133.970939-linux.tgz
sudo mv android-studio /home/
cd /home/android-studio/bin/
sudo ./studio.sh

安装virtualbox

1
sudo dpkg -i virtualbox-5.1_5.1.8-111374-Ubuntu-xenial_amd64.deb

安装genymotion

1
2
sudo -s
./genymotion-2.8.0-linux_x64.bin

启动genymotion

1
2
cd /opt/genymobile/genymotion
./genymotion

错误处理

1
2
3
4
5
 vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.
There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root.

解决方法是将gcc版本换成5.4

1
2
3
4
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 50

参考此处:http://www.cnblogs.com/pngcui/p/5948018.html