[iOS]Instruments crashed on startup

Hi priyank,
thanks for replying
This is what I get

192-168-1-238:bin uzmasyed$ ideviceinstaller
ERROR: No mode/command was supplied.
Usage: ideviceinstaller OPTIONS
Manage apps on iOS devices.

-u, --udid UDID Target specific device by its 40-digit device UDID.
-l, --list-apps List apps, possible options:
-o list_user - list user apps only (this is the default)
-o list_system - list system apps only
-o list_all - list all types of apps
-o xml - print full output as xml plist
-i, --install ARCHIVE Install app from package file specified by ARCHIVE.
ARCHIVE can also be a .ipcc file for carrier bundles.
-U, --uninstall APPID Uninstall app specified by APPID.
-g, --upgrade ARCHIVE Upgrade app from package file specified by ARCHIVE.
-L, --list-archives List archived applications, possible options:
-o xml - print full output as xml plist
-a, --archive APPID Archive app specified by APPID, possible options:
-o uninstall - uninstall the package after making an archive
-o app_only - archive application data only
-o docs_only - archive documents (user data) only
-o copy=PATH - copy the app archive to directory PATH when done
-o remove - only valid when copy=PATH is used: remove after copy
-r, --restore APPID Restore archived app specified by APPID
-R, --remove-archive APPID Remove app archive specified by APPID
-o, --options Pass additional options to the specified command.
-h, --help prints usage information
-d, --debug enable communication debugging

Homepage: http://libimobiledevice.org
192-168-1-238:bin uzmasyed$ ideviceinstaller -l
CFBundleIdentifier, CFBundleVersion, CFBundleDisplayName
192-168-1-238:bin uzmasyed$

Hi Priyank,

Dont think that looked right. here is some thing i did
Homepage: http://libimobiledevice.org
192-168-1-238:bin uzmasyed$ ideviceinstaller -U 1cbbf550963ec20aec09b0bc2fec35796df68896 -i /Users/uzmasyed/Desktop/iAuditor_Beta.ipa
WARNING: Using “-U” for “–udid” is deprecated. Please use “-u” instead.
WARNING: could not locate iTunesMetadata.plist in archive!
WARNING: could not locate Payload/iAuditor.app/SC_Info/iAuditor.sinf in archive!
Copying ‘/Users/uzmasyed/Desktop/iAuditor_Beta.ipa’ to device… DONE.
Installing ‘com.safetyculture.iAuditor’
Install: CreatingStagingDirectory (5%)
Install: ExtractingPackage (15%)
Install: InspectingPackage (20%)
Install: TakingInstallLock (20%)
Install: PreflightingApplication (30%)
Install: InstallingEmbeddedProfile (30%)
Install: VerifyingApplication (40%)
Install: CreatingContainer (50%)
Install: InstallingApplication (60%)
Install: PostflightingApplication (70%)
Install: SandboxingApplication (80%)
Install: GeneratingApplicationMap (90%)
Install: Complete
192-168-1-238:bin uzmasyed$


and it installed it just fine. this ipa file was given to me by developer and it was signed in adhoc mode.

Okie, can u check with developer that ur ipa is debug app, this is because with ad-hoc sign identity they might have given u ipa in release mode. Which can’t work with appium. Now if you try with existing app, it will crash even though you have enabled developer options.

@Priyank_shah, do you have this working for yourself?
Can you please send me a screen shot for your setting in the UI inspector?

I got a debug build from the developer and still same problem. The error message is posted below


info: [debug] [INST STDERR] 2016-04-14 15:07:53.851 instruments[13423:220462] Attempting to change event horizon while disengage

info: [debug] [INST STDERR] 2016-04-14 15:07:53.851 instruments[13423:220409] 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 1.) : Failed to launch process with bundle identifier ‘com.safetyculture.iAuditor’

Hi I encounter the same problem.
error: Failed to start an Appium session, err was: Error: Instruments crashed on startup

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]. (/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 33363.010 ms - 182

I tried restart my appium app and xcode, but still encountered the same problem.
Could you please share with me how you did to resolve this issue?

Thanks
Mandy

Try installing the app first with iTunes, launch it using UIAutomation on device stop it and then run your appium script.

The solution would be, try launching the application using xcode - automation tool (in the Open developer tools-> Instruments -> Automation) then try recoed some two to three steps. then quit from xcode. Now launch the application from the appium inspector. This would solve the problem.

This solution does not work. Still unable to launch the app with bundle exec arc

Selenium::WebDriver::Error::SessionNotCreatedError: Instruments crashed on startup

info: [IOS_SYSLOG_ROW ] May 13 12:05:40 iPhone com.apple.xpc.launchd[1] (UIKitApplication:com.app.iPhoneEnterprise[0x9814][398]) <Notice>: Service exited due to signal: Killed: 9

info: [IOS_SYSLOG_ROW ] May 13 12:05:40 iPhone SpringBoard[51] <Warning>: Application 'UIKitApplication:com.app.iPhoneEnterprise[0x9814]' exited abnormally via signal.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.app.iPhoneEnterprise was denied. The app must be signed with a development identity (e.g. iOS Developer).

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] Running ios sim reset flow
info: [debug] Killing the simulator process
info: [debug] Killing any other simulator daemons
info: [debug] Killall iOS Simulator

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

info: [debug] On a real device; cannot clean device state
info: [debug] Cleaning up appium session
info: [debug] Error: Instruments crashed on startup

Calabash has a similar issue from time to time, but a general restart of everything resolves it. I’ve rebooted everything - Xcode, the Appium.app, the device, and my computer but still have the issue.

@Yash
I am doing automation of Ios app on Mac.
While running Appium inspector, it does some processing then throws an error in pop-up box.

Also I am attaching my appium ios settings.

Please help.

Hello Kashif,

In order to Open inspector for any iOS application,

  1. The App should be in development mode(You can ask any of your developer to give the build in development mode)
  2. Either you can give App path/bundle ID, any one of these would be sufficient.
  3. if you still face the same problem please try the above step’s
  4. and still the problem persoist’s please post all the server log’s.

I hope i am making sense.

i can see that within the path there is a spaces. please replace the spaces either with _ or just delete the spaces in the path. It will work.

@Shiva.
Thanks for reply.

Okay I am going to do it.

One question is in my mind, that when ever I set Ios settings from appium, then i click Launch button, it show some logs and then print Appium is listening on xxx port.
Means appium ran successfully.

But it does not install app on ios simulator ? Like previously I was doing for Android, and after launching it runs app on android emulator.

Instead it tries to install app when i click on Inspector button .
Am i missing some thing ?

@shiva.

I am again having issue while clicking appium inspector.

I am attaching logs.
Kindly take a look.appium_ios_logs.txt (195.4 KB)

Try these steps and check if it helps:

  1. Change app file name from fsonic V2.ipa to fsonicV2.ipa (no space in the file name)
  2. Launch the Appium server and click on the Inspect icon (icon next to Doctor icon)

Okay, I will try that,

One more question ,

for iOS automation from appium, can we access source code of iOS application ? Or we just use ipa, and gets its UI element (means we cannot test background data)?

No we cannot access the source code unless its your own company’s app.

@Kashif

I have noticed one more issue in the appium UI inspector, i.e UDID of the device is missing in the UI automator.

When ever we are working on iOS device, we need to make sure that we give UDID of the device. please provide the UDID of the device in the text field.

I have met this issue once. After I remove the temporary files for appium under /tmp folder, the issue was gone.

I see a similar issue but slightly different. When I install the app on simulator via a script, the install goes through fine but the app keeps crashing. Manually if i try to open the app on simulator it crashes as well. The build i used were archived debug development build.

Can someone help me out here?

Error seen in logs:


Program specified by service does not contain one of the requested architectures: P

Error launching instruments: Instruments crashed on startup

@Priyank_Shah can you help out ?

You need developer signed app, as the instruments will not be able to communicate until and unless the app is dev signed.
Refer this link