Appium-xcuitest-driver: App does not open on real iOS device

I just tried to get the appium-xcuitest-driver up and running on OS X El Capitan. I built the appium-xcuitest-driver from source and patched the appium.js file to use this driver instead of the default iOS driver.

When running a test the WebDriverAgentRunner app gets built & deployed automatically on the iOS device, also the WebDriverAgentRunner app gets started but then nothing happens.

Console output

[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium]   udid: '0ce688bd7ca1fb9bb433a04f7e1ca0271e9edf82'
[Appium]   deviceName: 'iPhone6Plus_CDDP_Dev'
[Appium]   bundleId: 'foo.bar.app'
[Appium]   platformName: 'iOS'
[Appium]   platformVersion: '9.3'
[BaseDriver] Session created with session id: 8ff13d57-e229-48b3-86dd-883ddf86b503
[debug] [XCUITest] Available devices: 0ce688bd7ca1fb9bb433a04f7e1ca0271e9edf82
[XCUITest] Determining device to run tests on: udid: '0ce688bd7ca1fb9bb433a04f7e1ca0271e9edf82', real device: true
[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 default agent: /Users/cdds/node-v5.10.1-darwin-x64/lib/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /Users/cdds/node-v5.10.1-darwin-x64/lib/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/cdds/Library/Developer/Xcode/DerivedData/WebDriverAgent-cnmoxswiyjaufabpkeblsetxrysp/Logs/Test/74A3931D-0EEB-455C-80B7-BC5177F94B5A/Session-2016-08-05_16:01:36-VnXtn0.log
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...
[debug] [WebDriverAgent] Device: Aug  5 16:08:26 iPhone6Plus-CDDP-Dev XCTRunner[958] <Warning>: Running tests...
[debug] [WebDriverAgent] Device: Aug  5 16:08:27 iPhone6Plus-CDDP-Dev XCTRunner[958] <Warning>: Continuing to run tests in the background with task ID 1
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...
[debug] [WebDriverAgent] Device: Aug  5 16:08:28 iPhone6Plus-CDDP-Dev XCTRunner[958] <Warning>: Built at Aug  5 2016 16:08:35
[debug] [WebDriverAgent] Device: Aug  5 16:08:28 iPhone6Plus-CDDP-Dev XCTRunner[958] <Warning>: ServerURLHere->http://192.168.188.44:8100<-ServerURLHere
[debug] [WebDriverAgent] Device: Aug  5 16:08:28 iPhone6Plus-CDDP-Dev XCTRunner[958] <Warning>: Listening on USB

and that’s all… the target app (“foo.bar.app”) is not launched and the test script never finishes.

What am I missing here?

Any hints? The iOS device is connected via USB and installation and start of the WebDriverAgentRunner on the device works. Now I would expect that the App under test is started - but it’s not.

I am also having same problem while execution as below-

When I run script on iOS 10 device, getting message in console as -

[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading…
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading…
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading…
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading…
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading…
[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading…
.
.
.
.
It is not proceeding further, showing above message repeatedly.
So not even launching app under test on device.

Can anyone suggest exact process of running scripts on iOS 10.

i’ve similar issues, started posting in this thread

I’m stuck on the ‘Waiting for WebDriverAgent to start on device’ message

Was anyone able to resolve this issue?

@dr12782 Can you share the capabilities and gist of your logs

I was able to launch the app successfully using Appium 1.6.0 without changing any line in the code. It is weird that the same code gives me problem in 1.6.2.

Can you share capabilities or the log files …

I’ll upgrade to 1.6.3 and get back to you.

App launches fine on real device (iOS 10.1) using Appium 1.6.3, Xcode 8.1.

App does not launch on on v1.6.3, Xcode 8.2, iOS 10.1 and 10.2.

Capabilities:
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “iOS”);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, “10.2”);
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, “Anand’s iPad”);
capabilities.setCapability(MobileCapabilityType.UDID,
“5a4de0857c9c5d66d71c7b2ad88aeb09102b63e9”);
capabilities.setCapability(MobileCapabilityType.APP, Constants.IPA_PATH);
capabilities.setCapability(IOSMobileCapabilityType.BUNDLE_ID, Constants.BUNDLE_ID);
// capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
capabilities.setCapability(IOSMobileCapabilityType.AUTO_ACCEPT_ALERTS, true);

capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“xcodeConfigFile”, “/usr/local/lib/node_modules/appium/”
+ “node_modules/appium-xcuitest-driver/WebDriverAgent/Config.xcconfig”);
capabilities.setCapability(“realDeviceLogger”, “/usr/local/lib/node_modules/deviceconsole”
+ “/deviceconsole”);

Appium Logs:AppiumLog.log (7.2 KB)

WebDriverAgent logs: Session-WebDriverAgentRunner-2016-12-20_131010-5F4NxK.log (22.8 KB)

Have tried pushing the ipa using the ideviceinstaller (get the latest version : brew install ideviceinstaller --HEAD)

I got the same problem…

Yes, I can help you out of it. I was also facing same issue, but after re-installing appium 1.6.3, it got resolved.
If still facing issues, tell me your installation steps on mac machine from Installing Xcode to Appium Configuration.

Hi @Swapan_Chhabra

I’m also in trouble with executing appium in real device.
I could execute the script on simulator.
When I come up with real device it works nicely if I install it manually.
Unless real device does not work with app install with test script.

I have posted it here…

Cannot install app to test on real device - XCUITest

Can you please have a look… :disappointed_relieved:
Thanks