本文节选自霍格沃兹测试学院内部教材
本章节主要讲解 iOS 自动化真机配置以及在 iOS 真机执行自动化时常见问题与解决方法。
真机使用的Capability
与模拟器不同,真机测试需要如下的 Capability
方式一:设置 App 路径,启动 App(自动安装 App)
{ "app": "/Users/seveniruby/Library/Developer/Xcode/DerivedData/UICatalog-ftyzdbgapjmxxobezrnrxsshpdqh/Build/Products/Debug-iphoneos/UICatalog.app", "automationName": "XCUITest", "platformName": "ios", "xcodeOrgId": "xxxxxx", "xcodeSigningId": "iPhone Developer", "udid": "9df22446af15919c494c85b4c1c8b00eaa3a5bd0"}
方式二:根据 App 包名启动 App
{ "platformName": "ios", "bundleId": "com.example.apple-samplecode.UICatalog", "automationName": "XCUITest", "deviceName": "iPhone", "udid": "auto", "xcodeOrgId": "xxxxx", "xcodeSigningId": "iPhone Developer"}
https://ceshiren.com/t/topic/11539
注意:编译成功后需要在手机里信任证书
使用Appium Desktop验证环境
以上步骤完成后,出现下图表示真机环境配置成功
常见问题
问题一
Failed to register bundle identifier
问题二
执行 instruments -s devices 命令报错:Hogwarts $ instruments -s devices xcode-select: error: tool 'instruments' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
问题三
运行脚本过程中,手动停止脚本时,偶尔会报错 Showing All Messages WebDriverAgentRunner-Runner.app (3413) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying error: The test runner exited with code 74 before checking in.))
问题四
note: Using new build systemnote: Building targets in parallelnote: Planning buildnote: Constructing build descriptionerror: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "L62JHCGMQW" with a private key was found. (in target 'WebDriverAgentLib' from project 'WebDriverAgent')error: No profiles for 'com.facebook.WebDriverAgentRunner.xctrunner' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.facebook.WebDriverAgentRunner.xctrunner'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'WebDriverAgentRunner' from project 'WebDriverAgent')
问题五
Assertions: System: Early unexpected exit, operation never finished bootstrapping - no restart will beattempted. (Underlying Error: The test runner exited with code 74 before checking in. If you believe thiserror represents a bug, please attach the result bundle at/Users/dzkair/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2020.11.26_10-47-38-+0800.xcresult)
常见问题给大家总结了这些,如果大家有遇到其他的问题也可以在下方留言哦~
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有