Appium iOS real device - issue with ideviceinstaller - appium

I am running the appium test script on iOS real device., where I am getting the ideviceinstaller error.
I have installed ideviceinstaller manually using "brew install --HEAD ideviceinstaller" still getting the same error.
error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l dyld: Library not loaded: /usr/local/lib/libplist.3.dylib Referenced from: /usr/local/bin/ideviceinstaller Reason: image not found
Please check the below logs.Using xcode 6.1.1 and iOS 8.1.
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"8.1.1","app":"/Users/rajesh.madaswamy/FlydotREZ.ipa","deviceName":"iPhone","platformName":"iOS","fullReset":true,"browserName":"","bundleId":"com.accenture.ams.dev.london.Voyage-Air","udid":"0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9"}}
info: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)
info: [debug] Using local .ipa from desired caps: /Users/rajesh.madaswamy/FlydotREZ.ipa
info: [debug] Copying local zip to tmp dir
info: [debug] /Users/rajesh.madaswamy/FlydotREZ.ipa copied to /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/appium-app.zip
info: [debug] Unzipping /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/appium-app.zip
info: [debug] Testing zip archive: /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/bc/7qkw5sfd221dbcm_fg2fp0g9dhyybh/T/115224-74086-ga247s/Payload/Fly dotREZ.app
info: [debug] Creating new appium session 153304f6-3daf-4ee3-b72c-3f181d3a8ffa
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] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
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/rajesh.madaswamy/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/Cellar/node/0.12.0_1/bin/node","commandProxyClientPath":"/Users/rajesh.madaswamy/.npm-packages/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":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. D...ot manually modify!
info: [debug] Dynamic bootstrap path: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-4f4c08d246c5f17c.js
info: [debug] Reusing dynamic bootstrap: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-4f4c08d246c5f17c.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone","platformVersion":"8.1.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone (8.1.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 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9
info: [debug] Checking app install status using: /Users/rajesh.madaswamy/.npm-packages/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 --bundle com.accenture.ams.dev.london.Voyage-Air
info: [debug] App is installed.
info: [debug] fullReset requested. Forcing app install.
info: [debug] Installing ipa found at /Users/rajesh.madaswamy/FlydotREZ.ipa
info: [debug] Creating iDevice object with udid 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l
dyld: Library not loaded: /usr/local/lib/libplist.3.dylib
Referenced from: /usr/local/bin/ideviceinstaller
Reason: image not found
info: [debug] Error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l
dyld: Library not loaded: /usr/local/lib/libplist.3.dylib
Referenced from: /usr/local/bin/ideviceinstaller
Reason: image not found
at ChildProcess.exithandler (child_process.js:744:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Socket.<anonymous> (child_process.js:1176:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:476:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l \ndyld: Library not loaded: /usr/local/lib/libplist.3.dylib\n Referenced from: /usr/local/bin/ideviceinstaller\n Reason: image not found\n)","killed":false,"code":null,"signal":"SIGTRAP","cmd":"/bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l ","origValue":"Command failed: /bin/sh -c ideviceinstaller -u 0e0615c84ad9c68c7b0f42d2651541c3f38fd4b9 -l \ndyld: Library not loaded: /usr/local/lib/libplist.3.dylib\n Referenced from: /usr/local/bin/ideviceinstaller\n Reason: image not found\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 2042.905 ms - 714

I was getting this error after installing the Appium Inspector. What ultimately fixed it for me was what you have already tried, specifically installing ideviceinstaller manually.
Until I figured that out, I just put 'libplist.3.dylib' on my path so it would be found. It felt like a hack, but it worked.

to install ideviceistaller
Install the App
Press Command+F and type Terminal and press enter/return key.
Run in Terminal app:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
and press enter/return key. Wait for the command to finish.
Run:
brew install ideviceinstaller

Related

Appium inspector not open getting instruments crash on startup [duplicate]

I am doing iOS automation on real device. But i got stuck with the error "Failed to start an Appium session, err was: Error: Instruments crashed on startup". logs are below. Please help to resolve this error. Thanks in advance.
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/rajesh.madaswamy/Desktop/PlainNote/code/sencha/cordova/platforms/ios/build/emulator/Fly_dotREZ.ipa","platformVersion":"7.1.2","platformName":"iOS","deviceName":"iPhone 5S","bundleId":"com.accenture.london.Voyage-Air","udid":"5f5e07c61ae3ad4f755801bd6336d21d90927095"}}
info: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)
info: [debug] Using local .ipa from desired caps: /Users/rajesh.madaswamy/Desktop/PlainNote/code/sencha/cordova/platforms/ios/build/emulator/Fly_dotREZ.ipa
info: [debug] Copying local zip to tmp dir
info: [debug] /Users/rajesh.madaswamy/Desktop/PlainNote/code/sencha/cordova/platforms/ios/build/emulator/Fly_dotREZ.ipa copied to /var/folders/mt/7w1_nx811y9cyx1778lqs_700000gq/T/115210-67883-1h28vtl/appium-app.zip
info: [debug] Unzipping /var/folders/mt/7w1_nx811y9cyx1778lqs_700000gq/T/115210-67883-1h28vtl/appium-app.zip
info: [debug] Testing zip archive: /var/folders/mt/7w1_nx811y9cyx1778lqs_700000gq/T/115210-67883-1h28vtl/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/mt/7w1_nx811y9cyx1778lqs_700000gq/T/115210-67883-1h28vtl/Payload/Fly dotREZ.app
info: [debug] Creating new appium session 709e3337-b330-4549-b6d0-eb10722cc83b
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 7.0
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] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
info: [debug] Creating instruments
info: [debug] Preparing uiauto bootstrap
info: [debug] Dynamic bootstrap dir: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/bin/node","commandProxyClientPath":"/Users/rajesh.madaswamy/.npm-packages/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":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. D...ot manually modify!
info: [debug] Dynamic bootstrap path: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-b98646d39f6b505e.js
info: [debug] Reusing dynamic bootstrap: /Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-b98646d39f6b505e.js
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 iPhoneSimulator
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 5f5e07c61ae3ad4f755801bd6336d21d90927095
info: [debug] Checking app install status using: /Users/rajesh.madaswamy/.npm-packages/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 5f5e07c61ae3ad4f755801bd6336d21d90927095 --bundle com.accenture.london.Voyage-Air
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 5f5e07c61ae3ad4f755801bd6336d21d90927095
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.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5f5e07c61ae3ad4f755801bd6336d21d90927095 com.accenture.london.Voyage-Air -e UIASCRIPT "/Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-b98646d39f6b505e.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-03-10 17:30:06.747 instruments[67920:707] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] 2015-03-10 17:30:06.862 instruments[67920:2203] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] Instruments Trace Error : Failed to start trace.
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 iPhoneSimulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 5f5e07c61ae3ad4f755801bd6336d21d90927095
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.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5f5e07c61ae3ad4f755801bd6336d21d90927095 com.accenture.london.Voyage-Air -e UIASCRIPT "/Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-b98646d39f6b505e.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-03-10 17:30:13.444 instruments[67923:707] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] 2015-03-10 17:30:13.555 instruments[67923:2003] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] Instruments Trace Error : Failed to start trace.
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 iPhoneSimulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 5f5e07c61ae3ad4f755801bd6336d21d90927095
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.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5f5e07c61ae3ad4f755801bd6336d21d90927095 com.accenture.london.Voyage-Air -e UIASCRIPT "/Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-b98646d39f6b505e.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-03-10 17:30:20.152 instruments[67927:707] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] 2015-03-10 17:30:20.253 instruments[67927:3f03] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] Instruments Trace Error : Failed to start trace.
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 iPhoneSimulator
info: Launching instruments
info: [debug] Attempting to run app on real device with UDID 5f5e07c61ae3ad4f755801bd6336d21d90927095
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.bundle/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w 5f5e07c61ae3ad4f755801bd6336d21d90927095 com.accenture.london.Voyage-Air -e UIASCRIPT "/Users/rajesh.madaswamy/Library/Application Support/appium/bootstrap/bootstrap-b98646d39f6b505e.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-03-10 17:30:26.840 instruments[67930:707] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] 2015-03-10 17:30:26.952 instruments[67930:3827] Failed to start Instruments daemon for 'iOS' on 'jitendra.k.dash’s iPhone (v7.1.2)' (The service is invalid.)
info: [debug] [INST STDERR] Instruments Trace Error : Failed to start trace.
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 iPhoneSimulator
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 (/Users/rajesh.madaswamy/.npm-packages/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:389:31)
at null.<anonymous> (/Users/rajesh.madaswamy/.npm-packages/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:308:12)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1067: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 24889.612 ms - 182
The problem was that I did not have the appium instruments node package installed. Once I installed it the crash went away. Check that you have the appium-instruments node package installed:
npm install appium-instruments
Few things to keep in mind while running in real device:
1)No simulator should be opened.
2)Make sure the .app file which you are using is build for real device(take the help of developer to find it out)
3)Pass correct udid and bundle id.
4)If you are getting error like app installed failed or something like that then try to do pass app path from appium gui and other parameters from your code i.e. device name , platform capabilities; trying these different combinations do help sometimes.

How to Run Appium on ios Simulator 8.x/7.x

I am trying to do the automation using Appium on ios simulators.
My config is:
OS version: 10.10.x
Appium: 1.4.0
Xcode: 6.3.2
and caps for appium is:
automationName = "Appium"
platformName = "iOS"
platformVersion = "8.3"
deviceName = "iPhone 5s"
app = "/Users/skaram200/Desktop/ios_build/XfinityMyAccount_6.3.app"
When I run the appium it is giving me an error:
info: [debug] Attempting to run app on iPhone 5s (8.3 Simulator)
info: [debug] Spawning instruments with command: /Applications/xcode6.3/Xcode6.3.2.app/Contents/Developer/usr/bin/instruments -t /Applications/xcode6.3/Xcode6.3.2.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /tmp/appium-instruments/instrumentscli0.trace -w "iPhone 5s (8.3 Simulator)" /Users/skaram200/Desktop/ios_build/XfinityMyAccount_6.3.app -e UIASCRIPT "/Users/skaram200/Library/Application Support/appium/bootstrap/bootstrap-4d92d75355d74eeb.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {"DYLD_INSERT_LIBRARIES":"/Users/skaram200/Documents/workspace/appium_1/node_modules/appium-instruments/thirdparty/iwd6/InstrumentsShim.dylib","LIB_PATH":"/Users/skaram200/Documents/workspace/appium_1/node_modules/appium-instruments/thirdparty/iwd6"}
info: [debug] And launch timeouts (in ms): {"global":90000}
info: [debug] [INST STDERR] 2015-09-10 10:47:20.672 instruments[36855:1272282] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST] Waiting for device to boot...
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Unable to install app with path: /Users/skaram200/Desktop/ios_build/XfinityMyAccount_6.3.app: "(null)"
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] Killing any other simulator daemons
info: [debug] Killall iOS Simulator
info: [debug] Cleaning sim data files
info: Executing: xcrun simctl erase F54870E7-17FD-4A07-B6EE-1636F6AB5757 with timeout 2000
info: Executing: xcrun simctl erase F54870E7-17FD-4A07-B6EE-1636F6AB5757 with timeout 2000
info: [debug] Cleaning app data files
warn: Applications directory /Users/skaram200/Library/Developer/CoreSimulator/Devices/F54870E7-17FD-4A07-B6EE-1636F6AB5757/data/Applications doesn't exist. Have you run this simulator before?
info: Couldn't find app directories to delete. Probably it's not installed
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 [object Object].Instruments.onInstrumentsExit (/Users/skaram200/Documents/workspace/appium_1/node_modules/appium-instruments/lib/instruments.js:440:31)
at [object Object].<anonymous> (/Users/skaram200/Documents/workspace/appium_1/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}
```
Please let me know, how can I resolve these errors and start automating on ios simulators using appium.
Here you need to pass the --default-device or -dd as true for simulators and need to specify the --bundleID of the app. And we need to have debug .ipa or .app file to do automation.
Creating a successfull Build without an error.
I'm using Cordova, got some issues with that as well, this is what Idid in order to generate the .app:
cordova build ios --emulator
That's it, after that I was able to use Appium and push the .app to the simulator.
I hope it helps somebody else!

Could not pre-launch appium and app doesn't get installed in iphone real device using appium

I am using appium version 1.3.7.
I have connected physical device via usb.
I have launched appium server,after a while appium get crashed.
I have pasted that full log below.
I have attached the screen shot below.
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --pre-launch --platform-version "8.1" --platform-name "iOS" --app "/Users/al/work/sample.app" --udid "f5de3fd5ccded92e40e86c652ce2a6f9414fe1a0" --device-name "iPhone 4s"
info: [debug] Starting Appium in pre-launch mode
info: Pre-launching app
info: [debug] Using local app from command line: /Users//al/work/sample.app
info: [debug] Creating new appium session 1cdc5dc0-36d2-40b9-922b-33601f28846b
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] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
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/alk/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/alk/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Reusing dynamic bootstrap: /Users/alk/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone 4s","platformVersion":"8.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 4s (8.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 f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2
info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle com.vr.iphone.sample
info: [debug] App is not installed. Will try to install the app.
info: [debug] Installing app using cmd: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle "/Users/al/work/sample.app
info: [debug] Cleaning up appium session
error: Could not pre-launch appium: Error: Unable to install [/Users/al/work/sample.app] to device with id [f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2]. Error [Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id f5de3fd5ccded92e40e86c652ce2a6f9414ee1a2 --bundle "/Users/al/work/sample.app"
Assertion failed: (AMDeviceStartService(device, CFSTR("com.apple.afc"), &afcFd, NULL) == 0), function handle_device, file fruitstrap.c, line 523.
]
You can use Appium to install your app on your device, Just uninstall your App manually and in setUp code use absolute path of .apk file like this:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("VERSION", "5.1.1");
capabilities.setCapability("deviceName", "Name");
File appDir = new File("/home/filename/ProjectFile");
File app = new File(appDir, "appname.apk");
capabilities.setCapability("app",app.getAbsolutePath());
It will install your app on your device.
You said you tried to launch on real device, but your logs saying you tried to launch on simulator.
If you are using UI version of appium, Please uncheck Force Device option in appium and give UDID of real device which you connected in appium and prelaunch. your app will be installed.

How to address Could not set the device type in Info.plist issue in appium, while launching the ios simulator?

I have installed appium version 1.3.6.
I have launched appium server to inspect an ios app.
I have furnished the error below.
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node'; lib/server/main.js --command-timeout "7200" --pre-launch --log "/tmp/appium.log" --platform-version "8.1" --platform-name "iOS" --app "com.iphonewidget.iphone.testapp" --show-ios-log --device-name "iPhone 6"
info: [debug] Starting Appium in pre-launch mode
info: Pre-launching app
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 255637cf-2d12-41c3-8610-e53f804d229b
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] 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.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone 6","platformVersion":"8.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6 (8.1 Simulator)'
info: [debug] iOS sim UDID is 4391D23F-BA21-4FB8-8887-0972D2911420
info: [debug] Detecting automation tracetemplate
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.iphonewidget.iphone.testapp/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.iphonewidget.iphone.testapp/en.lproj/Localizable.strings
warn: Could not parse app Localizable.strings assuming it doesn´t exist
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/alk/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":"oneByOne"
}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
...
error: Could not set the device type in Info.plist
Unchecking "Prelaunch Application" under General Settings resolved this issue for me.

Not able to automate iOS Hybrid mobile app using protractor

I am trying to automate an hybrid ios app using Appium and Protractor. I have installed appium 1.3.4 and xcode 6.1. While ruuning the protractor scripts displays error below. Kindly help. I have Enable UIAutomation from iPhone Developer option. Appium Logs ::
info: Welcome to Appium v1.3.4 (REV c8c79a85fbd6870cd6fc3d66d038a115ebe22efe)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"app":"/Users/qualcomm/Desktop/bhawani/AbbVieCareCH.app","ipa":"/Users/qualcomm/Desktop/bhawani/abbvieCH-dev-01.01.21050131.01.ipa","udid":"cbecb05c855c13d9b2e6b693999123268fc0b966"}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"browserName":"iOS","appium-version":"1.3.4","platformName":"iOS","platformVersion":8.1,"deviceName":"iPhone6","autoWebview":true,"count":1}}
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, count
info: [debug] Using local app from command line: /Users/qualcomm/Desktop/bhawani/AbbVieCareCH.app
info: [debug] Creating new appium session ca2a0eb0-f7cf-47f6-b960-93f447bb3010
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] Parsed app Info.plist (as binary)
info: [debug] Parsed app Localizable.strings
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/qualcomm/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/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,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. D...ot manually modify!
info: [debug] Dynamic bootstrap path: /Users/qualcomm/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.js
info: [debug] Reusing dynamic bootstrap: /Users/qualcomm/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.1.1","iOSSDKVersion":"8.1","deviceName":"iPhone6","platformVersion":8.1}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone6 (8.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 cbecb05c855c13d9b2e6b693999123268fc0b966
info: [debug] Checking app install status using: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id cbecb05c855c13d9b2e6b693999123268fc0b966 --bundle com.qcl.qualcomm.healthycircles.dev
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 cbecb05c855c13d9b2e6b693999123268fc0b966
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 cbecb05c855c13d9b2e6b693999123268fc0b966 -e UIASCRIPT "/Users/qualcomm/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.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-03-02 18:05:17.723 instruments[12882:123318] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier 'com...'
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: Launching instruments
info: [debug] Attempting to run app on real device with UDID cbecb05c855c13d9b2e6b693999123268fc0b966
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 cbecb05c855c13d9b2e6b693999123268fc0b966 -e UIASCRIPT "/Users/qualcomm/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.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-03-02 18:05:25.309 instruments[12885:123423] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier 'com...'
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 cbecb05c855c13d9b2e6b693999123268fc0b966
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 cbecb05c855c13d9b2e6b693999123268fc0b966 -e UIASCRIPT "/Users/qualcomm/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.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-03-02 18:05:31.499 instruments[12888:123447] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier 'com.qcl.qualcomm.healthycircles.dev'
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 cbecb05c855c13d9b2e6b693999123268fc0b966
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 cbecb05c855c13d9b2e6b693999123268fc0b966 -e UIASCRIPT "/Users/qualcomm/Library/Application Support/appium/bootstrap/bootstrap-d0f21a5b61bb08af.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-03-02 18:05:37.696 instruments[12891:123507] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 3.) : Failed to launch process with bundle identifier 'com...'
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 (/usr/local/lib/node_modules/appium/node_modules/appium-instruments/lib/instruments.js:387:31)
at null.<anonymous> (/usr/local/lib/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 25043.363 ms - 182
Thanks,

Resources