天天看點

iOS自動化真機測試驗證環境過程中常見問題解析

本章節主要講解 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"
}           

使用Appium Desktop驗證環境

以上步驟完成後,出現下圖表示真機環境配置成功

iOS自動化真機測試驗證環境過程中常見問題解析

常見問題

問題一

問題二

問題三

  • 解決方法:重新開機手機或者拔掉 IOS 資料線,重新連接配接電腦

問題四

note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
error: 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 be
attempted. (Underlying Error: The test runner exited with code 74 before checking in. If you believe this
error 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)           
  • 解決方法:重新插拔手機即可

    常見問題給大家總結了這些,如果大家有遇到其他的問題也可以在下方留言哦~

繼續閱讀