WebDriverAgentRunner crash (Appium 1.6.0 - Xcode 8 - iOS 10.0.2 Real Device)

Hi…

Below is my environment:
Mac Mini with OSX 10.11.6
Xcode 8.0
Appium 1.6.0
npm v3.10.8
node v6.8.0
iOS 10.0.2 (iPad Mini Real Device)

I’ve installed the latest appium using: npm install -g appium
Started the server using: appium --address “127.0.0.1”

Test code using TestNG and Maven is below:

    DesiredCapabilities capabilities = new DesiredCapabilities();
    
    capabilities.setCapability("app", "/Users/myUser/Dev/MyApp.app");
    capabilities.setCapability("device", "iPad");
    capabilities.setCapability("udid", "<my device udid>");
    capabilities.setCapability("deviceName", "iPad Air 2");
    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("platformVersion", "10.0.2");
    capabilities.setCapability("automationName", "XCUITest");

    driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

===============

When I run the test code, it installs my MyApp.app
and installs WebDriverAgent app
and then, WebDriverAgent app flashes for a second and disappears (crash on launch).
MyApp does not launch.

On server logs, I see the below lines (full logs attached) server_logs.txt (66.6 KB)
:

[Xcode] Test target WebDriverAgentRunner encountered an error (Early unexpected exit

The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.

KissXML: required code signature missing for WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML’

I opened the WebDriverAgent.xcodeproj in Xcode, signed with the same Team/Profile as of my MyApp.app and built for Generic iOS (tried for the specific iPad as well).
Yet no luck so far.

Please let me know how to solve the WebDriverAgentRunner error.

Thanks in advance.
maesiva

Exactly same issue here, would appreciate any help :frowning:

It is trying to search for WebDriverAgent.bundle … have tried giving this command at WebDriver Agent folder
mkdir -p Resources/WebDriverAgent.bundle

Got rid of the error by following steps at:


and
re-logging to the apple dev id on device and re-installing the certificates on the device.
Good luck Valentin_Stefanescu.

If Application is already installed on the iPhone: it wont work

I am facing the same problem like you. Any solution so far?

Even I had face same issue for IOS 10 + … Was able to solve with below command brew unstall libimobiledevice and brew install --HEAD libimobiledevice.

I tried but it still throws the same error.

You are getting this issue either of 2 reasons :

  1. Either you have not added to development team configuration to WDA xcode project
  2. U have not downloaded the dependencies

I would insist to follow these
A. Uninstall the appium and get appium again
B.In terminal$ cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent(location where the appium would be saved)
C. $ ./Scripts/bootstrap.sh -d ; this wil download all the dependencies
D. Create xconfig file and give it as capability , this will resolve all the issues

Hi Guys,

I have tried all of the above steps to the last dot multiple times now, still getting the same error, can someone please help me out.

Issue: Appium is installing the app along with WebDriverAgent icon, then the webdriveragent flashes and app never launches and nothing else happens.

My desired caps are as follows:

WebDriver driver;

    DesiredCapabilities caps = new DesiredCapabilities();

    caps.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");

    caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
    caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.2");

    caps.setCapability(MobileCapabilityType.DEVICE_NAME, "iPad Air");
    caps.setCapability("udid", "d69cfcd0ea7e167b9a0b58b2daba958030443ac9");

    caps.setCapability("app", "/Path/To/My/app.ipa");
    caps.setCapability(MobileCapabilityType.LAUNCH_TIMEOUT, "20000");
    caps.setCapability("fullReset", true);
    caps.setCapability("noReset", true);
    
    caps.setCapability("xcodeConfigFile", "/Path/To/myConfig.xcconfigfile");
    caps.setCapability("realDeviceLogger", "/usr/local/lib/node_modules/deviceconsole/deviceconsole");


    driver = new RemoteWebDriver(new URL("http://localhost:4723/wd/hub"),caps);

    driver.quit();

Appium Server log is as follows:

Last login: Mon Dec 19 12:03:57 on ttys000
Harshendus-MacBook-Pro:~ Harshendu$ appium
[Appium] Welcome to Appium v1.6.3
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“app”:"/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa",“realDeviceLogger”:"/usr/local/lib/node_modules/deviceconsole/deviceconsole",“platformVersion”:“10.0.2”,“bundleId”:“com.egate-solutions.EGPacPlus”,“automationName”:“XCUITest”,“xcodeConfigFile”:"/Users/Harshendu/Desktop/myConfig.xcconfigfile",“udid”:“d69cfcd0ea7e167b9a0b58b2daba958030443ac9”,“platformName”:“iOS”,“device”:“iPad”,“deviceName”:“iPad Air”},“requiredCapabilities”:{}},“desiredCapabilities”:{“app”:"/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa",“realDeviceLogger”:"/usr/local/lib/node_modules/deviceconsole/deviceconsole",“platformVersion”:“10.0.2”,“bundleId”:“com.egate-solutions.EGPacPlus”,“automationName”:“XCUITest”,“xcodeConfigFile”:"/Users/Harshendu/Desktop/myConfig.xcconfigfile",“udid”:“d69cfcd0ea7e167b9a0b58b2daba958030443ac9”,“platformName”:“iOS”,“device”:“iPad”,“deviceName”:“iPad Air”},“requiredCapabilities”:{}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa",“realDeviceLogger”:"/usr/local/lib/node_modules/deviceconsole/deviceconsole",“platformVersion”:“10.0.2”,“bundleId”:“com.egate-solutions.EGPacPlus”,“automationName”:“XCUITest”,“xcodeConfigFile”:"/Users/Harshendu/Desktop/myConfig.xcconfigfile",“udid”:“d69cfcd0ea7e167b9a0b58b2daba958030443ac9”,“platformName”:“iOS”,“device”:“iPad”,“deviceName”:“iPad Air”},{},{“desiredCapabilities”:{“app”:"/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa",“realDeviceLogger”:"/usr/local/lib/node_modules/deviceconsole/deviceconsole",“platformVersion”:“10.0.2”,“bundleId”:“com.egate-solutions.EGPacPlus”,“automationName”:“XCUITest”,“xcodeConfigFile”:"/Users/Harshendu/Desktop/myConfig.xcconfigfile",“udid”:“d69cfcd0ea7e167b9a0b58b2daba958030443ac9”,“platformName”:“iOS”,“device”:“iPad”,“deviceName”:“iPad Air”},“requiredCapabilities”:{}},null,null]
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: ‘/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa’
[Appium] realDeviceLogger: ‘/usr/local/lib/node_modules/deviceconsole/deviceconsole’
[Appium] platformVersion: ‘10.0.2’
[Appium] bundleId: ‘com.egate-solutions.EGPacPlus’
[Appium] automationName: ‘XCUITest’
[Appium] xcodeConfigFile: ‘/Users/Harshendu/Desktop/myConfig.xcconfigfile’
[Appium] udid: ‘d69cfcd0ea7e167b9a0b58b2daba958030443ac9’
[Appium] platformName: ‘iOS’
[Appium] device: ‘iPad’
[Appium] deviceName: ‘iPad Air’
[debug] [XCUITest] XCUITestDriver version: 2.4.2
[BaseDriver] The following capabilities were provided, but are not recognized by appium: device.
[BaseDriver] Session created with session id: a70abc49-6f28-4709-84ef-6824162874f5
[debug] [XCUITest] Xcode version set to ‘8.2’
[debug] [XCUITest] iOS SDK Version set to ‘10.2’
[debug] [XCUITest] Available devices: d69cfcd0ea7e167b9a0b58b2daba958030443ac9
[debug] [XCUITest] Creating iDevice object with udid d69cfcd0ea7e167b9a0b58b2daba958030443ac9
[XCUITest] Determining device to run tests on: udid: ‘d69cfcd0ea7e167b9a0b58b2daba958030443ac9’, real device: true
[BaseDriver] Using local app ‘/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa’
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-1lp6l50.qxj6skyb9/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-1lp6l50.qxj6skyb9/appium-app.zip
[BaseDriver] Unzipped local app to ‘/var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-1lp6l50.qxj6skyb9/Payload/EGPacPlus.app’
[debug] [XCUITest] Checking whether app ‘/var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-1lp6l50.qxj6skyb9/Payload/EGPacPlus.app’ is actually present
[debug] [XCUITest] App is present
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: ‘/usr/local/bin/idevicesyslog’
[XCUITest] Setting up real device
[debug] [XCUITest] Error checking install status: Command ‘ios-deploy --exists --id d69cfcd0ea7e167b9a0b58b2daba958030443ac9 --bundle_id com.egate-solutions.EGPacPlus’ exited with code 255
[debug] [XCUITest] App is not installed. Will try to install.
[debug] [XCUITest] App installed successfully.
[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 ‘/usr/local/lib/node_modules/deviceconsole/deviceconsole’
[debug] [XCUITest] Using Xcode configuration file: ‘/Users/Harshendu/Desktop/myConfig.xcconfigfile’
[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=d69cfcd0ea7e167b9a0b58b2daba958030443ac9 -configuration Debug -xcconfig /Users/Harshendu/Desktop/myConfig.xcconfigfile’ 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/Harshendu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/A55DCC79-FAA1-4EDD-B300-52E4BD1C147D/Session-WebDriverAgentRunner-2016-12-19_120522-aiRV5j.log
[debug] [WebDriverAgent] Device: Dec 19 12:05:27 HARSHENDU-BHARDWAJs-iPad XCTRunner[310] : Running tests…
[debug] [WebDriverAgent] Device: Dec 19 12:05:28 HARSHENDU-BHARDWAJs-iPad XCTRunner[310] : Continuing to run tests in the background with task ID 1
[XCUITest] Detected that WebDriverAgent is running at url ‘http://10.25.38.159:8100
[XCUITest] WebDriverAgent started at url ‘http://10.25.38.159:8100
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[XCUITest] Error starting iproxy: ‘spawn iproxy ENOENT’
[XCUITest] Unable to start iproxy. Is it installed?
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 2602)
[XCUITest] xcodebuild exited with code ‘null’ and signal ‘SIGTERM’
[XCUITest] Shutting down Logger process (pid 2603)
[XCUITest] System log exited with code ‘null’
[XCUITest] Shutting down iproxy process (pid undefined)
[debug] [XCUITest] iproxy process did not end in a timely fashion: ‘Process didn’t end after 10000ms’. Sending ‘SIGKILL’…
[MJSONWP] Encountered internal error running command: Error: Process didn’t end after 10000ms
at Timeout._onTimeout (…/…/lib/teen_process.js:240:16)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
[HTTP] <-- POST /wd/hub/session 500 31357 ms - 169
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa",“realDeviceLogger”:"/usr/local/lib/node_modules/deviceconsole/deviceconsole",“platformVersion”:“10.0.2”,“bundleId”:“com.egate-solutions.EGPacPlus”,“automationName”:“XCUITest”,“xcodeConfigFile”:"/Users/Harshendu/Desktop/myConfig.xcconfigfile",“udid”:“d69cfcd0ea7e167b9a0b58b2daba958030443ac9”,“platformName”:“iOS”,“device”:“iPad”,“deviceName”:“iPad Air”},“requiredCapabilities”:{}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa",“realDeviceLogger”:"/usr/local/lib/node_modules/deviceconsole/deviceconsole",“platformVersion”:“10.0.2”,“bundleId”:“com.egate-solutions.EGPacPlus”,“automationName”:“XCUITest”,“xcodeConfigFile”:"/Users/Harshendu/Desktop/myConfig.xcconfigfile",“udid”:“d69cfcd0ea7e167b9a0b58b2daba958030443ac9”,“platformName”:“iOS”,“device”:“iPad”,“deviceName”:“iPad Air”},{},null,null,null,null,null]
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: ‘/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa’
[Appium] realDeviceLogger: ‘/usr/local/lib/node_modules/deviceconsole/deviceconsole’
[Appium] platformVersion: ‘10.0.2’
[Appium] bundleId: ‘com.egate-solutions.EGPacPlus’
[Appium] automationName: ‘XCUITest’
[Appium] xcodeConfigFile: ‘/Users/Harshendu/Desktop/myConfig.xcconfigfile’
[Appium] udid: ‘d69cfcd0ea7e167b9a0b58b2daba958030443ac9’
[Appium] platformName: ‘iOS’
[Appium] device: ‘iPad’
[Appium] deviceName: ‘iPad Air’
[debug] [XCUITest] XCUITestDriver version: 2.4.2
[BaseDriver] The following capabilities were provided, but are not recognized by appium: device.
[BaseDriver] Session created with session id: b38e006d-9312-4cf8-87fe-0edcc3aad5e7
[debug] [XCUITest] Xcode version set to ‘8.2’
[debug] [XCUITest] iOS SDK Version set to ‘10.2’
[debug] [XCUITest] Available devices: d69cfcd0ea7e167b9a0b58b2daba958030443ac9
[debug] [XCUITest] Creating iDevice object with udid d69cfcd0ea7e167b9a0b58b2daba958030443ac9
[XCUITest] Determining device to run tests on: udid: ‘d69cfcd0ea7e167b9a0b58b2daba958030443ac9’, real device: true
[BaseDriver] Using local app ‘/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa’
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-jh8pd6.6shu6p3nmi/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-jh8pd6.6shu6p3nmi/appium-app.zip
[BaseDriver] Unzipped local app to ‘/var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-jh8pd6.6shu6p3nmi/Payload/EGPacPlus.app’
[debug] [XCUITest] Checking whether app ‘/var/folders/lb/v8wy_7_519g99zqg57krkcy40000gn/T/20161119-2564-jh8pd6.6shu6p3nmi/Payload/EGPacPlus.app’ is actually present
[debug] [XCUITest] App is present
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: ‘/usr/local/bin/idevicesyslog’
[XCUITest] Setting up real device
[debug] [XCUITest] App is already installed.
[debug] [XCUITest] Full reset not requested. No need to install.
[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 ‘/usr/local/lib/node_modules/deviceconsole/deviceconsole’
[debug] [XCUITest] Using Xcode configuration file: ‘/Users/Harshendu/Desktop/myConfig.xcconfigfile’
[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=d69cfcd0ea7e167b9a0b58b2daba958030443ac9 -configuration Debug -xcconfig /Users/Harshendu/Desktop/myConfig.xcconfigfile’ 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/Harshendu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/8CC1E296-B709-4DF4-AD69-2BFEDD4F5FCA/Session-WebDriverAgentRunner-2016-12-19_120551-uQBux2.log
[debug] [WebDriverAgent] Device: Dec 19 12:05:56 HARSHENDU-BHARDWAJs-iPad XCTRunner[316] : Running tests…
[debug] [WebDriverAgent] Device: Dec 19 12:05:57 HARSHENDU-BHARDWAJs-iPad XCTRunner[316] : Continuing to run tests in the background with task ID 1
[XCUITest] Detected that WebDriverAgent is running at url ‘http://10.25.38.159:8100
[XCUITest] WebDriverAgent started at url ‘http://10.25.38.159:8100
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[XCUITest] Error starting iproxy: ‘spawn iproxy ENOENT’
[XCUITest] Unable to start iproxy. Is it installed?
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down xcodebuild process (pid 2655)
[XCUITest] xcodebuild exited with code ‘null’ and signal ‘SIGTERM’
[XCUITest] Shutting down Logger process (pid 2656)
[XCUITest] System log exited with code ‘null’
[XCUITest] Shutting down iproxy process (pid undefined)
[debug] [XCUITest] iproxy process did not end in a timely fashion: ‘Process didn’t end after 10000ms’. Sending ‘SIGKILL’…
[MJSONWP] Encountered internal error running command: Error: Process didn’t end after 10000ms
at Timeout._onTimeout (…/…/lib/teen_process.js:240:16)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)
[HTTP] <-- POST /wd/hub/session 500 28725 ms - 169
[HTTP] --> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“app”:"/Users/Harshendu/Downloads/EGPacPlus0.1.72-dev.ipa",“realDeviceLogger”:"/usr/local/lib/node_modules/deviceconsole/deviceconsole",“platformVersion”:“10.0.2”,“bundleId”:“com.egate-solutions.EGPacPlus”,“automationName”:“XCUITest”,“xcodeConfigFile”:"/Users/Harshendu/Desktop/myConfig.xcconfigfile",“udid”:“d69cfcd0ea7e167b9a0b58b2daba958030443ac9”,“platformName”:“iOS”,“device”:“iPad”,“deviceName”:“iPad Air”},“requiredCapabilities”:{}}}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“capabilities”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”]} and you sent [“capabilities”]
[HTTP] <-- POST /wd/hub/session 400 3 ms - 205
^C[Appium] Received SIGINT - shutting down
Harshendus-MacBook-Pro:~ Harshendu$

Please Help!!!

Do you have proxy details in your bash_profile ?

Hi,
Thanks for your reply. This is what’s in the bash profile

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin

I do not know what my proxy details are hence I am unable to add them in the bash_profile.

I would appreciate if you can help me with this issue.

Thank you.

3 Differences I observed against my working code:

  1. Start appium on 127.0.0.1 IP using below command
    appium --address 127.0.0.1

  2. Declare the driver as IOSDriver.

  3. Instantiate driver as:
    driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”), caps);

Hi,

Corrected the driver to IOSDriver…
still the exact same issue. Thank you for your help.

If you don’t mind may I have a copy of your caps to try out with?

Appreciatie it.

Hello I am getting same error, are u able to resolve it and how? Your response would be great help