Instrument crashes when trying to install .ipa on iPhone device


Im facing this problem when i try to run my automated test and the app is not yet installed on the iPhone device.


info: [debug] Attempting to run app on iPhone de Mobile IOS (9.0.2)
info: [debug] Spawning instruments with command: /Applications/ -t /Applications/ -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone de Mobile IOS (9.0.2)" /var/folders/zp/ktqx7d6960d1t5s5bb0wlmrdytb_zm/T/1151011-64375-1hrk8c3/Payload/ -e UIASCRIPT "/Users/user/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":90000}

info: [debug] [INST STDERR] 2015-11-11 17:35:35.280 instruments[64493:321783] WebKit Threading Violation - initial use of WebKit from a secondary thread.

info: [debug] [INST STDERR] 2015-11-11 17:35:39.744 instruments[64493:321783] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 4.) : Failed to launch process with bundle identifier 'com.myApp.myApp'
info: [debug] [INST STDERR] 2015-11-11 17:35:39.745 instruments[64493:321730] Attempting to change event horizon while disengage

My dependencies:

 capabilities.setCapability("deviceName","iPhone de Mobile IOS");   
        capabilities.setCapability("platformVersion", "9.0.2");
        capabilities.setCapability("platformName", "iOS");
        capabilities.setCapability("bundleId", "com.MyApp.MyApp");
        capabilities.setCapability("app","/Users/user/Desktop/MyApp 2015-11-11 17-27-58/MyApp.ipa");

The thing is that, if I compile the app directly to my device using Xcode, and then run the automated test, the app opens correctly.

Someone could help me with this please?

2 things:

  1. Your deviceName needs to = your device udid (try instruments -s devices). Here’s my capabilities for a reference:

platformName = “ios”
platformVersion = “8.4.1”
bundleId = “com.x.y”
deviceName = “97a4dc9fd1b1d8aa125978bb3a5635268ad65bb0”
app = “NotBeingUsed.ipa”
sendKeyStrategy = “setValue”

Note: I use use ideviceinstaller in a preprocessing script to uninstall and reinstall my iPa. It just worked better for me.

  1. I also start the appium server with said udid starting like this( node -U $udid …)

I’m doing most of this from memory. I can fill in some gaps later. Hope it’s enough to get you started


You could remove the bundleid.
Could you set just the ff:
platformName >>> ‘iOS’
deviceName >>> your device name (on your mac, you could try ideviceinfo -u udid -k ‘DeviceName’)

Try that and see what the next error be.

I could solve this problem by running the script with the uuid parameter, and previously, installing ideviceinstaller.
When i did this, appium automatically called ideviceinstaller and managed the installation.