我想在Mac上使用带有Android SDK(文件夹/build-tools/24.0.1)的aapt命令。但是每当我尝试使用该命令时,都会收到命令未找到(aapt/aapt2)的消息。 在终端或Android Studio中都无法工作。
如果我在终端中列出24.0.1文件夹中可用的命令,则两个命令旁边都有星号,描述为:
A star (*) next to a name means that the command is disabled.
如何重新启用这些命令?更新构建工具没有帮助。
我想在Mac上使用带有Android SDK(文件夹/build-tools/24.0.1)的aapt命令。但是每当我尝试使用该命令时,都会收到命令未找到(aapt/aapt2)的消息。 在终端或Android Studio中都无法工作。
如果我在终端中列出24.0.1文件夹中可用的命令,则两个命令旁边都有星号,描述为:
A star (*) next to a name means that the command is disabled.
如何重新启用这些命令?更新构建工具没有帮助。
检查您的路径并确认其是否正确。
只需编辑您的~/.bash_profile
文件,添加以下行:
export PATH=$PATH:/PATH/TO/android-sdk-macosx/build-tools/x.x.x
aapt
命令工作的快速步骤。# First, run this to see all available build-tools version
ls ~/Library/Android/sdk/build-tools
# Then open file
nano ~/.zshrc
# Add this line to the file and save
export PATH=$PATH:~/Library/Android/sdk/build-tools/<version>
## Run
source ~/.zshrc