iphone – UIAutomation:无法授权状态为-60007的权利

iphone – UIAutomation:无法授权状态为-60007的权利,第1张

概述所以我在命令行上运行UIAutomation $instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate <path-to-yo 所以我在命令行上运行UIautomation

$instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/library/Instruments/PlugIns/automationInstrument.bundle/Contents/Resources/automation.tracetemplate <path-to-your-app>/<appname>.app/ -e UIASCRIPT <path-to-your-Js-test-file> -e UIARESulTSPATH <path-to-results-folder>

这工作正常,模拟器打开,应用程序运行,但卡住此错误.

Failed to authorize rights (0x2) with status: -60007

我认为这与权限有关.

我该怎么做?

解决方法 这就是我在 Instruments via command line – jenkins发布的答案

这里甚至还有关于Xcode command line authorization prompt error的博客文章

我会在这里再解释一下:

我做的是以下内容:

>将jenkins用户标记为管理员(遗憾的是,似乎没有其他方式atm)
>转到/ etc / authorization
>搜索关键system.privilige.taskport
>将allow-root的值更改为true

<key>system.privilege.taskport</key><dict>    <key>allow-root</key>    <false/> // change to -> <true>    <key>class</key>    <string>user</string>    <key>comment</key>    <string>Used by task_for_pID(...).    ...</dict>

现在我可以使用jenkins通过命令行脚本运行我的UIautomation-Tests

编辑

为了让jenkins认识到一个成功的构建,我没有一个完美的解决方案,但以下解决方法:

...echo "Run instruments simulator"instruments -t "$ORDER_autoMATION_TEST_TEMPLATE_PATH" "$file_DEBUG_APP" -e UIASCRIPT "$ORDER_autoMATION_TESTSCRIPT_PATH" -e UIARESulTSPATH "$DIRECTORY_INSTRUMENTS_RESulT"returnCode=0if test -a "Run 1/Assertion Failed.png"; thenecho "Failed"returnCode=1elseecho "passed"returnCode=0firm -fR "Run 1"rm -fR "instrumentscli0.trace"echo "Removing app dir"echo "$file_APPliCATIONS"rm -fR "$file_APPliCATIONS"echo $returnCodeexit $returnCode

编辑2
检查自动化测试是否成功运行的更好方法:

# cleanup the tracefiles produced from instrumentsrm -rf *.trace##kill simulator afterwardskillall "iPhone Simulator"##check if failures occured# fail script if any failures have been generatedif [ `grep "<string>Error</string>" "$WORKSPACE/automation Results/Run 1/automation Results.pList" | wc -l` -gt 0 ]; then    echo 'Build Failed'    exit -1else    echo 'Build Passed'    exit 0fi
总结

以上是内存溢出为你收集整理的iphone – UIAutomation:无法授权状态为-60007的权利全部内容,希望文章能够帮你解决iphone – UIAutomation:无法授权状态为-60007的权利所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1030061.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存