Instruments Trace Error : Target failed to run: Failed looking up pid of launched process

Instruments Trace Error : Target failed to run: Failed looking up pid of launched process
Can someone help me solve this issue. I keep on receiving this error when trying to install an app with Appium. I have seen many other people post the same issue but I have not been able to find the solution to this issue.

I am facing exactly the same problem here. It works with the sample Application but with our own debug build, it gives error. Any one knows anything?

Here is the console log:

=========================================
info: --> POST /wd/hub/session {“desiredCapabilities”:{“browserName”:"",“appium-version”:“1.3.6”,“platformName”:“iOS”,“platformVersion”:“8.2”,“deviceName”:“iPhone Simulator”,“app”:"/Users/admin/Documents/git/mobile-test-framework/assets/UScan.app.zip"}}
info: Client User-Agent string: undefined
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appium-version
info: [debug] Using local .zip from desired caps: /Users/admin/Documents/git/mobile-test-framework/assets/UScan.app.zip
info: [debug] Copying local zip to tmp dir
info: [debug] /Users/admin/Documents/git/mobile-test-framework/assets/UScan.app.zip copied to /var/folders/19/lw1schm90x59y30bqptr6p3w0000gn/T/115224-33522-1dtt8vn/appium-app.zip
info: [debug] Unzipping /var/folders/19/lw1schm90x59y30bqptr6p3w0000gn/T/115224-33522-1dtt8vn/appium-app.zip
info: [debug] Testing zip archive: /var/folders/19/lw1schm90x59y30bqptr6p3w0000gn/T/115224-33522-1dtt8vn/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/19/lw1schm90x59y30bqptr6p3w0000gn/T/115224-33522-1dtt8vn/U Scan.app
info: [debug] Creating new appium session 691ee450-e2e7-455f-af18-57bb9e2ba005
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.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”:“6.2”,“iOSSDKVersion”:“8.2”,“deviceName”:“iPhone Simulator”,“platformVersion”:“8.2”}
info: [debug] fixDevice is on
info: [debug] Fixing device. Changed from: “iPhone Simulator (8.2 Simulator)” to: “iPhone 6 (8.2 Simulator)”
info: [debug] Final device string is: ‘iPhone 6 (8.2 Simulator)’
info: [debug] iOS sim UDID is 69E1DEE2-F4E3-49C5-8188-F110E6987330
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /var/folders/19/lw1schm90x59y30bqptr6p3w0000gn/T/115224-33522-1dtt8vn/U Scan.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/19/lw1schm90x59y30bqptr6p3w0000gn/T/115224-33522-1dtt8vn/U Scan.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: On some xcode 6 platforms, instruments-without-delay does not work. If you experience this, you will need to re-run appium with the --native-instruments-lib flag
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/admin/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {“nodePath”:"/usr/local/Cellar/node/0.10.30/bin/node",“commandProxyClientPath”:"/usr/local/lib/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”:“oneByOne”}
…o: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
info: [debug] Dynamic bootstrap path: /Users/admin/Library/Application Support/appium/bootstrap/bootstrap-97a5011e7dafd30d.js
info: [debug] Reusing dynamic bootstrap: /Users/admin/Library/Application Support/appium/bootstrap/bootstrap-97a5011e7dafd30d.js
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.2”,“iOSSDKVersion”:“8.2”,“deviceName”:“iPhone Simulator”,“platformVersion”:“8.2”}
info: [debug] fixDevice is on
info: [debug] Fixing device. Changed from: “iPhone Simulator (8.2 Simulator)” to: “iPhone 6 (8.2 Simulator)”
info: [debug] Final device string is: ‘iPhone 6 (8.2 Simulator)’
info: [debug] We’re on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.2”,“iOSSDKVersion”:“8.2”,“deviceName”:“iPhone Simulator”,“platformVersion”:“8.2”}
info: [debug] fixDevice is on
info: [debug] Fixing device. Changed from: “iPhone Simulator (8.2 Simulator)” to: “iPhone 6 (8.2 Simulator)”
info: [debug] Final device string is: ‘iPhone 6 (8.2 Simulator)’
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] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] Cleaning sim data files
info: Executing: xcrun simctl erase 69E1DEE2-F4E3-49C5-8188-F110E6987330 with timeout 2000
info: [debug] Cleaning app data files
warn: Applications directory /Users/admin/Library/Developer/CoreSimulator/Devices/69E1DEE2-F4E3-49C5-8188-F110E6987330/data/Containers/Data/Application doesn’t exist. Have you run this simulator before?
warn: Applications directory /Users/admin/Library/Developer/CoreSimulator/Devices/69E1DEE2-F4E3-49C5-8188-F110E6987330/data/Containers/Bundle/Application doesn’t exist. Have you run this simulator before?
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] No device id or app, not installing to real device.
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.2 Simulator)
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.2 Simulator)” “/var/folders/19/lw1schm90x59y30bqptr6p3w0000gn/T/115224-33522-1dtt8vn/U Scan.app” -e UIASCRIPT “/Users/admin/Library/Application Support/appium/bootstrap/bootstrap-97a5011e7dafd30d.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {“DYLD_INSERT_LIBRARIES”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib",“LIB_PATH”:"/usr/local/lib/node_modules/appium/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {“global”:90000}
info: [debug] [INST] Waiting for device to boot…
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

=========================================

1 Like

I found the problem. The issue is I am using a signed debug build. If I create a debug .ipa file without signing. Then it works.

1 Like

I kept getting this error as long as I tried specifying the location of my .ipa using --app argument. Specifying location of .ipa worked on a real device but not on a simulator. I got the simulator working by specifying the location of .app instead.

The location of .app is:
/Users/{user}/Library/Developer/Xcode/DerivedData/{appname-somehash}/Build/Products/Debug-iphonesimulator/{app-name}.app

Hi Everyone,

As I’m new to Appium on IOS, I couldn’t find the issue

I’m facing this issue.
–> I have given the app path as .app file on simulator----Still fails
—> I have used .ipa file on real device— Still fails.

Every time the app opens and crashes on startup.

{code}
[INST STDERR] 2016-03-29 15:58:51.215 instruments[2825:122645] Attempting to change event horizon while disengage
2016-03-29 15:58:51.216 instruments[2825:125164] 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
{code}

Could anyone help me with this please ?

Thanks in advance.

@Karthik, I tired using the .app extracted form the same ipa inside the payload folder and it still crashes on startup. Can someone help with this please? I am trying this on a simulator.

info: Launching instruments

info: [debug] Attempting to run app on iPad Air 2 (9.3)
info: On xcode 7.0, instruments-without-delay does not work, skippinginstruments-without-delay
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 “iPad Air 2 (9.3)” /Users/test/Documents/iOS/Builds/5.2/Appium/Test.app -e UIASCRIPT “/Users/test/Library/Application Support/appium/bootstrap/bootstrap-ad3d2b722f2b43eb.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And launch timeouts (in ms): {“global”:90000}

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

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.4.16”,“revision”:“ae6877eff263066b26328d457bd285c0cc62430d”},“isShuttingDown”:false},“sessionId”:“40c8d9d6-1383-4e4d-a25e-294f60ea3a26”}
info: <-- GET /wd/hub/status 200 1.975 ms - 179 {“status”:0,“value”:{“build”:{“version”:“1.4.16”,“revision”:“ae6877eff263066b26328d457bd285c0cc62430d”},“isShuttingDown”:false},“sessionId”:“40c8d9d6-1383-4e4d-a25e-294f60ea3a26”}

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.test.application’

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 Simulator