1 安装JDK和Bazel(
https://docs.bazel.build/versions/master/install-ubuntu.html#install-on-ubuntu)
1.1 JDK:sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java8-installer
1.2 Add Bazel distribution URI as a package source (one time setup)
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
1.3 Install and update Bazel
sudo apt-get update && sudo apt-get install bazel
sudo apt-get upgrade bazel
1.4 添加环境变量
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib:${JAVA_HOME}/jre/lib
export PATH=$PATH:${JAVA_HOME}/bin
2 安装SDK和NDK
下载android-sdk_r24.4.1-linux.tgz( http://tools.android-studio.org/index.php/sdk)
sudo cp android-sdk_r24.4.1-linux.tgz /usr/local/java
cd /usr/local/java
sudo tar zxvf android-sdk_r24.4.1-linux.tgz
添加环境变量:export ANDROID_SDK=/usr/local/java/android-sdk-24.4.1
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools
下载android-ndk-r12b-linux-x86_64.zip( https://developer.android.com/ndk/downloads/older_releases.html#ndk-12b-downloads)
sudo cp android-ndk-r12b-linux-x86_64.zip /usr/local/java/android-sdk-24.4.1
sudo unzip android-ndk-r12b-linux-x86_64.zip
sudo mv android-ndk-r12b ndk-bundle
sudo rm -rf android-ndk-r12b-linux-x86_64.zip
添加环境变量:export ANDROID_NDK=/usr/local/java/android-sdk-24.4.1/ndk-bundle
export PATH=$PATH:$ANDROID_NDK
3 安装android studio
下载android-studio-ide-162.4069837-linux.zip( http://www.android-studio.org/)
sudo cp android-studio-ide-162.4069837-linux.zip /usr/local/java
sudo unzip android-studio-ide-162.4069837-linux.zip
cd ./android-studio/bin
sudo ./studio.sh运行android-studio
4 安装32位依赖库
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
1.1 JDK:sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java8-installer
1.2 Add Bazel distribution URI as a package source (one time setup)
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
1.3 Install and update Bazel
sudo apt-get update && sudo apt-get install bazel
sudo apt-get upgrade bazel
1.4 添加环境变量
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib:${JAVA_HOME}/jre/lib
export PATH=$PATH:${JAVA_HOME}/bin
2 安装SDK和NDK
下载android-sdk_r24.4.1-linux.tgz( http://tools.android-studio.org/index.php/sdk)
sudo cp android-sdk_r24.4.1-linux.tgz /usr/local/java
cd /usr/local/java
sudo tar zxvf android-sdk_r24.4.1-linux.tgz
添加环境变量:export ANDROID_SDK=/usr/local/java/android-sdk-24.4.1
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools
下载android-ndk-r12b-linux-x86_64.zip( https://developer.android.com/ndk/downloads/older_releases.html#ndk-12b-downloads)
sudo cp android-ndk-r12b-linux-x86_64.zip /usr/local/java/android-sdk-24.4.1
sudo unzip android-ndk-r12b-linux-x86_64.zip
sudo mv android-ndk-r12b ndk-bundle
sudo rm -rf android-ndk-r12b-linux-x86_64.zip
添加环境变量:export ANDROID_NDK=/usr/local/java/android-sdk-24.4.1/ndk-bundle
export PATH=$PATH:$ANDROID_NDK
3 安装android studio
下载android-studio-ide-162.4069837-linux.zip( http://www.android-studio.org/)
sudo cp android-studio-ide-162.4069837-linux.zip /usr/local/java
sudo unzip android-studio-ide-162.4069837-linux.zip
cd ./android-studio/bin
sudo ./studio.sh运行android-studio
4 安装32位依赖库
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1