1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
$ cd ~ $ git clone https://github.com/LunarG/VulkanTools.git $ cd VulkanTools $ cd build-android $ export ANDROID_SDK_HOME=~/Library/Android/sdk $ export ANDROID_NDK_HOME=~/Library/Android/sdk/ndk-bundle # 当前的版本需要Android SDK 23.0.0,但是需要Java 11以下版本的Java才能执行SDK里面的sdkmanager # 显示可以安装的Java版本号信息,需要检出这个内容 $ brew tap caskroom/versions $ brew search "java*" ==> Formulae app-engine-java javarepl libreadline-java google-java-format jslint4java ==> Casks charles-applejava java-beta netbeans-java-se eclipse-java java6 oracle-jdk-javadoc eclipse-javascript java8 yourkit-java-profiler java netbeans-java-ee ==> Did you mean to perform a regular expression search? Surround your query wit # 可以看到上面存在Java8可以安装,我们安装Java8 $ brew cask install java8 # 指定默认的Java版本 $ export JAVA_HOME=`/usr/libexec/java_home -v 1.8` $ $ANDROID_SDK_HOME/tools/bin/sdkmanager --update # 目前的代码需要android-23的SDK $ $ANDROID_SDK_HOME/tools/bin/sdkmanager "platforms;android-23" $ $ANDROID_SDK_HOME/tools/bin/sdkmanager "platforms;android-24" $ $ANDROID_SDK_HOME/tools/bin/sdkmanager "build-tools;24.0.3" # 可选安装 # $ANDROID_SDK_HOME/tools/bin/sdkmanager "platform-tools" "platforms;24.0.3" # 需要Android 7.0以上才支持Vulkan,因此,我们需要更高版本的编译工具 $ export PATH=$ANDROID_NDK_HOME:$ANDROID_SDK_HOME/build-tools/24.0.3/:$PATH # 启用 ccache 减少二次编译的时间 $ brew install ccache $ export NDK_CCACHE=ccache $ export USE_CCACHE=1 $ export VULKAN_HEADERS_INSTALL_DIR=./third_party/Vulkan-Headers $ bash build_all.sh # 编译完成后,执行 bash test_APK.sh 测试功能,不过话说,这个工具是做什么的,有点看不懂了 # 难不成是厂家测试驱动用的? $ bash test_APK.sh |
参考链接
- Failed to install android-sdk: “java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema”
- 使用新版android sdk tool 的 sdkmanager 安装 android sdk 组件
- Failed to run sdkmanager --list (Android SDK) with Java 9
- How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9
- Android SDK is not installed or is not configured properly, environment looks ok #3139
- Installing specific major Java JDK versions on OS X via Homebrew
- Vulkan 设置