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.

Fail to launch test on real iOS device

See original GitHub issue

The problem

Since 3 days I’m struggling to launch a test on real device. I’m trying to use the XCUITest framework. I’ve been setting the team on all the targets from the WDA Xcode project. When I launch my test, I’ve got this error from appium server:

[XCUITest] Unable to start WebDriverAgent: Error: Command ‘idevicedate -u e75c0085c74a872846772a6b2ee56a86849a4d92’ exited with code 255

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.3
  • Desktop OS/version used to run Appium: 10.11.6
  • Node.js version (unless using Appium.app|exe): v6.9.1
  • Mobile platform/version under test: iOS 9.3.5
  • Real device or emulator/simulator: real (iPhone 6 plus)
  • Appium CLI or Appium.app|exe: appium CLI
  • Xcode : 8.1

Details

Here’s my setup to launch the appium driver:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"[MY_DEVICE_NAME]");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"iOS");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.3.5");
capabilities.setCapability(MobileCapabilityType.UDID, "[MY_UDID]");
capabilities.setCapability("bundleId", "im.vector.app");//app
		
//TODO: XCUITest is used because Appium Ios driver doesn't support xcode version 8.0
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,"XCUITest");
capabilities.setCapability("realDeviceLogger", "/usr/local/lib/node_modules/deviceconsole/deviceconsole");
capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
capabilities.setCapability("xcodeConfigfile", "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettings.xcconfig");
capabilities.setCapability("autoDismissAlerts", false);
AppiumFactory appiumFactory=new AppiumFactory();
appiumFactory.setiOSDriver1(new URL(Constant.SERVER1_ADRESS), capabilities);

Here’s the full logs of appium server: https://gist.github.com/jeangb/904a7fcd0077f8e342fef7baf3811280 I saw Appium Server is trying to build the WDA agent with the command

xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=e75c0085c74a872846772a6b2ee56a86849a4d92 -configuration Debug

so I’ve been executed this command and here’s the log it give me: https://gist.github.com/jeangb/c6c9b2b28e4620f426137f4da60091fe.

And when I launch the “build an then test the current scheme” of the runner target of the Xcode project (WDA), I’ve got this:

dyld: Library not loaded: @rpath/XCTest.framework/XCTest
  Referenced from: /var/containers/Bundle/Application/BBFB42C4-6E64-494A-AE2B-0E45C4FF2E8F/WebDriverAgentRunner-Runner.app/XCTRunner
  Reason: no suitable image found.  Did find:
	/private/var/containers/Bundle/Application/BBFB42C4-6E64-494A-AE2B-0E45C4FF2E8F/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/BBFB42C4-6E64-494A-AE2B-0E45C4FF2E8F/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest'
	/private/var/containers/Bundle/Application/BBFB42C4-6E64-494A-AE2B-0E45C4FF2E8F/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/BBFB42C4-6E64-494A-AE2B-0E45C4FF2E8F/WebDriverAgentRunner-Runner.app/Frameworks/XCTest.framework/XCTest'
(lldb) 

It manages to launch WebDriverAgent on the phone but screen is black.

Can you help me ?

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
jeangbcommented, Dec 14, 2016

I give up. I’m starting to loose my mind on this.

1reaction
imurchiecommented, Dec 14, 2016

brew install libimobiledevice --HEAD.

You can also get around it by running sudo chmod 777 /var/db/lockdown.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UI Tests on real device broken on iOS 15.4 - Apple Developer
Run the UI test testExample which only starts the app, nothing more. Restart the attached phone; Try to run testExample again. Expectation: Test...
Read more >
Unable to launch ios app on a real device with appium
I am having issue while configuring appium ios with real device. I have done the full manual configuration mentioned on the appium site....
Read more >
Unable to launch application successfully on real iOS device
When I am executing tests on simulator its working fine but when I am trying to launch app on a real device it...
Read more >
Test on real device issue - Forums - Hacking with Swift
When I launch the app on the iPhone I get error dialogs on the iPhone and in Xcode : The iPhone displays: Untrusted...
Read more >
Chapter 4.8 - Run First Test on iOS Real Device
Whenever we are running on a physical device, if we don't have a WebDriverAgent set up successfully, we will find all of these...
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