Cannot open app on Real Device from Appium 1.3.1

Please see logs
info: Welcome to Appium v1.3.1 (REV 1160ce02bb89c354cb99317985123acf39f0e7d3)

info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {“defaultDevice”:true,“showSimulatorLog”:true,“defaultCommandTimeout”:7200}
warn: Deprecated server args: {"–show-sim-log":“use instead: --show-ios-log”}
info: Console LogLevel: debug

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

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

info: <-- GET /wd/hub/status 200 5.754 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}

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

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

info: <-- GET /wd/hub/status 200 1.626 ms - 104 {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”}}}

info: --> POST /wd/hub/session {“desiredCapabilities”:{“platformVersion”:“7.1”,“platformName”:“iOS”,“deviceName”:“TestCigniti”,“bundleId”:“com.facebook.Facebook”,“udid”:“4940187a2bf0292f08a6b6f2086891409968e516”}}

info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)

info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 0fade909-3b2d-4c7b-ad51-b353ff3638b2
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.1

info: [debug] Not checking whether simulator is available since we’re on a real device
info: [debug] Detecting automation tracetemplate
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Localizable.strings is not currently supported when using real devices.
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/sujittarun/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}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!

info: [debug] Dynamic bootstrap path: /Users/sujittarun/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js
info: [debug] Reusing dynamic bootstrap: /Users/sujittarun/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js
info: [debug] Getting device string from opts: {“forceIphone”:false,“forceIpad”:false,“xcodeVersion”:“6.1”,“iOSSDKVersion”:“8.1”,“deviceName”:“TestCigniti”,“platformVersion”:“7.1”}
info: [debug] fixDevice is on
info: [debug] Final device string is: ‘TestCigniti (7.1 Simulator)’
info: [debug] Not setting device type since we’re on a real device
info: [debug] Checking whether we need to set app preferences
info: [debug] Not setting iOS and app preferences since we’re on a real device
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] On a real device; cannot clean device state
info: [debug] Not setting locale because we’re using a real device
info: [debug] No iOS / app preferences to set
info: [debug] Starting iOS device log capture via deviceconsole

info: [debug] Not pre-launching simulator

info: [debug] Creating iDevice object with udid 4940187a2bf0292f08a6b6f2086891409968e516
info: [debug] Couldn’t find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/build/libimobiledevice-macosx/ideviceinstaller
info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 4940187a2bf0292f08a6b6f2086891409968e516 --bundle com.facebook.Facebook

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 4940187a2bf0292f08a6b6f2086891409968e516
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 4940187a2bf0292f08a6b6f2086891409968e516 com.facebook.Facebook -e UIASCRIPT “/Users/sujittarun/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

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: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”},“isShuttingDown”:false},“sessionId”:“0fade909-3b2d-4c7b-ad51-b353ff3638b2”}

info: <-- GET /wd/hub/status 200 1.405 ms - 178 {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”},“isShuttingDown”:false},“sessionId”:“0fade909-3b2d-4c7b-ad51-b353ff3638b2”}

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

info: [debug] Responding to client with success: {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”},“isShuttingDown”:false},“sessionId”:“0fade909-3b2d-4c7b-ad51-b353ff3638b2”}
info: <-- GET /wd/hub/status 200 0.970 ms - 178 {“status”:0,“value”:{“build”:{“version”:“1.3.1”,“revision”:“1160ce02bb89c354cb99317985123acf39f0e7d3”},“isShuttingDown”:false},“sessionId”:“0fade909-3b2d-4c7b-ad51-b353ff3638b2”}

info: Launching instruments

info: [debug] Attempting to run app on real device with UDID 4940187a2bf0292f08a6b6f2086891409968e516
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 4940187a2bf0292f08a6b6f2086891409968e516 com.facebook.Facebook -e UIASCRIPT “/Users/sujittarun/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:25 TestCigniti DTMobileIS[325] : Could not create service named com.apple.instruments.server.services.launchdaemon

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:25 TestCigniti DTMobileIS[325] : Could not create service named com.apple.instruments.server.services.device.xpccontrol

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:25 TestCigniti DTMobileIS[325] : Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
info: [IOS_SYSLOG_ROW ] Oct 26 22:04:25 TestCigniti DTMobileIS[325] : Could not create service named com.apple.instruments.server.services.device.applictionListing

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 real device with UDID 4940187a2bf0292f08a6b6f2086891409968e516

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 4940187a2bf0292f08a6b6f2086891409968e516 com.facebook.Facebook -e UIASCRIPT “/Users/sujittarun/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:31 TestCigniti DTMobileIS[326] : Could not create service named com.apple.instruments.server.services.launchdaemon

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:31 TestCigniti DTMobileIS[326] : Could not create service named com.apple.instruments.server.services.device.xpccontrol

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:31 TestCigniti DTMobileIS[326] : Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
info: [IOS_SYSLOG_ROW ] Oct 26 22:04:31 TestCigniti DTMobileIS[326] : Could not create service named com.apple.instruments.server.services.device.applictionListing

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 real device with UDID 4940187a2bf0292f08a6b6f2086891409968e516

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 4940187a2bf0292f08a6b6f2086891409968e516 com.facebook.Facebook -e UIASCRIPT “/Users/sujittarun/Library/Application Support/appium/bootstrap/bootstrap-60f23230385b0cfa.js” -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {“global”:90000}

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:37 TestCigniti DTMobileIS[327] : Could not create service named com.apple.instruments.server.services.launchdaemon

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:37 TestCigniti DTMobileIS[327] : Could not create service named com.apple.instruments.server.services.device.xpccontrol

info: [IOS_SYSLOG_ROW ] Oct 26 22:04:37 TestCigniti DTMobileIS[327] : Could not create service named com.apple.instruments.server.services.processcontrol.posixspawn
info: [IOS_SYSLOG_ROW ] Oct 26 22:04:37 TestCigniti DTMobileIS[327] : Could not create service named com.apple.instruments.server.services.device.applictionListing

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] Killall iOS Simulator
info: [debug] Killing any other simulator daemons
info: [debug] On a real device; cannot clean device state
info: [debug] Cleaning up appium session

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

info: [debug] Error: Instruments crashed on startup
at Instruments.onInstrumentsExit (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:387:31)
at null. (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:810: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 19893.456 ms - 182

@jonahss Can you please see this and let me know what is wrong here. Thanks

Hmm not sure. What version of xcode are you using?

maybe @isaac can help?

I am using xcode 6.1 and upgraded it to support ios8.1 yesterday.

My first thought is that this is some weird way of reporting an app it isn’t authorized to automate. Is this a developer build of the app (“com.facebook.Facebook”)?

I had a similar issue myself, perhaps you have already tried this, but on iOS 8 you need to enable the UI Automation on the real device, to do this go to:

Settings > Developer > Enable UI Automation

1 Like

I still can not open app on Real device and I do have Developer – UI Automation Enabled. If I set my appium setting for Full Reset. The application will remove if it exists…then install. So appium is interacting with my iphone device. But the app still will not launch. Here are my details.

Thanks in advance

am trying to do a simple launch application on a real device to no avail. My settings are as follows: iphone 6, iOS 8.0, Mac OSX 10.9.5, Xcode 6.1, Appium 1.3.1 (I have also tried running from the node appium 1.3.3 (same error)). Appium settings - I have tried running from 127.0.0.1/4723 and 0.0.0.0/4723. any assistance would be greatly appreciated. Have tried numerous troubleshooting tips from online…including clearing the Device console in Xcode…clearing cache using node command. adding permissions…

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 3bf6e2888395e77e8d74e3c89140326670afaf3e 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 3bf6e2888395e77e8d74e3c89140326670afaf3e com.safenetinc.mpbasic -e UIASCRIPT “/Users/user/Library/Application Support/appium/bootstrap/bootstrap-9280a4dc9be20ec9.js” -e UIARESULTSPATH /tmp/appium-instruments info: [debug] And extra without-delay env: {} info: [debug] And launch timeouts (in ms): {“global”:90000}

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

Eclipse code: DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “iPhone”);
capabilities.setCapability(“platformName”, “ios”);
capabilities.setCapability(“udid”, “3##########”);
capabilities.setCapability(“bundleId”, “com.ssssss.mptest”);
capabilities.setCapability(“ipa”, “/Users/user/Desktop/Mptest.ipa”);

try
{
System.out.println(“before app is launched”);
driver = new RemoteWebDriver(new URL(“http://0.0.0.0:4723/wd/hub”), capabilities);

System.out.println("connected1");

}
catch (MalformedURLException e)
{
e.printStackTrace();
System.out.println(e.getMessage());
}