appium: Fail to launch test on real iOS device

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 ?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 36 (5 by maintainers)

Most upvoted comments

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

brew install libimobiledevice --HEAD.

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