$ 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_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" # 可选安装 # 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 $ bash build_all.sh
参考链接