You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Appium iOS真机测试求助:xcodebuild失败及自动化卡壳问题

解决Appium iOS真机测试xcodebuild错误65及自动化卡顿问题

Hey there, let's tackle this head-on—xcodebuild error 65 and stuck real-device automation are some of the most frustrating Appium iOS issues, but we can work through this step by step based on what you've shared:

1. Fix the xcodebuild Error 65 First

Error 65 almost always ties to code signing, provisioning profiles, or environment mismatches—even if your regular Xcode build works fine, Appium's command-line environment can behave differently:

  • Align Xcode signing settings with Appium:Open your Xcode project, navigate to Build Settings > Code Signing. Make sure your Provisioning Profile and Code Signing Identity are explicitly set for your iPhone 6 Plus and target app. If Appium isn't picking up these settings automatically, add xcodeOrgId (your Apple Developer Team ID) and xcodeSigningId (e.g., "iPhone Developer") directly to your Desired Capabilities to force the correct signing config.
  • Double-check your app's Bundle ID:Your app's Bundle ID must match the App ID you created in the Apple Developer Portal exactly (case-sensitive!). If you're testing a third-party app, you'll need to re-sign it using your own developer certificate and provisioning profile—use tools like ios-deploy or Xcode's Archive export workflow to do this.
  • Clear Xcode's build cache:Stale cache files often cause signing glitches. Run xcodebuild clean in your project directory, then delete the relevant folder in ~/Library/Developer/Xcode/DerivedData before retrying your Appium test.

2. Validate Provisioning Profiles & Certificates

Since you're unsure about your profile and certificate status, let's verify every piece:

  • Check local assets in Xcode:Open Xcode > Preferences > Accounts, select your developer account, then click Manage Certificates. Ensure you have a valid, unexpired iPhone Developer certificate. Next, hit Download Manual Profiles to pull all your provisioning profiles to your local machine.
  • Confirm your device's UDID is included:Log into the Apple Developer Portal, find your provisioning profile, and check that your iPhone 6 Plus's UDID is listed in the "Devices" section of the profile. If it's missing, add it, re-download the profile, and import it into Xcode.
  • Verify signing via command line:Run codesign -dv --verbose=4 /path/to/your/test.app (or .ipa file). Look for the Authority field matching your developer certificate and the Identifier field matching your app's Bundle ID—any discrepancies here mean your signing setup is broken.

3. Unstick the UI Automation Flow

Even if Xcode builds succeed, real-device Appium automation has a few easy-to-overlook details:

  • Re-verify automation permissions on the device:You mentioned enabling UI Automation and trusting your account, but double-check:
    1. Go to Settings > General > VPN & Device Management > Select your developer account > Tap "Trust [Your Account]".
    2. Navigate to Settings > Privacy & Security > Automation and ensure your test app (or Xcode) has permission to control other apps.
  • Tweak your Desired Capabilities:Alongside the standard settings (platformName, deviceName, app), add these critical entries:
    • udid: Grab this using idevice_id -l in Terminal
    • automationName: Set to XCUITest (required for real iOS devices)
    • noReset: Set to true to avoid re-installing the app on every test run, which can break signing
  • Test with a raw XCUITest project:Create a simple XCUITest in Xcode and run it directly on your iPhone. If this fails, the problem is with your device/developer account setup (e.g., missing UDID, invalid profile). If it works, the issue lies in your Appium configuration.

内容的提问来源于stack exchange,提问作者sai charan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 07:38:06