下載鏈接: https://www.androiddevtools.cnandroid
找到對應mac的版本下載安裝便可bash
#1. 進入根目錄ui
cd ~
#2. 打開.bash_profile, 若是沒有這個文件能夠本身建立一個spa
open .bash_profile
#3. 查看下adnroid sdk tools的版本code
Jackeys-MacBook-Pro:~ jackey$ ls ~/Library/Android/sdk/build-tools 29.0.0
#4. 在.bash_profile後面加上如下內容orm
AAPT_HOME=~/Library/Android/sdk/build-tools/29.0.0 export AAPT_HOME export PATH=$PATH:$AAPT_HOME
注意改爲跟本身的版本號一致blog
#5. 保存.bash_profile文件後,啓用配置ip
source .bash_profile
#5. 輸入aapt檢查是否配置成功get
Jackeys-MacBook-Pro:~ jackey$ aapt Android Asset Packaging Tool Usage: aapt l[ist] [-v] [-a] file.{zip,jar,apk} List contents of Zip-compatible archive.
aapt dump badging <apk文件路徑>
示例:io
Jackeys-MacBook-Pro:desktop jackey$ aapt dump badging 瓜子二手車.apk package: name='com.ganji.android.haoche_c' versionCode='5510' versionName='5.5.1.0' platformBuildVersionName='5.5.1.0' compileSdkVersion='23' compileSdkVersionCodename='6.0-2438415' sdkVersion:'16' targetSdkVersion:'26'