mkdir /home/soft/sdk tar -xvf http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz -d /home/soft/sdk cd /home/soft/sdk # 切换到root su root vim /etc/profile export ANDROID_HOME="/home/maxzhao/Android/Sdk/" export ANDROID_SDK_ROOT="/home/maxzhao/Android/Sdk/" export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH" source /etc/profile sdkmanager -;-list adb version
安装需要的package
sdkmanager "build-tools;26.0.0"
您可以使用 sdkmanager 执行以下任务。
列出已安装和可用的软件包
1 2
sdkmanager --list [options]
安装软件包
1
sdkmanager packages [options]
sdkmanager --list 执行报错
1 2 3 4 5 6 7 8 9 10 11 12
$ sdkmanager --list Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156) at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75) at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81) at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:117) at com.android.sdklib.tool.SdkManagerCli.main(SdkManagerCli.java:93) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496) ... 5 more