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 yourProvisioning ProfileandCode Signing Identityare explicitly set for your iPhone 6 Plus and target app. If Appium isn't picking up these settings automatically, addxcodeOrgId(your Apple Developer Team ID) andxcodeSigningId(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-deployor Xcode's Archive export workflow to do this. - Clear Xcode's build cache:Stale cache files often cause signing glitches. Run
xcodebuild cleanin your project directory, then delete the relevant folder in~/Library/Developer/Xcode/DerivedDatabefore 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 clickManage Certificates. Ensure you have a valid, unexpirediPhone Developercertificate. Next, hitDownload Manual Profilesto 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 theAuthorityfield matching your developer certificate and theIdentifierfield 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:
- Go to Settings > General > VPN & Device Management > Select your developer account > Tap "Trust [Your Account]".
- 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 usingidevice_id -lin TerminalautomationName: Set toXCUITest(required for real iOS devices)noReset: Set totrueto 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
相关产品推荐
相关产品推荐

