technology:linux:centos安装androidsdk

1.下载sdk tools

android studio下载地址1)

https://developer.android.com/studio/

下载sdk-tools-linux-4333796.zip

$ wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
$ unzip sdk-tools-linux-4333796.zip
$ mkdir /opt/android
$ mkdir /opt/android/android-sdk-linux
$ mv tools /opt/android/android-sdk-linux/
$ cd /opt/android/android-sdk-linux
$ ls
 tools

2.配置android环境变量

$ cd /etc/profile.d/
$ vim android.sh

android.sh输入然后保存

export ANDROID_HOME="/opt/android/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"

保存配置,重新刷新配置

$ source /etc/profile

3.使用sdkmanager相关命令安装build-tools, latforms, platform-tools

sdkmanager使用相关文档:

https://developer.android.com/studio/command-line/sdkmanager

首先运行:sdkmanager --list

$ sdkmanager --list
 
# 安装build-tools的28.0.3版本
$ sdkmanager "build-tools;28.0.3"
 
# 安装platform-tools,platforms的android-86版本
$ sdkmanager "platform-tools" "platforms;android-28"

  • technology/linux/centos安装androidsdk.txt
  • 最后更改: 2019/09/18 10:30
  • (外部编辑)