Can't run appium Inspector on real iPad device

Hi Appium Folks,
I am experiencing problem with setup of Appium inspector on real device. Here are my environment details:

Desktop: Mac 10.11.1 , Xcode: 7.0.1
Device: iPad Air 9.1
The app was developed under Enterprise developer account (you need to trust a profile in the setting to be able to run it on real device when installing via .IPA file)
Appium GUI: Version 1.4.13

Here are Appium Inspector settings:


When I try to run Appium Inspector on Attached device, it shows this error and this output

Launching Appium with command: ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --session-override --log-no-colors --debug-log-spacing --platform-version “9.1” --platform-name “iOS” --app “/AutoTest/TestGo.ipa” --udid “70088e41c4b937a14f531369282f69838556c1ee1” --backend-retries “5” --device-name “iPad Air” --native-instruments-lib

info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)

info: Appium REST http interface listener started on 0.0.0.0:4723

info: [debug] Non-default server args: {“app”:"/AutoTest/TestGo.ipa",“udid”:“70088e41c4b937a14f531369282f69838556c1ee1”,“backendRetries”:5,“sessionOverride”:true,“logNoColors”:true,“nativeInstrumentsLib”:true,“deviceName”:“iPad Air”,“platformName”:“iOS”,“platformVersion”:“9.1”,“debugLogSpacing”:true}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

info: <-- GET /wd/hub/status 200 12.038 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

info: <-- GET /wd/hub/status 200 6.933 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: <-- GET /wd/hub/status 200 1.023 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {“status”:0,“value”:[]}

info: <-- GET /wd/hub/sessions 200 1.742 ms - 23 {“status”:0,“value”:[]}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformName”:“iOS”,“platformVersion”:“9.1”,“newCommandTimeout”:“999999”,“automationName”:“Appium”,“deviceName”:“iPad Air”}}

info: Client User-Agent string: Appium (unknown version) CFNetwork/760.1.2 Darwin/15.0.0 (x86_64)
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 .ipa from command line: /AutoTest/TestGo.ipa
info: [debug] Copying local zip to tmp dir

info: [debug] /AutoTest/TestGo.ipa copied to /var/folders/z5/ytd_j37n0hl5vl6pdc7nxwzm0000gn/T/115109-16796-qumfrt/appium-app.zip

info: [debug] Unzipping /var/folders/z5/ytd_j37n0hl5vl6pdc7nxwzm0000gn/T/115109-16796-qumfrt/appium-app.zip

info: [debug] Testing zip archive: /var/folders/z5/ytd_j37n0hl5vl6pdc7nxwzm0000gn/T/115109-16796-qumfrt/appium-app.zip

info: [debug] Zip archive tested clean

info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/z5/ytd_j37n0hl5vl6pdc7nxwzm0000gn/T/115109-16796-qumfrt/Payload/Test Go.app

info: [debug] Creating new appium session 72884725-3883-4de9-b88d-44b3b2fc4480

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
info: [debug] Could not parse plist file (as binary) at /var/folders/z5/ytd_j37n0hl5vl6pdc7nxwzm0000gn/T/115109-16796-qumfrt/Payload/Test Go.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 /var/folders/z5/ytd_j37n0hl5vl6pdc7nxwzm0000gn/T/115109-16796-qumfrt/Payload/Test Go.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] Could not parse plist file (as binary) at /var/folders/z5/ytd_j37n0hl5vl6pdc7nxwzm0000gn/T/115109-16796-qumfrt/Payload/Test Go.app/Info.plist
info: Will try to parse the plist file as XML

info: [debug] Parsed app Info.plist (as XML)
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/gabo/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/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
info: [debug] Reusing dynamic bootstrap: /Users/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with udid 70088e41c4b937a14f531369282f69838556c1ee1

info: [debug] App is not installed. Will try to install the app.

info: [debug] Installing ipa found at /AutoTest/TestGo.ipa

info: [debug] Nothing found on device, going ahead and installing.

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 real device with UDID 70088e41c4b937a14f531369282f69838556c1ee1
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 70088e41c4b937a14f531369282f69838556c1ee1 com.Test.workplaceBeta -e UIASCRIPT “/Users/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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-09 15:24:42.090 instruments[16815:5391919] Failed to start Instruments daemon on ‘apple’s iPad XXX (9.1)’ (The service is invalid.)

info: [debug] [INST] Waiting for device to boot…

info: [debug] [INST STDERR] 2015-11-09 15:24:42.556 instruments[16815:5391918] Failed to start Instruments daemon on ‘apple’s iPad XXX (9.1)’ (The service is invalid.)

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”},“isShuttingDown”:false},“sessionId”:“72884725-3883-4de9-b88d-44b3b2fc4480”}
info: <-- GET /wd/hub/status 200 1.698 ms - 179 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”},“isShuttingDown”:false},“sessionId”:“72884725-3883-4de9-b88d-44b3b2fc4480”}

info: [debug] [INST STDERR] Instruments Usage Error : Timed out waiting for device to boot: “apple’s iPad XXX (9.1)”

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

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 real device with UDID 70088e41c4b937a14f531369282f69838556c1ee1
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 70088e41c4b937a14f531369282f69838556c1ee1 com.Test.workplaceBeta -e UIASCRIPT “/Users/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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-09 15:25:18.306 instruments[16821:5392259] Failed to start Instruments daemon on ‘apple’s iPad XXX (9.1)’ (The service is invalid.)

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: com.Test.workplaceBeta
instruments, version 7.0.1 (58157)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

info: [debug] [INSTSERVER] Instruments exited with code 255
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 real device with UDID 70088e41c4b937a14f531369282f69838556c1ee1
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 70088e41c4b937a14f531369282f69838556c1ee1 com.Test.workplaceBeta -e UIASCRIPT “/Users/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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-09 15:25:24.460 instruments[16827:5392477] Failed to start Instruments daemon on ‘apple’s iPad XXX (9.1)’ (The service is invalid.)

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: com.Test.workplaceBeta
instruments, version 7.0.1 (58157)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

info: [debug] [INSTSERVER] Instruments exited with code 255
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 real device with UDID 70088e41c4b937a14f531369282f69838556c1ee1
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 70088e41c4b937a14f531369282f69838556c1ee1 com.Test.workplaceBeta -e UIASCRIPT “/Users/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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-09 15:25:30.598 instruments[16833:5392520] Failed to start Instruments daemon on ‘apple’s iPad XXX (9.1)’ (The service is invalid.)

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: com.Test.workplaceBeta
instruments, version 7.0.1 (58157)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

info: [debug] [INSTSERVER] Instruments exited with code 255
info: [debug] Killall instruments
info: [debug] Instruments crashed on startup
info: [debug] Attempting to retry launching instruments, this is retry #4
info: [debug] Killall iOS Simulator

info: Launching instruments

info: [debug] Attempting to run app on real device with UDID 70088e41c4b937a14f531369282f69838556c1ee1
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 70088e41c4b937a14f531369282f69838556c1ee1 com.Test.workplaceBeta -e UIASCRIPT “/Users/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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-09 15:25:36.782 instruments[16838:5392773] Failed to start Instruments daemon on ‘apple’s iPad XXX (9.1)’ (The service is invalid.)

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: com.Test.workplaceBeta
instruments, version 7.0.1 (58157)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

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

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

info: Launching instruments

info: [debug] Attempting to run app on real device with UDID 70088e41c4b937a14f531369282f69838556c1ee1
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 70088e41c4b937a14f531369282f69838556c1ee1 com.Test.workplaceBeta -e UIASCRIPT “/Users/gabo/Library/Application Support/appium/bootstrap/bootstrap-6745615c424bb0c0.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-09 15:25:42.943 instruments[16843:5392904] Failed to start Instruments daemon on ‘apple’s iPad XXX (9.1)’ (The service is invalid.)

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: com.Test.workplaceBeta
instruments, version 7.0.1 (58157)
usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument …]]]

info: [debug] [INSTSERVER] Instruments exited with code 255
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

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

info: [debug] Killall iOS Simulator
info: [debug] On a real device; cannot clean device 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/node_modules/appium-instruments/lib/instruments.js:440:31)
at [object Object]. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/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 107441.670 ms - 182

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}
info: <-- GET /wd/hub/status 200 1.239 ms - 105 {“status”:0,“value”:{“build”:{“version”:“1.4.13”,“revision”:“c75d8adcb66a75818a542fe1891a34260c21f76a”}}}

Could you please help how to setup Appium on real iOS device ?

Thanks

@gabo
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.

Go to Appium and start the server.

Now your app get installed successfully in device.

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".