macOS通过Brew安装bundletool后,appium-doctor无法识别该工具
解决Appium Doctor无法识别brew安装的bundletool问题
问题原因
通过brew install bundletool安装的bundletool是封装脚本,而非Appium Doctor默认查找的bundletool.jar文件,因此出现识别失败的警告。
解决方案
方案1:设置BUNDLETOOL_JAR环境变量
获取bundletool的jar包路径:
先执行命令拿到bundletool的安装根目录:brew --prefix bundletool输出类似
/opt/homebrew/Cellar/bundletool/1.15.0,进入该目录下的libexec文件夹,即可找到bundletool-all.jar,完整路径示例为/opt/homebrew/Cellar/bundletool/1.15.0/libexec/bundletool-all.jar。配置环境变量:
打开你的shell配置文件(如~/.zshrc或~/.bash_profile),添加以下内容(替换为你实际的jar路径):export BUNDLETOOL_JAR="/opt/homebrew/Cellar/bundletool/1.15.0/libexec/bundletool-all.jar"使配置生效:
source ~/.zshrc验证:
执行echo $BUNDLETOOL_JAR确认路径正确,再运行appium-doctor即可看到警告消失。
方案2:创建软链接指向jar包
直接将bundletool的jar包链接到PATH目录下,命名为bundletool.jar让Appium Doctor识别:
ln -s /opt/homebrew/Cellar/bundletool/[你的版本号]/libexec/bundletool-all.jar /opt/homebrew/bin/bundletool.jar
替换[你的版本号]为实际版本(如1.15.0),执行后重新运行appium-doctor即可。
内容的提问来源于stack exchange,提问作者Patrick Kenny
相关产品推荐
相关产品推荐

