我已经从官网下载了Android SDK,安装了openjdk10,DEFAULT_JVM_OPTS
将avdmanager shell文件中的变量改为:
DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
为了使 avdmanager 能够使用 Java 10,请在 my 中设置以下环境变量~/.zshrc
:
- 导出 ANDROID_HOME="$HOME/Downloads/android/"
- 导出 ANDROID_SDK_HOME="$HOME/.android"
- 导出 JAVA_HOME='/usr/lib/jvm/java-10-openjdk'
并使用以下命令下载了 SDK:
$ANDROID_HOME/tools/bin/sdkmanager --verbose "system-images;android-25;google_apis;x86"
但是,当我尝试通过以下命令创建新的 AVD 时:
$ANDROID_HOME/tools/bin/avdmanager create avd -n test -k "system-images;android-25;google_apis;x86"
它只是打印null
并退出。即使当我跑步
$ANDROID_HOME/tools/bin/avdmanager
它所做的一切只是打印空值。
如果它可能有帮助,我再次更改了 avdmanager 文件并添加了一行打印文件准备的参数,然后将其传递给$JAVACMD
命令。参数如下所示:
-Dcom.android.sdklib.toolsdir=/home/aonemd/Downloads/android/tools -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee -classpath /home/aonemd/Downloads/android/tools/lib/dvlib-26.0.0-dev.jar:/home/aonemd/Downloads/android/tools/lib/jimfs-1.1.jar:/home/aonemd/Downloads/android/tools/lib/jsr305-1.3.9.jar:/home/aonemd/Downloads/android/tools/lib/repository-26.0.0-dev.jar:/home/aonemd/Downloads/android/tools/lib/j2objc-annotations-1.1.jar:/home/aonemd/Downloads/android/tools/lib/layoutlib-api-26.0.0-dev.jar:/home/aonemd/Downloads/android/tools/lib/gson-2.3.jar:/home/aonemd/Downloads/android/tools/lib/httpcore-4.2.5.jar:/home/aonemd/Downloads/android/tools/lib/commons-logging-1.1.1.jar:/home/aonemd/Downloads/android/tools/lib/commons-compress-1.12.jar:/home/aonemd/Downloads/android/tools/lib/annotations-26.0.0-dev.jar:/home/aonemd/Downloads/android/tools/lib/error_prone_annotations-2.0.18.jar:/home/aonemd/Downloads/android/tools/lib/animal-sniffer-annotations-1.14.jar:/home/aonemd/Downloads/android/tools/lib/httpclient-4.2.6.jar:/home/aonemd/Downloads/android/tools/lib/commons-codec-1.6.jar:/home/aonemd/Downloads/android/tools/lib/common-26.0.0-dev.jar:/home/aonemd/Downloads/android/tools/lib/kxml2-2.3.0.jar:/home/aonemd/Downloads/android/tools/lib/httpmime-4.1.jar:/home/aonemd/Downloads/android/tools/lib/annotations-12.0.jar:/home/aonemd/Downloads/android/tools/lib/sdklib-26.0.0-dev.jar:/home/aonemd/Downloads/android/tools/lib/guava-22.0.jar com.android.sdklib.tool.AvdManagerCli
此外,该~/.android
目录仅包含以下三个文件/文件夹:
- adbkey
- adbkey.pub
- 缓存/
我在这里缺少什么吗?