appium 遇到 xcodebuild failed with code 65 的解决方法

运行时提示

Unable to launch WebDriverAgent because of xcodebuild failure:xcodebuild failed with code 65

 

解决方法:

1开发者账号:

使用AppiumDesktop启动Appium

AppiumDesktop中加入 xcodeOrgId 和xcodeSigningId 字段

appium 遇到 xcodebuild failed with code 65 的解决方法

TeamID 在 https://developer.apple.com/account/ 里左侧的 Membership 中找到

appium 遇到 xcodebuild failed with code 65 的解决方法

使用命令启动Appium

在执行测试文件的desired_capabilities配置中添加相关字段

{

       "xcodeOrgId":"<TeamID>",

       "xcodeSigningId":"iPhoneDeveloper"

}

仅第一次需要以上字段。

 

2免费Apple ID账号

appium的出错日志中找到WebDriverAgent的位置,打开进行签名

[XCUITest] Using WDA path:'/usr/local/lib/node_modules/appium/node_modules/[email protected]/WebDriverAgent'

更改 WebDriverAgent BundleID ,原来是com.facebook.WebDriverAgentLib,我建议把facebook改为你的名字或公司的名字,这里还有个坑,改完这个之后发现还是提示有错误,最后在BuildSettings里的Product Bundle Identifier里再修改一下。

appium 遇到 xcodebuild failed with code 65 的解决方法

点击上面菜单栏的Product-> Test运行
第一次运行会提示没有权限,打开真机上的设置App,通用 ->描述文件与设备管理,找到你的邮箱,选择信任,再继续执行test,成功启动后就说明可以了,执行完毕后点击停止。

没有了,打开appium测试吧

免费 Apple ID 账号7天后会过期,需要重新签名


作者作品:

《Selenium、Appium、OkHttp自动化测试实战》
https://yuedu.baidu.com/ebook/1e229edbbdeb19e8b8f67c1cfad6195f302be803

《Selenium、Appium、Requests自动化测试实战Python版》
https://yuedu.baidu.com/ebook/fd0737a709a1284ac850ad02de80d4d8d05a0160

《Fiddler使用教程》
https://yuedu.baidu.com/ebook/eb57a65de97101f69e3143323968011ca300f73d