Getting error when launching iOS device in appium - appium

I have Xcode 8.2 version. I wrote the code in the eclipse and trying to run. I was able to install the ipa file but while trying to open the app, its not opening. Please find my code below -
package com.sampleiOS.com.sampleiOS;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
//import org.openqa.selenium.WebDriver;
//import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
/**
* Unit test for simple App.
*/
public class AppTest
{
//public WebDriver driver;
public AppiumDriver<MobileElement> driver;
/**
* #return
* #return
* #return the suite of tests being tested
* #throws MalformedURLException
* #throws InterruptedException
*/
#Test
public void Rijo() throws MalformedURLException, InterruptedException
{
AppiumDriverLocalService service = AppiumDriverLocalService
.buildService(new AppiumServiceBuilder()
.usingDriverExecutable(new File("/usr/local/opt/node/bin/node"))
.withAppiumJS(new File(
"/usr/local/lib/node_modules/appium/build/lib/main.js")));
//.withLogFile(new File("AppiumServerLogs/logs.txt")));
service.start();
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Ipod");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.3");
capabilities.setCapability(MobileCapabilityType.UDID, "4319165xxxxx");
capabilities.setCapability("app", "/Users/rijom/Downloads/xx.ipa");
capabilities.setCapability("automationName", "XCUITest");
driver = new IOSDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
Thread.sleep(5000);
}
}
Please find appium console log below -
[TestNG] Running:
/private/var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/testng-eclipse--1535528232/testng-customsuite.xml
[Appium] Welcome to Appium v1.6.0 (REV 0f37e2943bba265b42bb2087ea24b86dcc614c35)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.0"...
[HTTP] <-- GET /wd/hub/status 200 23 ms - 121
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/rijom/Downloads/RSSFeedReader.ipa","automationName":"XCUITest","udid":"43191654cb4d510f9f3e75a1577fef3bff459859","platformName":"iOS","deviceName":"Ipod","platformVersion":"9.3"}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/rijom/Downl...
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Users/rijom/Downloads/RSSFeedReader.ipa'
[Appium] automationName: 'XCUITest'
[Appium] udid: '43191654cb4d510f9f3e75a1577fef3bff459859'
[Appium] platformName: 'iOS'
[Appium] deviceName: 'Ipod'
[Appium] platformVersion: '9.3'
[debug] [XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Session created with session id: ed58e7cb-1b46-42ca-aacf-c5edc9289573
[debug] [XCUITest] Xcode version set to '8.2'
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [XCUITest] Available devices: 43191654cb4d510f9f3e75a1577fef3bff459859
[debug] [XCUITest] Creating iDevice object with udid 43191654cb4d510f9f3e75a1577fef3bff459859
[XCUITest] Determining device to run tests on: udid: '43191654cb4d510f9f3e75a1577fef3bff459859', real device: true
[BaseDriver] Using local app '/Users/rijom/Downloads/RSSFeedReader.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/Payload/RSSFeedReader.app'
[debug] [XCUITest] Checking whether app is actually present
[debug] [ios-app-utils] Getting bundle ID from app
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[XCUITest] Setting up real device
[debug] [XCUITest] Stdout from app isInstalled check: [....] Waiting for iOS device to be connected
[....] Using iPod Touch 5G 'Ipod' (43191654cb4d510f9f3e75a1577fef3bff459859).
true
[debug] [XCUITest] App is installed.
[debug] [XCUITest] Full reset not requested. No need to install.
[XCUITest] Using default agent: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj
[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Beginning test with command '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/bin/run-xcodebuild.sh --project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj --scheme WebDriverAgentRunner --destination id=43191654cb4d510f9f3e75a1577fef3bff459859' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/rijom/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/B8534D7A-50CD-4B8A-8AD6-382B80BC7B84/Session-WebDriverAgentRunner-2017-02-01_154328-QrQMw9.log
[debug] [WebDriverAgent] Device: Feb 1 15:43:53 Ipod XCTRunner[493] <Warning>: Running tests...
[debug] [WebDriverAgent] Device: Feb 1 15:43:55 Ipod XCTRunner[493] <Warning>: Continuing to run tests in the background with task ID 1
[debug] [WebDriverAgent] Device: Feb 1 15:43:56 Ipod XCTRunner[493] <Warning>: Built at Feb 1 2017 15:43:37
[XCUITest] Detected that WebDriverAgent is running at url 'http://192.168.2.112:8100'
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod XCTRunner[493] <Warning>: ServerURLHere->http://192.168.2.112:8100<-ServerURLHere
[XCUITest] WebDriverAgent started at url 'http://192.168.2.112:8100'
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod XCTRunner[493] <Warning>: Listening on USB
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod SpringBoard[48] <Warning>: HW kbd: Failed to set (null) as keyboard focus
[debug] [iProxy] bind(): Address already in use
[debug] [iProxy] Error creating socket: Address already in use
[XCUITest] Error: iproxy exited with code '208'
at SubProcess.<anonymous> (lib/webdriveragent.js:378:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
Error: iproxy exited with code '208'
at SubProcess.<anonymous> (lib/webdriveragent.js:378:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[debug] [XCUITest] Running ios real device reset flow
[debug] [XCUITest] Resetting simulator
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: iproxy exited with code '208'
at SubProcess.<anonymous> (lib/webdriveragent.js:378:25)
at emitTwo (events.js:106:13)
at SubProcess.emit (events.js:191:7)
at ChildProcess.<anonymous> (lib/teen_process.js:191:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[HTTP] <-- POST /wd/hub/session 500 71554 ms - 166
FAILED: Rijo
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: iproxy exited with code '208' (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 71.82 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Suvarnaratnas-Mac-mini.local', ip: '192.168.3.135', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.5', java.version: '1.8.0_45'
Driver info: io.appium.java_client.ios.IOSDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:36)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:114)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:132)
at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:77)
at com.sampleiOS.com.sampleiOS.AppTest.Rijo(AppTest.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================
===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================
[TestNG] Time taken by org.testng.reporters.EmailableReporter#6a5fc7f7: 85 ms
[TestNG] Time taken by org.testng.reporters.jq.Main#2d209079: 89 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter#2133c8f8: 14 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 4 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter#d041cf: 12 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter#7a79be86: 44 ms
I had updated the WebDriverAgentLib with my app Team and certificates also then its creating an new app as webDriverAgent but not opening my app. Could you help me how to open the app?

If there is a rogue iproxy session you can kill it by executing
ps -ax|grep -i "iproxy"|grep -v grep|awk '{print "kill -9 " $1}'|sh
on the command line.

iProxy is not exited, find the port and kill it.
To find the port:
lsof -i -n -P | grep 8100
To kill:
kill -9 PORT_NUMBER
copy this in terminal
export USE_PORT=8100
For real device, reconnect iOS cable and try running the code.

Related

org.openqa.selenium.SessionNotCreatedException: A new session could not be created

I get this error when i run my appium test case, below is my program
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;
public class Sample {
#Test
public void m1() throws MalformedURLException, InterruptedException{
// Create object of desired class and specify android platform
DesiredCapabilities capabilities = DesiredCapabilities.android();
// set the capabilities to execute in chrome browser
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, BrowserType.CHROME);
// set capability to execute our test in Android platform
capabilities.setCapability(CapabilityType.PLATFORM, Platform.ANDROID);
// need to define platform name
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
// set device name
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "My Mobile");
// set version
capabilities.setCapability(CapabilityType.VERSION, "6.0");
// create object of url and assign appium server address
URL url = new URL("http://127.0.0.1:4723/wd/hub");
WebDriver driver = new AndroidDriver<>(url, capabilities);
driver.get("http://www.facebook.com");
System.out.println(driver.getTitle());
driver.findElement(By.name("email")).sendKeys("suhailxxxxx#gmail.com");
driver.findElement(By.name("pass")).sendKeys("xxxxxxxxx");
Thread.sleep(10000);
}
}
Below is the issue which i got in eclipse
FAILED: m1
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: spawn "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" ENOENT) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 11.87 seconds
Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'
System info: host: 'ACC-H-SUHAAHME', ip: '172.18.201.83', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_144'
Driver info: driver.version: AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:359)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:362)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:646)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:255)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:237)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:138)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:87)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:111)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72)
at io.app.Sample.m1(Sample.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
And this is the issue which i got on appium server
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Not checking whether app is present since we are assuming it's already on the device
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices...
info: [debug] executing cmd: "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" devices
info: [debug] 1 device(s) connected
info: Found device PBG6WSCEM7QSTK69
info: [debug] Setting device id to PBG6WSCEM7QSTK69
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" -s PBG6WSCEM7QSTK69 wait-for-device
info: [debug] Retrying restartAdb
info: [debug] executing cmd: "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" -s PBG6WSCEM7QSTK69 kill-server
info: [debug] Getting connected devices...
info: [debug] executing cmd: "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" -s PBG6WSCEM7QSTK69 devices
info: [debug] 1 device(s) connected
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" -s PBG6WSCEM7QSTK69 wait-for-device
info: [debug] executing cmd: "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" -s PBG6WSCEM7QSTK69 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Cleaning up appium session
error: Logcat capture failed: spawn "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" ENOENT
error: Failed to start an Appium session, err was: Error: spawn "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" ENOENT
info: [debug] Error: spawn "D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe" ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1054:32)
at child_process.js:1145:20
at process._tickDomainCallback (node.js:381:11)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: spawn \"D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe\" ENOENT)","code":"ENOENT","errno":"ENOENT","syscall":"spawn \"D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe\"","path":"\"D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe\"","origValue":"spawn \"D:\softwares\Appium_New\android-sdk-windows\platform-tools\adb.exe\" ENOENT"},"sessionId":null}
info: <-- POST /wd/hub/session 500 10417.138 ms - 510
Please check you APPIUM server, it is started or not.
Update your appium server, node JS and npm then try it out. It worked for me, i was using appium server 1.4 after updating to version 1.7.1 it worked.
Can you close the current appium session and try again. If you are still seeing the error, what is your appium version

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.

Appium on iOS Instruments Crash and Application is crashing

I am trying to automate a scenario where i launch an app on ios Device(can be either simulator or Real Device). The app is getting installed on the Device, but it is crashing and launching. I have set the all the required capabilities and i am launching my code from Eclipse Mars version.
I am getting this error, and app is crashing.
(Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}
Please find the Capabilities set on device
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformVersion", "9.1");
capabilities.setCapability("deviceName","iPhone 6s Plus");
capabilities.setCapability("platformName","iOS");
capabilities.setCapability("bundleId","com.quinnox.EnterpriseCycleCounting");
capabilities.setCapability("app","/Users/rohinic/Downloads/ComEdApp.ipa");
capabilities.setCapability("fullReset",true);
capabilities.setCapability("launchTimeout","900000");
driver = new IOSDriver<WebElement>(new URL("http://0.0.0.0:4723/wd/hub"),capabilities);
The Complete appium log from start to end is as follows,
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --debug-log-spacing --platform-version "8.4" --platform-name "iOS" --default-device
info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"platformName":"iOS","platformVersion":"8.4","defaultDevice":true,"defaultCommandTimeout":7200,"debugLogSpacing":true}
info: Console LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/rohinic/Downloads/ComEdApp.ipa","nativeInstrumentsLib":true,"platformVersion":"9.1","bundleId":"com.quinnox.EnterpriseCycleCounting","platformName":"iOS","deviceName":"iPhone 6s Plus","fullReset":true,"launchTimeout":900000}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] Using local .ipa from desired caps: /Users/rohinic/Downloads/ComEdApp.ipa
info: [debug] Copying local zip to tmp dir
info: [debug] /Users/rohinic/Downloads/ComEdApp.ipa copied to /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/appium-app.zip
info: [debug] Unzipping /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/appium-app.zip
info: [debug] Testing zip archive: /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/appium-app.zip
info: [debug] Zip archive tested clean
info: [debug] Unzip successful
info: [debug] Using locally extracted app: /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.app
info: [debug] Creating new appium session b976d2cd-1a6e-4b96-805c-16ccb15d1576
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode version
info: [debug] Xcode version set to 7.2.1
info: [debug] Setting iOS SDK Version
info: [debug] iOS SDK Version set to 9.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":"7.2.1","iOSSDKVersion":"9.2","deviceName":"iPhone 6s Plus","platformVersion":"9.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6s Plus (9.1)'
info: [debug] iOS sim UDID is 0C8498DB-281C-49D4-A81D-0049133A28C5
info: [debug] Auto-detecting iOS udid...
info: [debug] Not auto-detecting udid, running on sim
info: [debug] Could not parse plist file (as binary) at /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.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/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.app/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/rohinic/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":"oneByOne"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. Do not manually modify!
info: [debug] Dynamic bootstrap path: /Users/rohinic/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js
info: [debug] Reusing dynamic bootstrap: /Users/rohinic/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"7.2.1","iOSSDKVersion":"9.2","deviceName":"iPhone 6s Plus","platformVersion":"9.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6s Plus (9.1)'
info: [debug] We're on iOS7.1+ so forcing defaultDevice on
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"7.2.1","iOSSDKVersion":"9.2","deviceName":"iPhone 6s Plus","platformVersion":"9.1"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'iPhone 6s Plus (9.1)'
info: [debug] Could not parse plist file (as binary) at /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.app/Info.plist
info: Will try to parse the plist file as XML
info: [debug] Parsed app Info.plist (as XML)
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] Killing any other simulator daemons
info: [debug] Cleaning sim data files
info: node-simctl: Executing: xcrun with args: simctl erase 0C8498DB-281C-49D4-A81D-0049133A28C5 and timeout: 2000
info: [debug] Killall iOS Simulator
info: [debug] Cleaning app data files
warn: Applications directory /Users/rohinic/Library/Developer/CoreSimulator/Devices/0C8498DB-281C-49D4-A81D-0049133A28C5/data/Containers/Data/Application doesn't exist. Have you run this simulator before?
warn: Applications directory /Users/rohinic/Library/Developer/CoreSimulator/Devices/0C8498DB-281C-49D4-A81D-0049133A28C5/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] Resetting Content and Settings for Simulator
info: node-simctl: Executing: xcrun with args: simctl erase 0C8498DB-281C-49D4-A81D-0049133A28C5 and timeout: 2000
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] 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 6s Plus (9.1)
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 6s Plus (9.1)" /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.app -e UIASCRIPT "/Users/rohinic/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":900000}
info: [debug] [INST] Waiting for device to boot...
info: [debug] [INST STDERR] 2016-02-16 20:02:58.934 instruments[5040:85669] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2016-02-16 20:03:44.216 instruments[5040:86416] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] 2016-02-16 20:03:44.217 instruments[5040:86958] Attempting to change event horizon while disengage
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.quinnox.EnterpriseCycleCounting'
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 iPhone 6s Plus (9.1)
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 6s Plus (9.1)" /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.app -e UIASCRIPT "/Users/rohinic/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":900000}
info: [debug] [INST STDERR] 2016-02-16 20:03:52.554 instruments[5155:87070] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2016-02-16 20:03:58.268 instruments[5155:87128] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] 2016-02-16 20:03:58.268 instruments[5155:87129] Attempting to change event horizon while disengage
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.quinnox.EnterpriseCycleCounting'
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 iPhone 6s Plus (9.1)
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 6s Plus (9.1)" /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.app -e UIASCRIPT "/Users/rohinic/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":900000}
info: [debug] [INST STDERR] 2016-02-16 20:04:06.714 instruments[5179:87396] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2016-02-16 20:04:12.090 instruments[5179:87332] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] 2016-02-16 20:04:12.090 instruments[5179:87401] Attempting to change event horizon while disengage
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.quinnox.EnterpriseCycleCounting'
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 iPhone 6s Plus (9.1)
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 6s Plus (9.1)" /var/folders/y_/rh25732s5pl00xxr9s99yybh0000gq/T/116116-5001-qlbbdy/Payload/ComEdApp.app -e UIASCRIPT "/Users/rohinic/Library/Application Support/appium/bootstrap/bootstrap-f062718992d59810.js" -e UIARESULTSPATH /tmp/appium-instruments
info: [debug] And extra without-delay env: {}
info: [debug] And launch timeouts (in ms): {"global":900000}
info: [debug] [INST STDERR] 2016-02-16 20:04:19.058 instruments[5203:87596] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2016-02-16 20:04:24.402 instruments[5203:87596] Attempting to change event horizon while disengage
info: [debug] [INST STDERR] 2016-02-16 20:04:24.402 instruments[5203:87621] Attempting to change event horizon while disengage
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.quinnox.EnterpriseCycleCounting'
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: node-simctl: Executing: xcrun with args: simctl erase 0C8498DB-281C-49D4-A81D-0049133A28C5 and timeout: 2000
info: node-simctl: Executing: xcrun with args: simctl erase 0C8498DB-281C-49D4-A81D-0049133A28C5 and timeout: 2000
info: node-simctl: Executing: xcrun with args: simctl erase 0C8498DB-281C-49D4-A81D-0049133A28C5 and timeout: 2000
info: node-simctl: Executing: xcrun with args: simctl erase 0C8498DB-281C-49D4-A81D-0049133A28C5 and timeout: 2000
info: [debug] Cleaning app data files
warn: Applications directory /Users/rohinic/Library/Developer/CoreSimulator/Devices/0C8498DB-281C-49D4-A81D-0049133A28C5/data/Containers/Data/Application doesn't exist. Have you run this simulator before?
warn: Applications directory /Users/rohinic/Library/Developer/CoreSimulator/Devices/0C8498DB-281C-49D4-A81D-0049133A28C5/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] Resetting Content and Settings for Simulator
info: node-simctl: Executing: xcrun with args: simctl erase 0C8498DB-281C-49D4-A81D-0049133A28C5 and timeout: 2000
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 (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:440:31) at [object Object].<anonymous> (/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-instruments/lib/instruments.js:353:12) at ChildProcess.emit (events.js:110:17) at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Instruments crashed on startup)","origValue":"Instruments crashed on startup"},"sessionId":null}
info: <-- POST /wd/hub/session 500 99826.842 ms - 182
Kindly help me in automating this script. Thank you:)

Able to start appium inspector and run the app over simulator using a .app file, but unable to do the same through a .ipa file over a real device

I have no idea what went wrong, we were able to install the application on the iOS device before, but I changed my mac, and the error started appearing.
So I have no problems with running appium and the inspector over simulators using the .app file. The issue is only with trying to have appium run over real devices.
I tried with a ipa that is of ad-hoc build, and .app files that were done with developer provisioning.
Im able to install the app over X-Code, but if I Run the same over appium, it gives either a fruitstrap crash error, and if the app is already installed on to the device and appium is run, it gives a "error: Failed to start an Appium session, err was: Error: Instruments crashed on startup". and the app starts up and closes instantly.
I have read almost all stack overflow pages on the error, and none of the solutions seem to help me solve this. :(
Error if app is already installed on the device :-
![Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --platform-version "8.3" --platform-name "iOS" --app "com.indecomm.literaturelibrary" --udid "5fcdd3078c081abb666330066681c5f0c55d2a08" --device-name "Rohan"
info: Welcome to Appium v1.3.7 (REV 72fbfaa116d3d9f6a862600ee99cf02f6d0e2182)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: \[debug\] Non-default server args: {"app":"com.indecomm.literaturelibrary","udid":"5fcdd3078c081abb666330066681c5f0c55d2a08","deviceName":"Rohan","platformName":"iOS","platformVersion":"8.3","defaultCommandTimeout":7200}
info: Console LogLevel: debug
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 10.052 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 5.375 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/sessions {}
info: \[debug\] Responding to client with success: {"status":0,"value":\[\]}
info: <-- GET /wd/hub/sessions 200 1.032 ms - 23 {"status":0,"value":\[\]}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"8.3","newCommandTimeout":"999999","automationName":"Appium","deviceName":"Rohan"}}
info: Client User-Agent string: Appium (unknown version) CFNetwork/720.3.13 Darwin/14.3.0 (x86_64)
info: \[debug\] App is an iOS bundle, will attempt to run as pre-existing
info: \[debug\] Creating new appium session 371dbdd4-3129-40ee-b102-4048d0ee998f
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.3
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\] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.indecomm.literaturelibrary/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.indecomm.literaturelibrary/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/rohanganapathy/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/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: \[debug\] Reusing dynamic bootstrap: /Users/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: \[debug\] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.3.1","iOSSDKVersion":"8.3","deviceName":"Rohan","platformVersion":"8.3"}
info: \[debug\] fixDevice is on
info: \[debug\] Final device string is: 'Rohan (8.3 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 5fcdd3078c081abb666330066681c5f0c55d2a08
info: \[debug\] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 5fcdd3078c081abb666330066681c5f0c55d2a08 --bundle com.indecomm.literaturelibrary
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 5fcdd3078c081abb666330066681c5f0c55d2a08
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 5fcdd3078c081abb666330066681c5f0c55d2a08 com.indecomm.literaturelibrary -e UIASCRIPT "/Users/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.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-05-13 12:35:32.683 instruments\[10692:1844813\] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: \[debug\] \[INST STDERR\] Instruments Trace Error : Target failed to run: Permission to debug com.indecomm.literaturelibrary was denied. The app must be signed with a development identity (e.g. iOS Developer).
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.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"},"isShuttingDown":false},"sessionId":"371dbdd4-3129-40ee-b102-4048d0ee998f"}
info: <-- GET /wd/hub/status 200 1.113 ms - 178 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"},"isShuttingDown":false},"sessionId":"371dbdd4-3129-40ee-b102-4048d0ee998f"}
info: Launching instruments
info: \[debug\] Attempting to run app on real device with UDID 5fcdd3078c081abb666330066681c5f0c55d2a08
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 5fcdd3078c081abb666330066681c5f0c55d2a08 com.indecomm.literaturelibrary -e UIASCRIPT "/Users/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.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-05-13 12:35:38.992 instruments\[10695:1844869\] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: \[debug\] \[INST STDERR\] Instruments Trace Error : Target failed to run: Permission to debug com.indecomm.literaturelibrary was denied. The app must be signed with a development identity (e.g. iOS Developer).
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 5fcdd3078c081abb666330066681c5f0c55d2a08
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 5fcdd3078c081abb666330066681c5f0c55d2a08 com.indecomm.literaturelibrary -e UIASCRIPT "/Users/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.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-05-13 12:35:44.997 instruments\[10698:1844942\] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: \[debug\] \[INST STDERR\] Instruments Trace Error : Target failed to run: Permission to debug com.indecomm.literaturelibrary was denied. The app must be signed with a development identity (e.g. iOS Developer).
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 5fcdd3078c081abb666330066681c5f0c55d2a08
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 5fcdd3078c081abb666330066681c5f0c55d2a08 com.indecomm.literaturelibrary -e UIASCRIPT "/Users/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.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-05-13 12:35:51.316 instruments\[10701:1845063\] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: \[debug\] \[INST STDERR\] Instruments Trace Error : Target failed to run: Permission to debug com.indecomm.literaturelibrary was denied. The app must be signed with a development identity (e.g. iOS Developer).
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
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:389:31)
at null.<anonymous> (/Applications/Appium.app/Contents/Resources/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}
error: Failed to start an Appium session, err was: Error: Instruments crashed on startup
info: <-- POST /wd/hub/session 500 21928.427 ms - 182
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 1.723 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 1.344 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 1.144 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 1.039 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 1.202 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
info: \[debug\] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 1.082 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
`][1]
Error if app is not installed in the device:-
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --platform-version "8.3" --platform-name "iOS" --app "com.indecomm.literaturelibrary" --udid "5fcdd3078c081abb666330066681c5f0c55d2a08" --device-name "Rohan"
info: Welcome to Appium v1.3.7 (REV 72fbfaa116d3d9f6a862600ee99cf02f6d0e2182)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"app":"com.indecomm.literaturelibrary","udid":"5fcdd3078c081abb666330066681c5f0c55d2a08","deviceName":"Rohan","platformName":"iOS","platformVersion":"8.3","defaultCommandTimeout":7200}
info: Console LogLevel: debug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 11.393 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 3.277 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/sessions {}
info: [debug] Responding to client with success: {"status":0,"value":[]}
info: <-- GET /wd/hub/sessions 200 1.075 ms - 23 {"status":0,"value":[]}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"iOS","platformVersion":"8.3","newCommandTimeout":"999999","automationName":"Appium","deviceName":"Rohan"}}
info: Client User-Agent string: Appium (unknown version) CFNetwork/720.3.13 Darwin/14.3.0 (x86_64)
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 9fd1be4f-aaeb-41c9-afd2-6947fa91babf
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.3
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] Could not parse plist file (as binary) at /Applications/Appium.app/Contents/Resources/node_modules/appium/com.indecomm.literaturelibrary/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.indecomm.literaturelibrary/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/rohanganapathy/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/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Reusing dynamic bootstrap: /Users/rohanganapathy/Library/Application Support/appium/bootstrap/bootstrap-d5a0fb924946d8d3.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.3.1","iOSSDKVersion":"8.3","deviceName":"Rohan","platformVersion":"8.3"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'Rohan (8.3 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 5fcdd3078c081abb666330066681c5f0c55d2a08
info: [debug] Checking app install status using: /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 5fcdd3078c081abb666330066681c5f0c55d2a08 --bundle com.indecomm.literaturelibrary
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 5fcdd3078c081abb666330066681c5f0c55d2a08 --bundle "com.indecomm.literaturelibrary"
info: [debug] Cleaning up appium session
info: [debug] Error: Unable to install [com.indecomm.literaturelibrary] to device with id [5fcdd3078c081abb666330066681c5f0c55d2a08]. Error [Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id 5fcdd3078c081abb666330066681c5f0c55d2a08 --bundle "com.indecomm.literaturelibrary"
Assertion failed: (access(app_path, F_OK) == 0), function main, file fruitstrap.c, line 718.
]
at /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/common.js:147:10
at ChildProcess.exithandler (child_process.js:751:5)
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: Unable to install [com.indecomm.literaturelibrary] to device with id [5fcdd3078c081abb666330066681c5f0c55d2a08]. Error [Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id 5fcdd3078c081abb666330066681c5f0c55d2a08 --bundle \"com.indecomm.literaturelibrary\"\nAssertion failed: (access(app_path, F_OK) == 0), function main, file fruitstrap.c, line 718.\n])","origValue":"Unable to install [com.indecomm.literaturelibrary] to device with id [5fcdd3078c081abb666330066681c5f0c55d2a08]. Error [Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id 5fcdd3078c081abb666330066681c5f0c55d2a08 --bundle \"com.indecomm.literaturelibrary\"\nAssertion failed: (access(app_path, F_OK) == 0), function main, file fruitstrap.c, line 718.\n]"},"sessionId":null}
error: Failed to start an Appium session, err was: Error: Unable to install [com.indecomm.literaturelibrary] to device with id [5fcdd3078c081abb666330066681c5f0c55d2a08]. Error [Error: Command failed: /bin/sh -c /Applications/Appium.app/Contents/Resources/node_modules/appium/build/fruitstrap/fruitstrap install --id 5fcdd3078c081abb666330066681c5f0c55d2a08 --bundle "com.indecomm.literaturelibrary"
Assertion failed: (access(app_path, F_OK) == 0), function main, file fruitstrap.c, line 718.
]
info: <-- POST /wd/hub/session 500 2729.320 ms - 1002
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 1.394 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: --> GET /wd/hub/status {}
The issue is that the app must be signed with a developer profile for it to work on real ios devices.I had faced the same issue and it works after signing it with a development profile(u can get one from apple dev site for $99).
info: \[debug\] \[INST STDERR\] Instruments Trace Error : Target failed to run: Permission to debug com.indecomm.literaturelibrary was denied. The app must be signed with a development identity (e.g. iOS Developer).
pls refer to this for further details https://discuss.appium.io/t/the-app-must-be-signed-with-a-development-identity/2653

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