question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to start WebDriverAgent session: An unknown server-side error occurred while processing the command. Original error: Failed to launch com.apple.mobilesafari application - Appium1.6.3 -iOS 10.1

See original GitHub issue

The problem

I am able to run a test but when the test finishes and breaks down I cannot run a second test. Appium gives the error “Unable to start WebDriverAgent session: An unknown server-side error occurred while processing the command. Original error: Failed to launch com.apple.mobilesafari application”

I am skeptical that the tear down for the webDriverAgent is working correctly.

This is the appium log when the test teardown begins:

[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 77924)
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] Shutting down Logger process (pid 77953)
[XCUITest] System log exited with code '0'
[XCUITest] Shutting down iproxy process (pid 77968)
[XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] In a web session. Removing remote debugger
[debug] [RemoteDebugger] Disconnecting from WebKit remote debugger
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Full reset requested. Will try to uninstall the app 'com.apple.mobilesafari'.
[debug] [RemoteDebugger] WebKit remote debugger socket disconnected
[debug] [XCUITest] Removed 'com.apple.mobilesafari'
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[Appium] Removing session 78670595-13ca-4dde-baa0-dd776892509d from our master session list
[debug] [MJSONWP] Received response: null
[debug] [MJSONWP] But deleting session, so not returning
[debug] [MJSONWP] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/78670595-13ca-4dde-baa0-dd776892509d 200 742 ms - 76

Then appium tries to creates a new XCUITestDriver session and fails

[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"orientation":"LANDSCAPE","newCommandTimeout":0,"platformVersion":"10.1","bundleId":"com.apple.mobilesafari","automationName":"XCUITest","browserName":"Safari","platformName":"iOS","deviceName":"iPHONE7","fullReset":true,"autoAcceptAlerts":true}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"orientation":"LANDSCAPE","newCommandTimeout":0,"platformVersion":"10.1","bundleId":"com.apple.mobilesafari","automationName":"XCUITest","browserName":"Safari","platformName":"iOS","deviceName":"iPHONE7","fullReset":true,"autoAcceptAlerts":true},null,null,null,null,null,null]
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium]   orientation: 'LANDSCAPE'
[Appium]   newCommandTimeout: 0
[Appium]   platformVersion: '10.1'
[Appium]   bundleId: 'com.apple.mobilesafari'
[Appium]   automationName: 'XCUITest'
[Appium]   browserName: 'Safari'
[Appium]   platformName: 'iOS'
[Appium]   deviceName: 'iPHONE7'
[Appium]   fullReset: true
[Appium]   autoAcceptAlerts: true
[Appium]   udid: 'f654d84df7011a1897829a2c65c457f7b11413ca'
[debug] [XCUITest] XCUITestDriver version: 2.4.2
[BaseDriver] Session created with session id: 223643bc-8602-42a4-8b44-f683b01f46f1
[debug] [XCUITest] Xcode version set to '8.1'
[debug] [XCUITest] iOS SDK Version set to '10.1'
[debug] [XCUITest] Available devices: f654d84df7011a1897829a2c65c457f7b11413ca
[debug] [XCUITest] Creating iDevice object with udid f654d84df7011a1897829a2c65c457f7b11413ca
[XCUITest] Determining device to run tests on: udid: 'f654d84df7011a1897829a2c65c457f7b11413ca', real device: true
[XCUITest] Safari test requested
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[XCUITest] Setting up real device
[XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Using real device logger 'idevicesyslog'
[debug] [XCUITest] Beginning test with command 'xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=f654d84df7011a1897829a2c65c457f7b11413ca -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users//Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/6F641A3D-6C27-4ED5-8442-513752A8777B/Session-WebDriverAgentRunner-2016-12-20_123521-XYqZi2.log
[debug] [WebDriverAgent] Device: Dec 20 12:35:25 Barros-Justin-irvins-iPhone XCTRunner[245] <Notice>: Running tests...
[debug] [WebDriverAgent] Device: Dec 20 12:35:26 Barros-Justin-irvins-iPhone XCTRunner[245] <Notice>: Continuing to run tests in the background with task ID 1
[XCUITest] Detected that WebDriverAgent is running at url 'http://11.255.187.116:8100'
[XCUITest] WebDriverAgent started at url 'http://11.255.187.116:8100'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB

Gets stuck here

[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.apple.mobilesafari","arguments":["-u","http://appium.io"],"shouldWaitForQuiescence":true}}

then:

[debug] [JSONWP Proxy] Got response with status 200: {"value":"Failed to launch com.apple.mobilesafari application","sessionId":"A5F5078B-70FE-4D74-9AFD-825A08C44739","status":13}
[debug] [XCUITest] Unable to start WebDriverAgent session: An unknown server-side error occurred while processing the command. Original error: Failed to launch com.apple.mobilesafari application
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 78035)
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] Shutting down Logger process (pid 78040)
[XCUITest] System log exited with code '0'
[XCUITest] Shutting down iproxy process (pid 78066)
[XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Launching WebDriverAgent on the device

Then it tries to launch WebDriverAgent on the device again, and again, and again… (in full appium logs)

Eventually times out and fails again:

[debug] [XCUITest] Unable to start WebDriverAgent session: An unknown server-side error occurred while processing the command. Original error: Failed to launch com.apple.mobilesafari application
[XCUITest] UnknownError: An unknown server-side error occurred while processing the command. Original error: Failed to launch com.apple.mobilesafari application
    at errorFromCode (../../../lib/mjsonwp/errors.js:398:10)
    at XCUITestDriver.callee$0$0$ (../../../lib/commands/proxy-helper.js:22:11)
    at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at run (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:108:47)
    at /usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/es6.promise.js:119:28
    at flush (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.microtask.js:19:5)
    at nextTickCallbackWith0Args (node.js:436:9)
    at process._tickCallback (node.js:365:13)
 { [UnknownError: An unknown server-side error occurred while processing the command. Original error: Failed to launch com.apple.mobilesafari application] jsonwpCode: 13 }
[debug] [JSONWP Proxy] Proxying [DELETE /session/411b1aa8-8c67-4902-b668-a8ed6173447b] to [DELETE http://localhost:8100/session/F69F5400-C9F9-486B-934B-CB18C83280BE] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n  \"value\" : {\n\n  },\n  \"sessionId\" : \"91C7EA60-0CB3-4BBE-B6ED-EEC254D138A9\",\n  \"status\" : 0\n}"
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 99379)
[XCUITest] xcodebuild exited with code 'null' and signal 'SIGTERM'
[XCUITest] Shutting down Logger process (pid 99396)
[XCUITest] System log exited with code '0'
[XCUITest] Shutting down iproxy process (pid 99406)
[XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Full reset requested. Will try to uninstall the app 'com.apple.mobilesafari'.
[debug] [XCUITest] Removed 'com.apple.mobilesafari'
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[HTTP] <-- POST /wd/hub/session 500 403726 ms - 188

Environment

  • Appium version: 1.6.3
  • Desktop OS/version used to run Appium: OSX 10.11.6
  • Node.js version (unless using Appium.app|exe): 4.7.0
  • Mobile platform/version under test: ios 10.1, iphone 7

Link to Appium logs

Appium Logs

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jlippscommented, Dec 27, 2016

@mollywhitnack just as an FYI, you shouldn’t need to specify the bundleId capability if you have browserName set to Safari, as you do here.

0reactions
lock[bot]commented, Apr 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to start WebDriverAgent session: An unknown server ...
Original error : Failed to launch com.apple.mobilesafari application - Appium1.6.3 ... An unknown server-side error occurred while processing the command.
Read more >
Appium Issue while launching App on IOS 14 mobile
An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: ...
Read more >
Safari error: com.apple.mobilesafari does not exist in the list of ...
“An unknown server-side error occurred while processing the command. Original error: Mobile Safari cannot open ...
Read more >
Appium inspector fails with following error - Stack Overflow
Appium inspector fails with following error: Failed to create session. An unknown server-side error occurred while processing the command.
Read more >
appium/CHANGELOG.md - UNPKG
43, * Fix handling of install/upgrade of Appium helper apps (for settings manipulation ... 48, * Fix error in stopping coverage when session...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found