Appium couldn't connect to my real device IOS

I put the link of my app in ios settings and bundle id + udid,
I got the following error in appium while i try to connect my ios device to Mac.

PS: it works fine with Android.

According to log you don’t have libimobiledevice installed.
To install run below in terminal(assuming you have homebrew installed)
brew install libimobiledevice

1 Like

when i tap : brew install libimobiledevice ==> brew: command not found
i tap : ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” < /dev/null 2> /dev/null
in order to install the brew command first of all

Do you mean you are not able to install brew on your machine???

no i have installed it. and i got another error :

Now i install ideviceinstaller but i appium couldn’t be launched !

Please post the server logs.
Are you sure that you are using real device’s UDID, from screen shot it looks like you have provided the UDID of a sim, UDID of real device does not have dashes with them.

It was just because i test with both simulator and real device and both are not working :frowning:
Here is my log file :

s-log --device-name “iPhone 5” --isolate-sim-device

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] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 79fe7d92-e9cc-44c4-854e-f8634ff8a4d5
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 /Applications/Appium.app/Contents/Resources/node_modules/appium/com.quodfinancial.KMEFIC/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.quodfinancial.KMEFIC/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn’t exist
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/Emna/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”:“grouped”}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

info: [debug] Dynamic bootstrap path: /Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
info: [debug] Reusing dynamic bootstrap: /Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with udid 439e45f9204ec04d4ece3fe9226f5aa6ad22f631

info: [IOS_SYSLOG_ROW ] Jan 18 12:24:50 Wafa-iPhone timed[58] : (Note ) CoreTime: Want active time in 41.48min. Need active time in 8333.15min. Remaining retry interval: 0.000000min.

info: [IOS_SYSLOG_ROW ] Jan 18 12:24:50 Wafa-iPhone UserEventAgent[23] : validateAndAddDefaults(com.apple.timed): End Time (inf) > now (474809090.5) + BACKGROUND_TASK_AGENT_JOB_WINDOW_MAX_TIME_FROM_NOW_SEC (3024000.0) + BACKGROUND_TASK_AGENT_JOB_TIME_ERROR_MARGIN (300.0)
info: [IOS_SYSLOG_ROW ] Jan 18 12:24:50 Wafa-iPhone timed[58] : (Error) CoreTime: Error requesting proactive time check job
info: [IOS_SYSLOG_ROW ] Jan 18 12:24:51 Wafa-iPhone timed[58] : (Note ) CoreTime: Want active time in 41.50min. Need active time in 8333.16min. Remaining retry interval: 0.000000min.
info: [IOS_SYSLOG_ROW ] Jan 18 12:24:51 Wafa-iPhone UserEventAgent[23] : validateAndAddDefaults(com.apple.timed): End Time (inf) > now (474809091.6) + BACKGROUND_TASK_AGENT_JOB_WINDOW_MAX_TIME_FROM_NOW_SEC (3024000.0) + BACKGROUND_TASK_AGENT_JOB_TIME_ERROR_MARGIN (300.0)
info: [IOS_SYSLOG_ROW ] Jan 18 12:24:51 Wafa-iPhone timed[58] : (Error) CoreTime: Error requesting proactive time check job
info: [IOS_SYSLOG_ROW ] Jan 18 12:24:52 Wafa-iPhone timed[58] : (Note ) CoreTime: Want active time in 41.51min. Need active time in 8333.17min. Remaining retry interval: 0.000000min.
info: [IOS_SYSLOG_ROW ] Jan 18 12:24:52 Wafa-iPhone UserEventAgent[23] : validateAndAddDefaults(com.apple.timed): End Time (inf) > now (474809092.7) + BACKGROUND_TASK_AGENT_JOB_WINDOW_MAX_TIME_FROM_NOW_SEC (3024000.0) + BACKGROUND_TASK_AGENT_JOB_TIME_ERROR_MARGIN (300.0)
info: [IOS_SYSLOG_ROW ] Jan 18 12:24:52 Wafa-iPhone timed[58] : (Error) CoreTime: Error requesting proactive time check job
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:03 Wafa-iPhone locationd[60] : Gesture EnabledForTopClient: 1 (SiriCalled)
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:03 Wafa-iPhone MobileSafari[2542] : KeychainGetICDPStatus: keychain: -25300
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:03 Wafa-iPhone MobileSafari[2542] : KeychainGetICDPStatus: status: off
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:03 Wafa-iPhone SpringBoard[898] : HW kbd: Failed to set (null) as keyboard focus
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:03 Wafa-iPhone MobileSafari[2542] : Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:04 Wafa-iPhone locationd[60] : Gesture EnabledForTopClient: 1 (SiriCalled)
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:06 Wafa-iPhone locationd[60] : Gesture EnabledForTopClient: 1 (SiriCalled)
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:07 Wafa-iPhone searchd[900] : notify name “com.apple.mobile.keybagd.first_unlock” has been registered 120 times - this may be a leak
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:07 Wafa-iPhone locationd[60] : Gesture EnabledForTopClient: 1 (SiriCalled)
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:08 Wafa-iPhone locationd[60] : Gesture EnabledForTopClient: 1 (SiriCalled)
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:08 Wafa-iPhone networkd[88] : -[NETAWDManager reportStats:metricID:] server 0x13cd42120, container 0x13ce6a880, metrid 2686983, successfully reported:
info: [IOS_SYSLOG_ROW ] <AWDLibnetcoreTCPConnectionReport: 0x13ce24810> {
info: [IOS_SYSLOG_ROW ] cellularFallbackReport = {
info: [IOS_SYSLOG_ROW ] dataUsageSnapshotsAtNetworkEvents = (
info: [IOS_SYSLOG_ROW ] {
info: [IOS_SYSLOG_ROW ] bytesIn = 150;
info: [IOS_SYSLOG_ROW ] bytesOut = 1100;
info: [IOS_SYSLOG_ROW ] }
info: [IOS_SYSLOG_ROW ] );
info: [IOS_SYSLOG_ROW ] “fallbackTimer_msecs” = 0;
info: [IOS_SYSLOG_ROW ] fellback = 0;
info: [IOS_SYSLOG_ROW ] networkEvents = (
info: [IOS_SYSLOG_ROW ] “NETWORK_EVENT_DATA_STALL_AT_APP_LAYER”
info[
39m: [IOS_SYSLOG_ROW ] );
info: [IOS_SYSLOG_ROW ] “timeToNetworkEvents_msecs” = (
info: [IOS_SYSLOG_ROW ] 3280
info: [IOS_SYSLOG_ROW ] );
info: [IOS_SYSLOG_ROW ] };
info: [IOS_SYSLOG_ROW ] clientIdentifier = “com.apple.WebKit.Networking”;
info: [IOS_SYSLOG_ROW ] connectionStatisticsReport = {
info: [IOS_SYSLOG_ROW ] DNSAnswersCached = 1;
info: [IOS_SYSLOG_ROW ] “DNSResolvedTime_msecs” = 2;
info: [IOS_SYSLOG_ROW ] RTTvariance = 34;
info: [IOS_SYSLOG_ROW ] “appDataStallTimer_msecs” = 3;
info: [IOS_SYSLOG_ROW ] appReportingDataStallCount = 1;
info: [IOS_SYSLOG_ROW ] “bestRTT_msecs” = 143;
info: [IOS_SYSLOG_ROW ] betterRouteEventCount = 0;
info: [IOS_SYSLOG_ROW ] bytesDuplicate = 5400;
info: [IOS_SYSLOG_ROW ] bytesIn = 16000;
info: [IOS_SYSLOG_ROW ] bytesOut = 2000;
info: [IOS_SYSLOG_ROW ] bytesOutOfOrder = 0;
info: [IOS_SYSLOG_ROW ] bytesRetransmitted = 0;
info: [IOS_SYSLOG_ROW ] cellularFallback = 0;
info: [IOS_SYSLOG_ROW ] cellularRRCConnected = 0;
info: [IOS_SYSLOG_ROW ] connected = 1;
info: [IOS_SYSLOG_ROW ] connectedInterfaceType = “INTERFACE_TYPE_WIFI”;
info: [IOS_SYSLOG_ROW ] “connectionEstablishmentTime_msecs” = 119;
info: [IOS_SYSLOG_ROW ] connectionReuseCount = 0;
info: [IOS_SYSLOG_ROW ] “currentRTT_msecs” = 116;
info: [IOS_SYSLOG_ROW ] “flowDuration_msecs” = 7972;
info: [IOS_SYSLOG_ROW ] interfaceType = “INTERFACE_TYPE_WIFI”;
info: [IOS_SYSLOG_ROW ] kernelReportedStalls = 1;
info: [IOS_SYSLOG_ROW ] kernelReportingConnectionStalled = 0;
info: [IOS_SYSLOG_ROW ] kernelReportingReadStalled = 0;
info: [IOS_SYSLOG_ROW ] kernelReportingWriteStalled = 0;
info: [IOS_SYSLOG_ROW ] packetsDuplicate = 0;
info: [IOS_SYSLOG_ROW ] packetsIn = 13;
info: [IOS_SYSLOG_ROW ] packetsOut = 5;
info: [IOS_SYSLOG_ROW ] packetsOutOfOrder = 0;
info: [IOS_SYSLOG_ROW ] packetsRetransmitted = 0;
info: [IOS_SYSLOG_ROW ] “smoothedRTT_msecs” = 126;
info: [IOS_SYSLOG_ROW ] synRetransmissionCount = 0;
info: [IOS_SYSLOG_ROW ] tcpFastOpen = 0;
info: [IOS_SYSLOG_ROW ] “timeToConnectionEstablishment_msecs” = 121;
info: [IOS_SYSLOG_ROW ] “timeToConnectionStart_msecs” = 2;
info: [IOS_SYSLOG_ROW ] “timeToDNSResolved_msecs” = 2;
info: [IOS_SYSLOG_ROW ] “timeToDNSStart_msecs” = 0;
info: [IOS_SYSLOG_ROW ] trafficClass = 0;
info: [IOS_SYSLOG_ROW ] };
info: [IOS_SYSLOG_ROW ] delegated = 1;
info: [IOS_SYSLOG_ROW ] reportReason = “REPORT_REASON_DATA_STALL_AT_APP_LAYER”;
info: [IOS_SYSLOG_ROW ] sourceAppIdentifier = “com.apple.mobilesafari”;
info: [IOS_SYSLOG_ROW ] }
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:08 Wafa-iPhone locationd[60] : Gesture EnabledForTopClient: 1 (SiriCalled)
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:10 Wafa-iPhone timed[58] : (Note ) CoreTime: Want active time in 41.50min. Need active time in 8333.17min. Remaining retry interval: 0.000000min.
info: [IOS_SYSLOG_ROW ] Jan 18 12:25:10 Wafa-iPhone UserEventAgent[23] : validateAndAddDefaults(com.apple.timed): End Time (inf) > now (474809110.1) + BACKGROUND_TASK_AGENT_JOB_WINDOW_MAX_TIME_FROM_NOW_SEC (3024000.0) + BACKGROUND_TASK_AGENT_JOB_TIME_ERROR_MARGIN (300.0)

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

info: [debug] Cleaning up appium session

error: Could not pre-launch appium: Error: Installing com.quodfinancial.KMEFIC failed

Launching Appium with command: export NEW_KEY=“NEW_VALUE”; export NEW_KEY=“NEW_VALUE”; ‘/Applications/Appium.app/Contents/Resources/node/bin/node’ lib/server/main.js --address “127.0.0.1” --pre-launch --debug-log-spacing --platform-version “9.2” --platform-name “iOS” --app “com.quodfinancial.KMEFIC” --udid “439e45f9204ec04d4ece3fe9226f5aa6ad22f631” --show-ios-log --show-ios-log --device-name “iPhone 5” --isolate-sim-device

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] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 82213a45-7def-424d-ae67-75e882dde6d3
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 /Applications/Appium.app/Contents/Resources/node_modules/appium/com.quodfinancial.KMEFIC/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.quodfinancial.KMEFIC/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn’t exist
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/Emna/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”:“grouped”}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

info: [debug] Dynamic bootstrap path: /Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
info: [debug] Reusing dynamic bootstrap: /Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.js
info: [debug] Attempting iOS device log capture via libimobiledevice idevicesyslog

info: [debug] Creating iDevice object with udid 439e45f9204ec04d4ece3fe9226f5aa6ad22f631

info: [debug] App is installed.

info: [debug] fullReset not requested. No need to install.
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631 com.quodfinancial.KMEFIC -e UIASCRIPT “/Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.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] Instruments Usage Error : Unknown device specified: “439e45f9204ec04d4ece3fe9226f5aa6ad22f631”

info: [debug] [INST] Known Devices:
Emna’s Mac [564D35A4-EA26-E570-FA05-D6A4FF08D37B]
Apple TV 1080p (9.1) [62F4D332-6CB4-4EF0-8347-2057F3EEC26F]
iPad 2 (9.2) [94BCA4EE-2196-41F8-B435-2C972CA23C9B]
iPad Air (9.2) [49882BB2-C0B0-4FEE-AB35-3FD6BB66A974]
iPad Air 2 (9.2) [5A5FE928-1001-4A7F-B4DC-78F3A3E792F5]
iPad Pro (9.2) [2919A8CF-8E87-4EEF-A88A-86788EC27211]
iPad Retina (9.2) [C960124F-AF8C-4B21-8D54-133070C67F11]
iPhone 4s (9.2) [1CB80404-F9E9-49B1-B960-192CCB5DCB99]
iPhone 5 (9.2) [6BA49494-82ED-4D79-BB8F-B432B8BDF606]
iPhone 5s (9.2) [E156FEF3-FB30-4806-AE96-FF16E064008F]
iPhone 6 (9.2) [887240FC-3A01-437C-A57C-4C4B208F6149]
iPhone 6 Plus (9.2) [8CE01986-FFE8-4846-8211-C8E8592809C8]
iPhone 6s (9.2) [2E009623-C9A1-416B-AA0B-B485D28EAADB]
iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [5B4AF3C5-C7FD-4B75-9E4E-D8A4D6139079]
iPhone 6s Plus (9.2) [0EF2144D-170A-4B02-9307-3AF480C75E5D]
iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [01D025ED-F760-4D9E-B077-6314E716F6AB]
iPhone 6s Plus Emna (9.2) [166C160E-60C3-4C10-B027-B329E2CADB5E]
iPhone 6s Plus Emna (9.2) + Apple Watch - 42mm (2.1) [D5A1EFCC-0C47-49B1-B4FA-9DFAB01E4006]
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631 com.quodfinancial.KMEFIC -e UIASCRIPT “/Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.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] Instruments Usage Error : Unknown device specified: “439e45f9204ec04d4ece3fe9226f5aa6ad22f631”

info: [debug] [INST] Known Devices:
Emna’s Mac [564D35A4-EA26-E570-FA05-D6A4FF08D37B]
Apple TV 1080p (9.1) [62F4D332-6CB4-4EF0-8347-2057F3EEC26F]
iPad 2 (9.2) [94BCA4EE-2196-41F8-B435-2C972CA23C9B]
iPad Air (9.2) [49882BB2-C0B0-4FEE-AB35-3FD6BB66A974]
iPad Air 2 (9.2) [5A5FE928-1001-4A7F-B4DC-78F3A3E792F5]
iPad Pro (9.2) [2919A8CF-8E87-4EEF-A88A-86788EC27211]
iPad Retina (9.2) [C960124F-AF8C-4B21-8D54-133070C67F11]
iPhone 4s (9.2) [1CB80404-F9E9-49B1-B960-192CCB5DCB99]
iPhone 5 (9.2) [6BA49494-82ED-4D79-BB8F-B432B8BDF606]
iPhone 5s (9.2) [E156FEF3-FB30-4806-AE96-FF16E064008F]
iPhone 6 (9.2) [887240FC-3A01-437C-A57C-4C4B208F6149]
iPhone 6 Plus (9.2) [8CE01986-FFE8-4846-8211-C8E8592809C8]
iPhone 6s (9.2) [2E009623-C9A1-416B-AA0B-B485D28EAADB]
iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [5B4AF3C5-C7FD-4B75-9E4E-D8A4D6139079]
iPhone 6s Plus (9.2) [0EF2144D-170A-4B02-9307-3AF480C75E5D]
iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [01D025ED-F760-4D9E-B077-6314E716F6AB]
iPhone 6s Plus Emna (9.2) [166C160E-60C3-4C10-B027-B329E2CADB5E]
iPhone 6s Plus Emna (9.2) + Apple Watch - 42mm (2.1) [D5A1EFCC-0C47-49B1-B4FA-9DFAB01E4006]
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631 com.quodfinancial.KMEFIC -e UIASCRIPT “/Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.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] 2016-01-18 03:38:40.981 instruments[4043:72442] Failed to start Instruments daemon on ‘Wafa iPhone (9.2)’ (The service is invalid.)

info: [debug] [INST STDERR] Instruments Usage Error : Specified target process is invalid: com.quodfinancial.KMEFIC
instruments, version 7.2 (59503)
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631
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 439e45f9204ec04d4ece3fe9226f5aa6ad22f631 com.quodfinancial.KMEFIC -e UIASCRIPT “/Users/Emna/Library/Application Support/appium/bootstrap/bootstrap-5923cadea0343e3f.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] Instruments Usage Error : Unknown device specified: “439e45f9204ec04d4ece3fe9226f5aa6ad22f631”
info: [debug] [INST] Known Devices:
Emna’s Mac [564D35A4-EA26-E570-FA05-D6A4FF08D37B]
Apple TV 1080p (9.1) [62F4D332-6CB4-4EF0-8347-2057F3EEC26F]
iPad 2 (9.2) [94BCA4EE-2196-41F8-B435-2C972CA23C9B]
iPad Air (9.2) [49882BB2-C0B0-4FEE-AB35-3FD6BB66A974]
iPad Air 2 (9.2) [5A5FE928-1001-4A7F-B4DC-78F3A3E792F5]
iPad Pro (9.2) [2919A8CF-8E87-4EEF-A88A-86788EC27211]
iPad Retina (9.2) [C960124F-AF8C-4B21-8D54-133070C67F11]
iPhone 4s (9.2) [1CB80404-F9E9-49B1-B960-192CCB5DCB99]
iPhone 5 (9.2) [6BA49494-82ED-4D79-BB8F-B432B8BDF606]
iPhone 5s (9.2) [E156FEF3-FB30-4806-AE96-FF16E064008F]
iPhone 6 (9.2) [887240FC-3A01-437C-A57C-4C4B208F6149]
iPhone 6 Plus (9.2) [8CE01986-FFE8-4846-8211-C8E8592809C8]
iPhone 6s (9.2) [2E009623-C9A1-416B-AA0B-B485D28EAADB]
iPhone 6s (9.2) + Apple Watch - 38mm (2.1) [5B4AF3C5-C7FD-4B75-9E4E-D8A4D6139079]
iPhone 6s Plus (9.2) [0EF2144D-170A-4B02-9307-3AF480C75E5D]
iPhone 6s Plus (9.2) + Apple Watch - 42mm (2.1) [01D025ED-F760-4D9E-B077-6314E716F6AB]
iPhone 6s Plus Emna (9.2) [166C160E-60C3-4C10-B027-B329E2CADB5E]
iPhone 6s Plus Emna (9.2) + Apple Watch - 42mm (2.1) [D5A1EFCC-0C47-49B1-B4FA-9DFAB01E4006]

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
info: [debug] Killall iOS Simulator

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

Just to understand the situation better:

  1. Have you ever successfully pre-launched an .iOS application before?
  2. From the screen shot’s i am assuming that you have built the application locally on your machine. If that correct make sure that you are pointing to the debug version of the application. If you are trying to pre launch the application in simulator then select the *.app file other wise *.ipa file.
  3. Make sure that you have enabled UIAutomation from settings(in case of real device).

Thanks for your help, sorry if i’m beginner with those tools

  1. From appium i have never pre-lauch an ios application. This is my first try with IOS. in Android it works fine with Appium.
  2. Yes the developer provide me a build with developer version (it’s a local app)
  3. I didn’t enable UIAutomation in real device, but in both real & simulator it isn’t working

So, if ur app is debug with same provisioning profile as yours and ur UIAutomation enabled must be in place then and only then u can run.

@Priyank_Shah Now this error is maintained : Instruments crashed on startup.
When i create an new project with xcode then i generate .app file it is working fine i can see the inspector and record my test cases.
But my problem when i use an application already developped and the build is coming from a developer profile i can’t open inspector and instruments crashed on startup.