先卸载掉自带的jdk、推荐使用1.8的jdk
cd /usr/local/src/
mkdir sdkMy
wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
unzip sdk-tools-linux-3859397.zip
配置环境变量(根据自己的路径配)
vi /etc/profile
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export PATH=$PATH:/usr/local/src/sdkMy/tools/bin
配好环境变量之后就可以查看一下了
sdkmanager --list
(会出来好多好多,最后是这样的就对了,如果这里报错,可能是因为jdk版本与sdk版本不一,卸载掉jdk,安装1.8版本即可)
这里个必须安装
sdkmanager "build-tools;26.0.0"
sdkmanager "platform-tools"
自己选择安装
sdkmanager "build-tools;19.1.0"
sdkmanager "build-tools;20.0.0"
sdkmanager "build-tools;21.1.2"
sdkmanager "build-tools;22.0.1"
sdkmanager "build-tools;23.0.1"
sdkmanager "build-tools;23.0.3"
sdkmanager "build-tools;24.0.0"
sdkmanager "build-tools;24.0.1"
sdkmanager "build-tools;24.0.2"
sdkmanager "build-tools;24.0.3"
sdkmanager "build-tools;25.0.0"
sdkmanager "build-tools;25.0.1"
sdkmanager "build-tools;25.0.2"
sdkmanager "build-tools;25.0.3"
sdkmanager "build-tools;26.0.0"
sdkmanager "build-tools;26.0.1"
sdkmanager "build-tools;26.0.2"
sdkmanager "build-tools;26.0.3"
sdkmanager "build-tools;27.0.0"
sdkmanager "build-tools;27.0.1"
sdkmanager "build-tools;27.0.2"
sdkmanager "build-tools;27.0.3"
sdkmanager "build-tools;28.0.0"
sdkmanager "build-tools;28.0.1"
sdkmanager "build-tools;28.0.2"
sdkmanager "build-tools;28.0.3"
sdkmanager "platform-tools"
sdkmanager "platforms;android-10"
sdkmanager "platforms;android-11"
sdkmanager "platforms;android-12"
sdkmanager "platforms;android-13"
sdkmanager "platforms;android-14"
sdkmanager "platforms;android-15"
sdkmanager "platforms;android-16"
sdkmanager "platforms;android-17"
sdkmanager "platforms;android-18"
sdkmanager "platforms;android-19"
sdkmanager "platforms;android-20"
sdkmanager "platforms;android-21"
sdkmanager "platforms;android-22"
sdkmanager "platforms;android-23"
sdkmanager "platforms;android-24"
sdkmanager "platforms;android-25"
sdkmanager "platforms;android-26"
sdkmanager "platforms;android-27"
sdkmanager "platforms;android-28"
上面这么多可以不弄或者选择性的安装
继续配置环境变量
vi /etc/profile
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export PATH=$PATH:/usr/local/src/sdkMy/tools/bin
export PATH=$PATH:/usr/local/src/sdkMy/platform-tools
最后我们来查看一下
adb version
这样就ok啦、下面一篇文章讲如何vue转apk
代码千万行,注释第一行。
格式不规范,报错两行泪!
作者:002睿智