0

我正在尝试在终端上运行 Appium 1.6.3,以便可以在 iOS 模拟器上运行 Appium。过去,我可以在终端上启动 Appium。自从我将 mac OS 升级到 10.12.3 后,我在尝试运行它时总是收到以下错误:

-bash: appium: command not found

当我尝试运行 appium-doctor 时,通常会得到以下诊断:

info AppiumDoctor Appium Doctor v.1.3.0
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor  ✔ Node version is 6.9.4
info AppiumDoctor  ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
WARN AppiumDoctor  ✖ Xcode Command Line Tools are NOT installed!
WARN AppiumDoctor  ✖ DevToolsSecurity is NOT enabled!
info AppiumDoctor  ✔ The Authorization DB is set up properly.
info AppiumDoctor  ✔ Carthage was found at: /usr/local/bin/carthage
info AppiumDoctor  ✔ HOME is set to: /Users/jakerushing
info AppiumDoctor  ✔ ANDROID_HOME is set to: /Users/jakerushing/Library/Android/sdk
info AppiumDoctor  ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
info AppiumDoctor  ✔ adb exists at: /Users/jakerushing/Library/Android/sdk/platform-tools/adb
info AppiumDoctor  ✔ android exists at: /Users/jakerushing/Library/Android/sdk/tools/android
info AppiumDoctor  ✔ emulator exists at: /Users/jakerushing/Library/Android/sdk/tools/emulator
info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, 2 fixes needed. ###

当我尝试运行时xcode-select --install,我收到错误消息,指出工具已安装,并且 DevToolsSecurity 已启用。我尝试卸载 XCode 命令工具并重新安装,但这并没有解决问题。我试图解决这个问题几天,但我找不到这些问题的任何答案。我对这个问题束手无策。

非常感谢任何输入。

4

3 回答 3

0

在您的日志中:

WARN AppiumDoctor  ✖ Xcode Command Line Tools are NOT installed!
WARN AppiumDoctor  ✖ DevToolsSecurity is NOT enabled!

解决方法:运行下面的命令,然后再次尝试重新启动 Appium Doctor

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
DevToolsSecurity -enable
于 2017-02-07T02:35:35.097 回答
0

所以我找到了解决我的主要问题的方法,当我输入 appium 时 appium 没有运行

我在网上找到了这篇博文,并阅读了说明。之后,我就可以再次运行 appium 命令了!

https://solidgeargroup.com/automated-test-for-ios-with-appium-set-up-the-environment-2

写这篇文章的人为我节省了很多时间,我本来可以浪费在寻找解决方案上。你是圣人。

但是,我仍然无法检测到 DevToolsSecurity。当我输入 /usr/sbin/DevToolsSecurity -enable 时,它​​说开发者模式已经启用,但是当我运行 appium-doctor 或 authorize-ios 时,它们都返回以下内容:

Error: Command 'DevToolsSecurity' not found. Is it installed?
ERR! AuthorizeIOS     at ChildProcess.<anonymous> (/Users/jakerushing/.node/lib/node_modules/authorize-ios/node_modules/teen_process/build/lib/teen_process.js:71:14)
于 2017-02-07T22:59:50.663 回答
0

在终端中运行此命令:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
于 2020-07-05T12:55:58.317 回答