1.下载sdk tools
android studio下载地址:
https://developer.android.com/studio/
下载sdk-tools-linux-4333796.zip
[root@iZj6c7eeosj2t5vjw8rf4xZ android]# wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
[root@iZj6c7eeosj2t5vjw8rf4xZ android]# unzip sdk-tools-linux-4333796.zip
[root@iZj6c7eeosj2t5vjw8rf4xZ android]# cd android-sdk-linux
[root@iZj6c7eeosj2t5vjw8rf4xZ android-sdk-linux]# ls
tools
2.配置android环境变量
[root@iZj6c7eeosj2t5vjw8rf4xZ android-sdk-linux]# cd /etc/profile.d/
[root@iZj6c7eeosj2t5vjw8rf4xZ android-sdk-linux]# vim android.sh
在android.sh输入然后保存
export ANDROID_HOME="/opt/frank/android/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
保存配置,重新刷新配置
[root@iZj6c7eeosj2t5vjw8rf4xZ android-sdk-linux]# source profile
3.使用sdkmanager相关命令安装build-tools, latforms, platform-tools
sdkmanager使用相关文档:
https://developer.android.com/studio/command-line/sdkmanager
首先运行:sdkmanager –list
[root@iZj6c7eeosj2t5vjw8rf4xZ android-sdk-linux]# sdkmanager --list
安装build-tools的25.0.2版本
sdkmanager "build-tools;25.0.2"
安装platform-tools,platforms的android-26版本
sdkmanager "platform-tools," "platforms;android-26"