如何在Appium上设置仪器的路径



我正试图为iOS应用程序运行Appium,但仪器的路径似乎无效。我该如何设置?是否有我应该使用的环境变量?还是一些争论?即使我可以在源代码中更改这一点,这对我来说也很有用:)

以下是我从Appium收到的日志的相关部分:

info: instruments is: 
info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock
info: Spawning instruments with command:  -t /usr/local/lib/node_modules/appium/app/uiauto/Automation.tracetemplate /var/folders/rd/z5t93lfj0cx0wm2_hqmthnkr0000gn/T/TestApp.app -e UIASCRIPT /usr/local/lib/node_modules/appium/app/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments/

谢谢!

您可以使用sudo xcode-select --switch /path/to/Xcode.app来选择要与appium一起使用的Xcode版本。

好的,在代码中进行一些挖掘后,Appium似乎通过使用命令xcrun -find instruments来获取其"Instruments"路径。

xcrun本身有缓存,所以如果您更改/删除了xcode,您可能应该运行xcrun -kill-cache -find instruments

这将清除缓存,但不一定会将xcrun指向正确的路径。为此,您应该添加环境变量DEVELOPER_DIR以指向Xcode开发人员目录,例如/Applications/Xcode.app/Contents/Developer

最新更新