WebDriverAgent is uninstalled from iPad and never installed again throwing xcode error:
“org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: 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”
Configuration:
Appium : 1.22.0/1.22.2/1.22.0/1.22.0-beta
Mac OS: macOS Monterey v12.1
Xcode: 13.0
java-client - 8.0.0-beta
Selenium - 4.1.0
Followed below tutorials:
https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md
Error Logs:
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: 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:
2022-01-21 11:49:21.109 xcodebuild[96868:1671553] [MT] IDETestOperationsObserverDebug: (2B376EA3-D48B-44EE-8EE5-A14AAC6B3949) Failed to make test runner session:
Error Domain=com.apple.dt.xctest.error Code=9 “Unable to connect to test manager on dfb994683be4aa90965d0836323ad4e7c0d04514” UserInfo={NSLocalizedDescription=Unable to connect to test manager on dfb994683be4aa90965d0836323ad4e7c0d04514, NSUnderlyingError=0x6000029748a0 {Error Domain=XCTMobileDeviceFramework Code=34 “The service is invalid.” UserInfo={NSLocalizedDescription=The service is invalid.}}}
2022-01-21 11:49:21.340 xcodebuild[96868:1671553] [MT] DTDKRemoteDeviceConnection: Failed to start Instruments daemon on device “dfb994683be4aa90965d0836323ad4e7c0d04514”: Error Domain=com.apple.dtdevicekit Code=811 “Failed to start remote service on device.” UserInfo={NSUnderlyingError=0x60000285cbd0 {Error Domain=com.apple.dt.MobileDeviceErrorDomain Code=-402653150 “The service is invalid.” UserInfo={MobileDeviceErrorCode=(0xE8000022), com.apple.dtdevicekit.stacktrace=(
0 DTDeviceKitBase 0x00000001149e781a DTDKCreateNSErrorFromAMDErrorCode + 233
1 DTDeviceKitBase 0x00000001149f9161 __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 564
2 DTDeviceKitBase 0x00000001149f8829 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22
3 DTDeviceKitBase 0x00000001149e9df9 __DTDKExecuteInSession_block_invoke_2 + 35
4 DTDeviceKitBase 0x00000001149e9209 __DTDKExecuteWithConnection_block_invoke_2 + 473
5 DTDeviceKitBase 0x00000001149e9007 __DTDKExecuteWithConnection_block_invoke + 106
6 libdispatch.dylib 0x00007ff806108cc9 _dispatch_client_callout + 8
7 libdispatch.dylib 0x00007ff8061164a1 _dispatch_sync_invoke_and_complete_recurse + 65
8 libdispatch.dylib 0x00007ff806115ffd _dispatch_sync_f_slow + 194
9 DVTFoundation 0x0000000110bdd368 DVTDispatchBarrierSync + 208
10 DVTFoundation 0x0000000110bb3cc3 -[DVTDispatchLock performLockedBlock:] + 64
11 DTDeviceKitBase 0x00000001149e8f08 DTDKExecuteWithConnection + 226
12 DTDeviceKitBase 0x00000001149e9c63 DTDKExecuteInSession + 376
13 DTDeviceKitBase 0x00000001149f866a __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 131
14 DVTFoundation 0x0000000110bda7f4 DVT_CALLING_CLIENT_BLOCK + 7
15 DVTFoundation 0x0000000110bdc436 __DVTDispatchAsync_block_invoke + 1194
16 libdispatch.dylib 0x00007ff806107ad8 _dispatch_call_block_and_release + 12
17 libdispatch.dylib 0x00007ff806108cc9 _dispatch_client_callout + 8
18 libdispatch.dylib 0x00007ff80610ecee _dispatch_lane_serial_drain + 696
19 libdispatch.dylib 0x00007ff80610f7fb _dispatch_lane_invoke + 417
20 libdispatch.dylib 0x00007ff8061197e1 _dispatch_workloop_worker_thread + 758
21 libsystem_pthread.dylib 0x00007ff8062bc074 _pthread_wqthread + 326
22 libsystem_pthread.dylib 0x00007ff8062baffb start_wqthread + 15
), DVTRadarComponentKey=261622, NSLocalizedDescription=The service is invalid.}}, NSLocalizedRecoverySuggestion=Please check your connection to your device., DVTRadarComponentKey=261622, NSLocalizedDescription=Failed to start remote service on device.}
*** If you believe this error represents a bug, please attach the result bundle at /Users/rishi/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Logs/Test/Test-WebDriverAgentRunner-2022.01.21_11-49-21-+0530.xcresult
2022-01-21 11:49:21.342 xcodebuild[96868:1671553] [MT] IDETestOperationsObserverDebug: 0.294 elapsed – Testing started completed.
2022-01-21 11:49:21.342 xcodebuild[96868:1671553] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec – start
2022-01-21 11:49:21.342 xcodebuild[96868:1671553] [MT] IDETestOperationsObserverDebug: 0.294 sec, +0.294 sec – end
Test session results, code coverage, and logs:
/Users/rishi/Library/Developer/Xcode/DerivedData/WebDriverAgent-ciegwgvxzxdrqthilmrmczmqvrgu/Logs/Test/Test-WebDriverAgentRunner-2022.01.21_11-49-21-+0530.xcresult
Testing failed:
WebDriverAgentRunner:
WebDriverAgentRunner-Runner.app encountered an error (Failed to establish communication with the test runner. (Underlying error: Unable to connect to test manager on dfb994683be4aa90965d0836323ad4e7c0d04514. (Underlying error: The service is invalid.)))
** TEST EXECUTE FAILED **
Testing started on ‘Rishi Khanna’s iPad’. 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.
Build info: version: ‘4.1.0’, revision: ‘87802e897b’
System info: host: ‘192.168.1.3’, ip: ‘fe80:0:0:0:10e1:8403:814d:ca22%en0’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.16’, java.version: ‘1.8.0_221’
Driver info: io.appium.java_client.ios.IOSDriver
Command: [null, newSession {capabilities=[{appium:autoAcceptAlerts=true, appium:bundleId=com.salido.ios.v2.staging.PointOfSale, appium:deviceName=iPad Pro (12.9-inch, 2nd generation) (Model A1670), appium:newCommandTimeout=500, appium:noReset=true, platformName=iOS, appium:platformVersion=15.0, appium:toggleSoftwareKeyboard=true, appium:udid=dfb994683be4aa90965d0836323ad4e7c0d04514, appium:useNewWDA=true, appium:usePrebuiltWDA=true, appium:wdaLocalPort=37001, appium:xcodeOrgId=7365A2X7SU, appium:xcodeSigningId=iPhone Developer}], desiredCapabilities=Capabilities {autoAcceptAlerts: true, bundleId: com.xxx, deviceName: iPad Pro (12.9-inch, 2nd ge…, newCommandTimeout: 500, noReset: true, platformName: iOS, platformVersion: 15.0, toggleSoftwareKeyboard: true, udid: xxx…, useNewWDA: true, usePrebuiltWDA: true, wdaLocalPort: 37001, xcodeOrgId:, xcodeSigningId: iPhone Developer}}]
Capabilities {}