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

Did WebDriverAgent showed you ‘Build Succeeded’ in Xcode?

This seem recent problem for me. Last week my dev environment was working just fine. Appium 1.7.1 both UI version and console version were working. I also have iOS11 on my real device iPhone. I have followed these steps many times before and it worked. Yes it compiles in xCode too.

Then today I launch Appium UI and I see an update message. Let it download and restart. Now when I launch a session it either does not work or it takes a crazy long time. Like I gave up waiting, and went to do something else. Then later I see it actually worked. Just too forever.

Finding same thing launching the inspector tool from Appium UI.

Start Server v1.7.1
Click on UI inspector tool icon
See dialog pop up
Select from my pre-saved settings that I have been using for a while now
Start Session

See cute little spinny thing rotating around. Session actually starts on phone. Back on the Mac cute spinny thing still going and going.

Yes @Venkatesh_Akula. Its displaying Build Succeeded. But the WebDriverAgent app is not displaying in mobile.

When you run the test case keep an eye on your Mobile screen, the webdriver agent app will be installed and uninstall immediately. I don’t know the reason for this, but what you should do here is as soon as you see the webdriver agent app installed disconnect the cable from mac

Then in iPhone > Settings > General > Profiles & Device Management

webdriver agent will be listed here > tap on it and click ‘Trust’ option. Come to home screen & click on webdriver agent app once, you should see the app opens & a black screen is displayed.

Reconnect the device and rerun your test cases., it should work.

1 Like

Hello @Venkatesh_Akula @KARUNAKAR Are you able to resolve this issue

I am also getting same problem and could not able to find the root cause, i think i had code sign everything properly but getting the same error

“xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.

@venkat4 my issue is resolved, check if this video helps.

https://youtube.com/watch?v=TprXEKBnfmA

1 Like

Thanks to all… My issue also resolved.

@Venkatesh_Akula i tried everything whatever is explained in the video except this (Settings => General => Device Management on the device to trust the developer and allow the WebDriverAgentRunner)

I could not find WebDriverAgent in device management settings to trust it. is there anything else i need to do?
and by the way is it simulator or real device in the video?

** Ensure you trust the developer in your real iPhone else, the app will get deleted as soon as its installed.

When you run the test case keep an eye on your Mobile screen, the webdriver agent app will be installed and uninstall immediately. I don’t know the reason for this, but what you should do here is as soon as you see the webdriver agent app installed disconnect the cable from mac

Then in iPhone - Settings - General - Profiles & Device Management

webdriver agent will be listed here - tap on it and click ‘Trust’ option. Come to home screen & click on webdriver agent app once, you should see the app opens & a black screen is displayed.

Reconnect the device and rerun your test cases., it should work. Try this multiple times until you get it right.

@Venkatesh_Akula When webdriver agent app is installed and then when i removed the cable, i could not find in iPhone - Settings - General - Profiles & Device Management. Tried several times but no luck. is there any other work around

Oh, you have to unplug the cable immediately. You can follow the steps in this link for other ways to make this work.

https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md

Yes followed all the steps but no luck, i am not understanding which configuration or permissions got messed up. I had open ticket, please check for detail info

@venkat4 Guys, it happens when setup for appium have some problem in configuring webdriver-agent in appium library, you can even configure webdriver-agent with free apple developer account as well, follow these steps in video: https://www.youtube.com/watch?v=dyijACVRQOc
It worked for me, hope it will help everybody here!
Still you find any problem, comment on that video, they will follow :slight_smile: Happy testing:)

I am able to launch WebDriverAgentRunner but it just opens and closes with appium logs as below:


[Xcode] 2018-03-26 15:44:15.722 xcodebuild[60272:1079899] Error Domain=IDETestOperationsObserverErrorDomain Code=6 “Early unexpected exit, operation never finished bootstrapping - no restart will be attempted” UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
[Xcode]
[Xcode] ** TEST EXECUTE FAILED **
[Xcode]
[Xcode]
[Xcode] 2018-03-26 15:44:15.558835+1100 WebDriverAgentRunner-Runner[340:134041] +[CATransaction synchronize] called within transaction
[Xcode] 2018-03-26 15:44:15.620290+1100 WebDriverAgentRunner-Runner[340:134041] Running tests…
[Xcode] 2018-03-26 15:44:15.665479+1100 WebDriverAgentRunner-Runner[340:134041] The bundle “WebDriverAgentRunner” couldn’t be loaded because its executable couldn’t be located. Try reinstalling the bundle.
[Xcode]
[XCUITest] xcodebuild exited with code ‘65’ and signal ‘null’
[BaseDriver] Event ‘wdaStartFailed’ logged at 1522039455748 (15:44:15 GMT+1100 (AEDT))
[XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: “xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 60271)
[XCUITest] iproxy exited with code ‘null’
[XCUITest] Removing WDA application from device
[XCUITest] Error: Unable to launch WebDriverAgent because of xcodebuild failure: “xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md.


But when executing using a simulator, the test executes successfully.

@villaoj Experiencing the same issue. Did you get any solution for the same?
Appium Desktop: 1.15.1
iPhone XR: 13.5(real device)
Xcode: 11.7

I have already tried below mentioned steps but issue didn’t resolve:

  1. Getting ‘Build Succeeded’ for WebDriverAgent in Xcode
  2. Changed the Dev id in Xcode
  3. Updated Product bundle identifier in build setting of WebDriverAgent Runner in Xcode
  4. Trusted the certificate under Setting->General->Device & Management but it’s disappearing after uninstalling the WDA(automatically).

Could you please let me know how did resolve this issue, same issue i am facing.

Thanks it worked . I underwent certificate issue on solving I need to update my team in ‘signings&capability’ for webdriver agent project in xcode. That was missing , after that it was working fine. Thanks.

@venkat4 check your webdriveragent xcode project, mostly that will be issue for you I think

1 Like

Hi karunakar- aim also getting the saem error. Please help if you the solution.

An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 xcodebuild error message: 2021-05-12 14:07:35.523 xcodebuild[78359:12003961] Error writing xctestrun file: Error Domain=NSCocoaErrorDomain Code=4 “The folder “WebDriverAgentRunner_iphoneos14.4-arm64.xctestrun” doesn’t exist.” UserInfo={NSFilePath=/Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/WebDriverAgentRunner_iphoneos14.4-arm64.xctestrun, NSUserStringVariant=Folder, NSUnderlyingError=0x7ff386ca2740 {Error Domain=NSPOSIXErrorDomain Code=2 “No such file or directory”}} ** TEST BUILD FAILED ** 2021-05-12 14:07:35.538 xcodebuild[78359:12003835] IDETestOperationsObserverDebug: Writing diagnostic log for test session to: /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-94955281-E571-4AD7-BB4B-A47EABC6B628/WebDriverAgentRunner-D8D80355-9303-4267-BBBC-AA66E240F468/Session-WebDriverAgentRunner-2021-05-12_140735-YOpZwe.log 2021-05-12 14:07:35.539 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: (BBAF54B9-ABD5-48C4-840C-8256F39825E2) Beginning test session WebDriverAgentRunner-BBAF54B9-ABD5-48C4-840C-8256F39825E2 at 2021-05-12 14:07:35.538 with Xcode 12D4e on target :iphone:<DVTiOSDevice (0x7ff387787650), Shoprite’s iPhone, iPhone, 14.4 (18D52), 36408a21f5fd8a5e8a06f210fcfb6ad4890e8525> { deviceSerialNumber: F71Y6ZSRHG7F identifier: 36408a21f5fd8a5e8a06f210fcfb6ad4890e8525 deviceClass: iPhone deviceName: Shoprite’s iPhone deviceIdentifier: 36408a21f5fd8a5e8a06f210fcfb6ad4890e8525 productVersion: 14.4 buildVersion: 18D52 deviceSoftwareVersion: 14.4 (18D52) deviceArchitecture: arm64 deviceTotalCapacity: 25221414912 deviceAvailableCapacity: 14180786176 deviceIsTransient: NO ignored: NO deviceIsBusy: NO deviceIsPaired: YES deviceIsActivated: YES deviceActivationState: Activated isPasscodeLocked: NO deviceType: <DVTDeviceType:0x7ff3844faa90 Xcode.DeviceType.iPhone> supportedDeviceFamilies: ( 1 ) applications: (null) provisioningProfiles: (null) hasInternalSupport: NO hasWritableSystem: NO isSupportedOS: YES bootArgs: (null) nextBootArgs: (null) connected: YES isWirelessEnabled: NO connectionType: direct hostname: Shoprites-iPhone.local. bonjourServiceName: e8:36:17:26:6e:94@fe80::ea36:17ff:fe26:6e94._apple-mobdev2._tcp.local. activeProxiedDevice: (null) } (14.4 (18D52)) 2021-05-12 14:07:35.653 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: (BBAF54B9-ABD5-48C4-840C-8256F39825E2) Finished requesting crash reports. Continuing with testing. *** If you believe this error represents a bug, please attach the result bundle at /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult 2021-05-12 14:07:35.677 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: 0.144 elapsed – Testing started completed. 2021-05-12 14:07:35.677 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec – start 2021-05-12 14:07:35.677 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: 0.144 sec, +0.144 sec – end Test session results, code coverage, and logs: /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult Testing failed: Signing for “WebDriverAgentRunner” requires a development team. Select a development team in the Signing & Capabilities editor. WebDriverAgentRunner: WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult. (Underlying Error: The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file. The file doesn’t exist. (Underlying Error: The operation couldn’t be completed. No such file or directory))) ** TEST EXECUTE FAILED ** Testing started. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.

Hey pawan, did you get it resolved. Please help.

iam getting the same

An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 xcodebuild error message: 2021-05-12 14:07:35.523 xcodebuild[78359:12003961] Error writing xctestrun file: Error Domain=NSCocoaErrorDomain Code=4 “The folder “WebDriverAgentRunner_iphoneos14.4-arm64.xctestrun” doesn’t exist.” UserInfo={NSFilePath=/Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Build/Products/WebDriverAgentRunner_iphoneos14.4-arm64.xctestrun, NSUserStringVariant=Folder, NSUnderlyingError=0x7ff386ca2740 {Error Domain=NSPOSIXErrorDomain Code=2 “No such file or directory”}} ** TEST BUILD FAILED ** 2021-05-12 14:07:35.538 xcodebuild[78359:12003835] IDETestOperationsObserverDebug: Writing diagnostic log for test session to: /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult/Staging/2_Test/Diagnostics/WebDriverAgentRunner-94955281-E571-4AD7-BB4B-A47EABC6B628/WebDriverAgentRunner-D8D80355-9303-4267-BBBC-AA66E240F468/Session-WebDriverAgentRunner-2021-05-12_140735-YOpZwe.log 2021-05-12 14:07:35.539 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: (BBAF54B9-ABD5-48C4-840C-8256F39825E2) Beginning test session WebDriverAgentRunner-BBAF54B9-ABD5-48C4-840C-8256F39825E2 at 2021-05-12 14:07:35.538 with Xcode 12D4e on target :iphone:<DVTiOSDevice (0x7ff387787650), Shoprite’s iPhone, iPhone, 14.4 (18D52), 36408a21f5fd8a5e8a06f210fcfb6ad4890e8525> { deviceSerialNumber: F71Y6ZSRHG7F identifier: 36408a21f5fd8a5e8a06f210fcfb6ad4890e8525 deviceClass: iPhone deviceName: Shoprite’s iPhone deviceIdentifier: 36408a21f5fd8a5e8a06f210fcfb6ad4890e8525 productVersion: 14.4 buildVersion: 18D52 deviceSoftwareVersion: 14.4 (18D52) deviceArchitecture: arm64 deviceTotalCapacity: 25221414912 deviceAvailableCapacity: 14180786176 deviceIsTransient: NO ignored: NO deviceIsBusy: NO deviceIsPaired: YES deviceIsActivated: YES deviceActivationState: Activated isPasscodeLocked: NO deviceType: <DVTDeviceType:0x7ff3844faa90 Xcode.DeviceType.iPhone> supportedDeviceFamilies: ( 1 ) applications: (null) provisioningProfiles: (null) hasInternalSupport: NO hasWritableSystem: NO isSupportedOS: YES bootArgs: (null) nextBootArgs: (null) connected: YES isWirelessEnabled: NO connectionType: direct hostname: Shoprites-iPhone.local. bonjourServiceName: e8:36:17:26:6e:94@fe80::ea36:17ff:fe26:6e94._apple-mobdev2._tcp.local. activeProxiedDevice: (null) } (14.4 (18D52)) 2021-05-12 14:07:35.653 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: (BBAF54B9-ABD5-48C4-840C-8256F39825E2) Finished requesting crash reports. Continuing with testing. *** If you believe this error represents a bug, please attach the result bundle at /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult 2021-05-12 14:07:35.677 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: 0.144 elapsed – Testing started completed. 2021-05-12 14:07:35.677 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec – start 2021-05-12 14:07:35.677 xcodebuild[78359:12003759] [MT] IDETestOperationsObserverDebug: 0.144 sec, +0.144 sec – end Test session results, code coverage, and logs: /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult Testing failed: Signing for “WebDriverAgentRunner” requires a development team. Select a development team in the Signing & Capabilities editor. WebDriverAgentRunner: WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Users/dautomation/Library/Developer/Xcode/DerivedData/WebDriverAgent-alwvnomvwrdtzoaxbbkniqrpcdpp/Logs/Test/Test-WebDriverAgentRunner-2021.05.12_14-07-35-+0200.xcresult. (Underlying Error: The file “WebDriverAgentRunner-Runner.app” couldn’t be opened because there is no such file. The file doesn’t exist. (Underlying Error: The operation couldn’t be completed. No such file or directory))) ** TEST EXECUTE FAILED ** Testing started. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.