[iOS]Instruments crashed on startup

We had a work around which seem to work .

Start Driver , Crashes with Appium server log, instruments crashed.
In the exception block we read the server logs and if we notice this issue , we would start Xcode through , apple script , which will enforce the Xcode/Instruments and wait for 15 seconds and quit it.
Then retry starting the driver, it should be good.

Sorry the above comments would fix if you are getting instruments never checked in errors.

I face the same problem.

the error code seems to be 255

Iā€™m facing the same issue interments crashes on startup. But Iā€™m able to launch other application in simulator only one of my test applications is not opening on simulator.

@Shreyas, can you please let me know how it got resolved for you?

Thanks in Advance,
Pavithra

I had the issue with real iOS iPhone6 device and instrument like this:
INSTSERVER] Instruments exited with code 253

Till the moment I had already installed ideviceinstaller via brew

  1. brew install -v --fresh automake autoconf libtool wget libimobiledevice
  2. brew install --HEAD ideviceinstaller

Check that ideviceinstaller works correct with command like this:
For example I run the command line success:
3. ideviceinstaller -u 2a6ec95b5891582549f379e72c08c857ebeb5169 -i /Users/admin/Projects/Ivan/slotomania.ng/Bin/IOS/SMIOS.app

My app was installed on the iPhone6 device.

Check that you device attached and detected by XCode instruments

  1. instruments -s devices

Note: You have to use the device name form this list, it is pointed in appium documentation:
In Appium GUI app this is Device setting -> Force Device text edit box. In command line:
ā€“device-name "IvanPhone6 (8.1.1) [6c6365447d1dfb636be7de6921f631b8a62a08ae]

As you can see the phone name are not the same as in iTunes for example (IvanPhone6). This was my issue when I tried to use short name with appium I had the instruments 253 crash.

The full command was like this:
Launching Appium with command: ā€˜/usr/local/bin/nodeā€™ lib/server/main.js --command-timeout ā€œ7200ā€ --debug-log-spacing --platform-version ā€œ8.1.1ā€ --platform-name ā€œiOSā€ --app ā€œ/Users/admin/Projects/Ivan/slotomania.ng/Bin/IOS/Slotomania.ipaā€ --udid ā€œ6c6365447d1dfb636be7de6921f631b8a62a08aeā€ --show-ios-log --device-name ā€œIvanPhone6 (8.1.1) [6c6365447d1dfb636be7de6921f631b8a62a08ae]ā€

according to my experience, itā€™s better to check again following stuffs: 1. in appium iOS Settings, your BundleID, ForceDevice, PlatformVersion & UDID are checked and correct 2. switching on UI Automation from Developer on iOS device. Hope it helps.

I faced the same issue, instruments crash with code 253, i ran on simulator not on real device, my application was built on xcode 6.1 from a different machine, Since I set appium environment I ran only sample UIcatalog provided in tutorials, none of my applications opened in simulator, I use Appium 1.4, platform version 7.1 and 8.1

Any updates on this ? Did anyone of you find the solution for this ?

Hi all,

I am also facing same problem, please let me any solution on this.

Error : "Failed to start Appium session, err was: Error: Instruments crashed on start up "

Appium Version: 1.3.7
Mac OS X: 10.10.3
Device: iPhone 5/iOS8.3
Xcode Version: 6.3.1

Thanks in advanceā€¦

Regards,
Darshan
Mob: 918087122927

Hello,

Install your app from xcode directly by dev sign then run your appium script . its working for me by simple trickā€¦

In my case, just start XCode first, check your iPhone Setting if they has Developer option or not. If the answer is yes, your appium is ready!

Hi everybody.
I have same issue.
When appium tries to run application, the screen flashes with app splash screen, as if appium tries to launch app multiple times. This behaviour happens both on simulator and real device.

I set enable on my iOS devices UI Autimation, but when i try start inspector i have this problem:

info: [debug] [INST STDERR] 2015-11-05 15:11:05.082 instruments[1495:39489] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-11-05 15:11:06.049 instruments[1495:39460] Attempting to change event horizon while disengage

error: Failed to start an Appium session, err was: Error: Instruments crashed on startup

info: [debug] [INST STDERR] 2015-11-05 15:11:06.049 instruments[1495:39462] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Permission to debug com.myapp.iphone was denied. The app must be signed with a development identity (e.g. iOS Developer).
info: [IOS_SYSLOG_ROW ] Nov  5 15:11:04 tests-iPod com.apple.xpc.launchd[1] (UIKitApplication:com.myapp.iphone[0xe163][607]) <Notice>: Service exited due to signal: Killed: 9
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] We exceeded the number of retries allowed for instruments to successfully start; failing launch
info: [debug] Stopping iOS log capture
info: [debug] Reset not set, not ending sim or cleaning up app state
info: [debug] Cleaning up appium session
info: [debug] Error: Instruments crashed on startup
    at [object Object].Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:440:31)
    at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:353:12)
    at ChildProcess.emit (events.js:110:17)
    at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null
info: <-- POST /wd/hub/session 500 33841.937 ms - 182}

Application is in form of .ipa

Thanks,
Best regards.

Can you give us your SetCapabilities ? Sometimes it comes from here.

In your case the problem is diagnosed correctly by the error log. You need to get this App signed with a Development Certificate.

1 Like

+1 on your suggestion @wreed
Most of the time, our smoke test failed (with Instruments crash messages) due to incorrect profile used to sign the app.
Now we incorporate ā€œ[ ]Correctly signed by dev certificateā€ as part of our QA-In checklist.

I have the same problem when I use an already developed application and the build is coming from a developer profile : I canā€™t open the inspector and i got this error in appium :ā€œinstruments crash on startup.ā€

But, when I create an new project with XCode then generate the app file, it is working fine I can open both inspector and recorder.

So any idea why this happens? Why building on X code works but .ipa file ot .app file will not work?

And when we install app directly to device from xcode, how should we sign the app?
debug?archive?release?

@ emna_ayadi, can you please help?
What extension did already developed version have?

and how did you install directly to device?

@uzmasyed00, can u one thingā€¦ Generate *.ipa file using xcode and try to install it using ideviceistaller.

Ideviceistaller -I <path/to/ipa>