Appium not running iOS Simulator - Mac OSX El Capitan

I’m very new to this site and to Appium, so I appreciate your feedback in the most easy to understand way. :smile:

Below are my prerequisites:

Mac OS El Capitan 10.11.2
Appium - Version 1.4.13 (Draco)
Xcode - Version 7.2 (7C68)
Xcode Path - Macintosh HD >> Applications >> Xcode
iOS settings - iPhone 6 / Version 8.3
Developer Settings - Enabled Automation

After launching my app, I’m receiving the error - error: Could not pre-launch appium: Error: Instruments crashed on startup

Should I add my entire log as well after clicking Launch?

@tony_D
This issue got resolved for me. I will explain the steps which I have done.
Go to Xcode ->Click Open Developer Tools-> Click Instruments->In
top of the Instruments tab you can find Choose a profiling
template(Choose your iPhone device)->Select Automation->Click
Choose button->Click the Play button.

To inspect in appium version 1.4.13, We need to include below steps also.

Go to Advanced settings in iOS settings. Tick " Use Native Instruments Library".

Go to Appium and start the server.

Now your app get installed successfully in device.

1 Like

@tony_D

What instrument you are using real device or simulator?
if answer is real device,Do you have your xcode project of your application?

yes means give your full appium log.

else there are many things we have to check like provisioning,developer sign ,ect

Thanks,
-Mani

Thank you for your reply, Mani

I am using a simulator -

Here’s my updated log file after receiving help from Salvi as I’m still not able to log on successfully -

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --command-timeout “7200” --pre-launch --debug-log-spacing --platform-version “8.3” --platform-name “iOS” --app “/Users/tonydrake/Desktop/OrganoGold.app” --device-name “iPhone 6” --native-instruments-lib

info: [debug] Starting Appium in pre-launch mode

info: Pre-launching app
info: *************************************
info: *************************************

info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************

info: [debug] Using local app from command line: /Users/tonydrake/Desktop/OrganoGold.app
info: [debug] Creating new appium session 5aa44c5a-05fd-4892-abae-6862eb186242

info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode version

info: [debug] Xcode version set to 7.2

info: [debug] Setting iOS SDK Version

info: [debug] iOS SDK Version set to 9.2
info: [debug] Checking whether instruments supports our device string
info: [debug] Getting list of devices instruments supports

info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“7.2”,“iOSSDKVersion”:“9.2”,“deviceName”:“iPhone 6”,“platformVersion”:“8.3”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 6 (8.3)’
info: [debug] iOS sim UDID is BB9D4651-AEB3-4AE1-993D-7A204B018C6D
info: [debug] Auto-detecting iOS udid…
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /Users/tonydrake/Desktop/OrganoGold.app/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Users/tonydrake/Desktop/OrganoGold.app/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn’t exist
info: [debug] Getting bundle ID from app

info: [debug] Parsed app Info.plist (as binary)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap

info: [debug] Dynamic bootstrap dir: /Users/tonydrake/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {“nodePath”:"/Applications/Appium.app/Contents/Resources/node/bin/node",“commandProxyClientPath”:"/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js",“instrumentsSock”:"/tmp/instruments_sock",“interKeyDelay”:null,“justLoopInfinitely”:false,“autoAcceptAlerts”:false,“autoDismissAlerts”:false,“sendKeyStrategy”:“oneByOne”}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

info: [debug] Dynamic bootstrap path: /Users/tonydrake/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js
info: [debug] Reusing dynamic bootstrap: /Users/tonydrake/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“7.2”,“iOSSDKVersion”:“9.2”,“deviceName”:“iPhone 6”,“platformVersion”:“8.3”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 6 (8.3)’

info: [debug] We’re on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“7.2”,“iOSSDKVersion”:“9.2”,“deviceName”:“iPhone 6”,“platformVersion”:“8.3”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘iPhone 6 (8.3)’
info: [debug] Parsed app Info.plist (as binary)
info: [debug] Wrote new app Info.plist with device type
info: [debug] Checking whether we need to set app preferences
info: [debug] Running ios sim reset flow
info: [debug] Killing the simulator process

info: [debug] Killing any other simulator daemons

info: [debug] Cleaning sim data files
info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: [debug] Killall iOS Simulator

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: [debug] Cleaning app data files

error: Could not reset simulator. Leaving as is. Error: Command ‘xcrun simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D’ exited with code 159

info: Couldn’t find app directories to delete. Probably it’s not installed
info: [debug] Not setting locale
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS 8.* simulator log capture

info: [debug] Not pre-launching simulator

info: [debug] Starting command proxy.
info: [debug] Instruments socket server started at /tmp/instruments_sock
info: [debug] Starting instruments

info: [debug] Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments
info: Launching instruments
info: [debug] Attempting to run app on iPhone 6 (8.3)

info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 6 (8.3)” /Users/tonydrake/Desktop/OrganoGold.app -e UIASCRIPT “/Users/tonydrake/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-12-25 15:14:08.657 instruments[6489:306625] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] 2015-12-25 15:14:08.658 instruments[6489:306622] Attempting to change event horizon while disengage

info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

info: [debug] [INSTSERVER] Instruments exited with code 253

info: [debug] Killall instruments

info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #1
info: [debug] Killall iOS Simulator

info: Launching instruments

info: [debug] Attempting to run app on iPhone 6 (8.3)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 6 (8.3)” /Users/tonydrake/Desktop/OrganoGold.app -e UIASCRIPT “/Users/tonydrake/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-12-25 15:14:20.862 instruments[6506:306842] Attempting to change event horizon while disengage
2015-12-25 15:14:20.863 instruments[6506:306839] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Failed looking up pid of launched process
info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #2
info: [debug] Killall iOS Simulator

info: Launching instruments

info: [debug] Attempting to run app on iPhone 6 (8.3)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 6 (8.3)” /Users/tonydrake/Desktop/OrganoGold.app -e UIASCRIPT “/Users/tonydrake/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-12-25 15:14:33.122 instruments[6522:307035] Attempting to change event horizon while disengage

info: [debug] [INST STDERR] 2015-12-25 15:14:33.125 instruments[6522:306983] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

info: [debug] [INSTSERVER] Instruments exited with code 253
info: [debug] Killall instruments

info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #3
info: [debug] Killall iOS Simulator

info: Launching instruments

info: [debug] Attempting to run app on iPhone 6 (8.3)
info: [debug] Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w “iPhone 6 (8.3)” /Users/tonydrake/Desktop/OrganoGold.app -e UIASCRIPT “/Users/tonydrake/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-12-25 15:14:45.315 instruments[6538:307179] Attempting to change event horizon while disengage
2015-12-25 15:14:45.315 instruments[6538:307228] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

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

info: [debug] Cleaning sim data files
info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

info: node-simctl: Executing: xcrun with args: simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D and timeout: 2000

error: Could not reset simulator. Leaving as is. Error: Command ‘xcrun simctl erase BB9D4651-AEB3-4AE1-993D-7A204B018C6D’ exited with code 159

info: [debug] Cleaning app data files

error: Could not pre-launch appium: Error: Instruments crashed on startup

info: Couldn’t find app directories to delete. Probably it’s not installed
info: [debug] Cleaning up appium session

Thank you. Ticking ‘Native Instrument Library’ and typing in 9.2 into the version worked for me