title: Could not pre-launch appium: Error: Instruments crashed on startup
body: <ol>
  <li><p>I need to inspect an iOS app in appium inspector using real iphone device.</p></li>
  <li><p>I am using 1.4.8 as appium version, physical device as iphone 6 and platform version as 8.3.</p></li>
  <li><p>I have enabled Enable UI Automation option under Developer option settings.</p></li>
  <li><p>I have given the following parameters in iOS settings menu.
    App path: .zip format, Platform Version: 8.3, Force Device: iPhone and UDID: for that specific device </p>
  
  <ol start="5">
  <li>If I start appium server, I am getting the below log message.</li>
  </ol></li>
  </ol>
  
  <blockquote>
    <p>Error Log:-</p>
    
    <p>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/valar/work/sample_App.zip" --udid
    "4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00" --show-ios-log
    --device-name "iPhone 6"</p>
    
    <p>info: [debug] Starting Appium in pre-launch mode</p>
    
    <p>info: Pre-launching app info: *************************************
    info: ************************************* info:
    ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ****        NEW SESSION           <strong>* info: ****        NEW SESSION           *</strong> info: ****        NEW SESSION           <strong>* info: ****        NEW SESSION           *</strong>
    info: ****        NEW SESSION           <strong>* info: ****        NEW
    SESSION           *</strong> info: ****        NEW SESSION           <strong>*
    info: ****        NEW SESSION           *</strong> info:
    ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: ************************************* info: *************************************</p>
    
    <p>info: [debug] Using local .zip from command line:
    /Users/valar/work/sample_App.zip info: [debug] Copying local zip to
    tmp dir</p>
    
    <p>info: [debug] /Users/valar/work/sample_App.zip copied to
    /var/folders/7g/_4s8f5kx4cs1875_psp3rps00000gn/T/115725-3663-1b0sdz4/appium-app.zip</p>
    
    <p>info: [debug] Unzipping
    /var/folders/7g/_4s8f5kx4cs1875_psp3rps00000gn/T/115725-3663-1b0sdz4/appium-app.zip</p>
    
    <p>info: [debug] Testing zip archive:
    /var/folders/7g/_4s8f5kx4cs1875_psp3rps00000gn/T/115725-3663-1b0sdz4/appium-app.zip</p>
    
    <p>info: [debug] Zip archive tested clean</p>
    
    <p>info: [debug] Unzip successful</p>
    
    <p>info: [debug] Using locally extracted app:
    /var/folders/7g/_4s8f5kx4cs1875_psp3rps00000gn/T/115725-3663-1b0sdz4/sample_App.app</p>
    
    <p>info: [debug] Creating new appium session
    ab360b32-08b6-4f6b-889e-78fe9a6b88f3 info: [debug] Removing any
    remaining instruments sockets info: [debug] Cleaned up instruments
    socket /tmp/instruments_sock info: [debug] Auto-detecting iOS udid...
    info: [debug] Not auto-detecting udid, running on sim</p>
    
    <p>info: [debug] Parsed app Info.plist (as binary)</p>
    
    <p>info: [debug] Parsed app Localizable.strings info: [debug] Getting
    bundle ID from app</p>
    
    <p>info: [debug] Parsed app Info.plist (as binary) info: [debug] Creating
    instruments info: [debug] Preparing uiauto bootstrap info: [debug]
    Dynamic bootstrap dir: /Users/valar/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/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
    info: [debug] Dynamic bootstrap code: // This file is automatically
    generated. Do not manually modify! ... info: [debug] Dynamic bootstrap
    path: /Users/valar/Library/Application
    Support/appium/bootstrap/bootstrap-f2765f8569503e7c.js</p>
    
    <p>info: [debug] Reusing dynamic bootstrap:
    /Users/valar/Library/Application
    Support/appium/bootstrap/bootstrap-f2765f8569503e7c.js info: [debug]
    Attempting iOS device log capture via libimobiledevice idevicesyslog</p>
    
    <p>info: [debug] Creating iDevice object with udid
    4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:37:49 iPhone-6 syslog_relay[177]
    : syslog_relay found the ASL prompt. Starting...</p>
    
    <p>info: [debug] App is installed.</p>
    
    <p>info: [debug] fullReset not requested. No need to install. info:
    [debug] Starting command proxy.</p>
    
    <p>info: [debug] Instruments socket server started at
    /tmp/instruments_sock info: [debug] Starting instruments</p>
    
    <p>info: [debug] Instruments is at:
    /Applications/Xcode.app/Contents/Developer/usr/bin/instruments</p>
    
    <p>info: Launching instruments</p>
    
    <p>info: [debug] Attempting to run app on real device with UDID
    4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00 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 4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00 com.company.iphone.
    sample_App -e UIASCRIPT "/Users/valar/Library/Application
    Support/appium/bootstrap/bootstrap-f2765f8569503e7c.js" -e
    UIARESULTSPATH /tmp/appium-instruments info: [debug] And extra
    without-delay env: {} info: [debug] And launch timeouts (in ms):
    {"global":90000}</p>
    
    <p>info: [debug] [INSTSERVER] Instruments exited with code 253</p>
    
    <p>info: [debug] Killall instruments</p>
    
    <p>info: [debug] Instruments crashed on startup info: [debug] Attempting
    to retry launching instruments, this is retry #1 info: [debug] Killall
    iOS Simulator info: [IOS_SYSLOG_ROW ] Aug 25 11:37:50 iPhone-6
    DTMobileIS[191] : Could not create service named
    com.apple.instruments.server.services.processcontrol.posixspawn info:
    [IOS_SYSLOG_ROW ] Aug 25 11:37:50 iPhone-6 DTMobileIS[191] :
    Could not create service named
    com.apple.instruments.server.services.launchdaemon</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:37:50 iPhone-6
    notification_proxy[175] : 0x100494000 -[MNPLockdownConnection
    receiveMessage]: lockdown_receive_message error!</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:37:50 iPhone-6
    notification_proxy[175] : 0x100494000 -[MNPLockdownConnection
    receiveMessage]: lockdown_receive_message error!</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:37:52 iPhone-6 locationd[61]
    : Location icon should now be in state 'Active'</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:37:53 iPhone-6 CLTM[20] :
    CLTM: _subscription 0x0, _subscribedChannels 0x0</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:37:55 iPhone-6 sample_App[151]
    : NewRelic(4.186,0x174675e80):   NRTimer.m:94    -[NRTimer
    timeElapsedInSeconds]</p>
    
    <p>info: [IOS_SYSLOG_ROW ] NRMATimer has a negative duration:
    1440482874430.621094 => 0.000000</p>
    
    <p>info: Launching instruments</p>
    
    <p>info: [debug] Attempting to run app on real device with UDID
    4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00</p>
    
    <p>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 4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00 com.company.iphone.sample_App
    -e UIASCRIPT "/Users/valar/Library/Application Support/appium/bootstrap/bootstrap-f2765f8569503e7c.js" -e
    UIARESULTSPATH /tmp/appium-instruments info: [debug] And extra
    without-delay env: {} info: [debug] And launch timeouts (in ms):
    {"global":90000}</p>
    
    <p>info: [debug] [INSTSERVER] Instruments exited with code 253 info:
    [debug] Killall instruments</p>
    
    <p>info: [debug] Instruments crashed on startup</p>
    
    <p>info: [debug] Attempting to retry launching instruments, this is retry</p>
    
    <h1>2 info: [debug] Killall iOS Simulator info: [IOS_SYSLOG_ROW ] Aug 25 11:37:56 iPhone-6 DTMobileIS[191] : Could not create service</h1>
    
    <p>named com.apple.instruments.server.services.launchdaemon info:
    [IOS_SYSLOG_ROW ] Aug 25 11:37:56 iPhone-6 DTMobileIS[191] :
    Could not create service named
    com.apple.instruments.server.services.processcontrol.posixspawn info:
    [IOS_SYSLOG_ROW ] Aug 25 11:37:56 iPhone-6 notification_proxy[175]
    : 0x100384000 -[MNPLockdownConnection receiveMessage]:
    lockdown_receive_message error! info: [IOS_SYSLOG_ROW ] Aug 25
    11:37:56 iPhone-6 notification_proxy[175] : 0x100384000
    -[MNPLockdownConnection receiveMessage]: lockdown_receive_message error!</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:37:58 iPhone-6 CLTM[20] :
    CLTM: _subscription 0x0, _subscribedChannels 0x0</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:38:01 iPhone-6 sample_App151]
    : NewRelic(4.186,0x17487e440):   NRTimer.m:94    -[NRTimer
    timeElapsedInSeconds]</p>
    
    <p>info: [IOS_SYSLOG_ROW ] NRMATimer has a negative duration:
    1440482880235.167969 => 0.000000</p>
    
    <p>info: Launching instruments</p>
    
    <p>info: [debug] Attempting to run app on real device with UDID
    4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00 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 4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00 com.company.iphone.
    sample_App -e UIASCRIPT "/Users/valar/Library/Application
    Support/appium/bootstrap/bootstrap-f2765f8569503e7c.js" -e
    UIARESULTSPATH /tmp/appium-instruments info: [debug] And extra
    without-delay env: {} info: [debug] And launch timeouts (in ms):
    {"global":90000}</p>
    
    <p>info: [debug] [INSTSERVER] Instruments exited with code 253</p>
    
    <p>info: [debug] Killall instruments</p>
    
    <p>info: [debug] Instruments crashed on startup info: [debug] Attempting
    to retry launching instruments, this is retry #3 info: [debug] Killall
    iOS Simulator info: [IOS_SYSLOG_ROW ] Aug 25 11:38:02 iPhone-6
    DTMobileIS[191] : Could not create service named
    com.apple.instruments.server.services.processcontrol.posixspawn info:
    [IOS_SYSLOG_ROW ] Aug 25 11:38:02 iPhone-6 DTMobileIS[191] :
    Could not create service named
    com.apple.instruments.server.services.launchdaemon</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:38:02 iPhone-6
    notification_proxy[175] : 0x10040c000 -[MNPLockdownConnection
    receiveMessage]: lockdown_receive_message error!</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:38:02 iPhone-6
    notification_proxy[175] : 0x10040c000 -[MNPLockdownConnection
    receiveMessage]: lockdown_receive_message error!</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:38:02 iPhone-6 locationd[61]
    : Location icon should now be in state 'Region Monitoring'</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:38:03 iPhone-6 CLTM[20] :
    CLTM: _subscription 0x0, _subscribedChannels 0x0</p>
    
    <p>info: [IOS_SYSLOG_ROW ] Aug 25 11:38:07 iPhone-6 sample_App[151]
    : NewRelic(4.186,0x174675e80):   NRTimer.m:94    -[NRTimer
    timeElapsedInSeconds]</p>
    
    <p>info: [IOS_SYSLOG_ROW ] NRMATimer has a negative duration:
    1440482886151.112061 => 0.000000</p>
    
    <p>info: Launching instruments</p>
    
    <p>info: [debug] Attempting to run app on real device with UDID
    4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00 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 4a9b4ad142c7f308bfd3217d2fae43f9a4bc8e00 com.company.iphone.
    sample_App -e UIASCRIPT "/Users/valar/Library/Application
    Support/appium/bootstrap/bootstrap-f2765f8569503e7c.js" -e
    UIARESULTSPATH /tmp/appium-instruments info: [debug] And extra
    without-delay env: {} info: [debug] And launch timeouts (in ms):
    {"global":90000}</p>
    
    <p>info: [debug] [INSTSERVER] Instruments exited with code 253</p>
    
    <p>info: [debug] Killall instruments</p>
    
    <p>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: [IOS_SYSLOG_ROW ] Aug 25 11:38:07 iPhone-6
    DTMobileIS[191] : Could not create service named
    com.apple.instruments.server.services.launchdaemon info:
    [IOS_SYSLOG_ROW ] Aug 25 11:38:07 iPhone-6 DTMobileIS[191] :
    Could not create service named
    com.apple.instruments.server.services.processcontrol.posixspawn info:
    [debug] On a real device; cannot clean device state info: [debug]
    Cleaning up appium session</p>
    
    <p>error: Could not pre-launch appium: Error: Instruments crashed on
    startup</p>
  </blockquote>