Closed MJanach closed 9 years ago
I did some reading on similar issues and it was corrected by simply enabling UI Automation.
On iOS Device go to Settings>Developer>and Enable UI Automation.
Enabling UI Automation on iPhone resolved the problem. Thanks @MJanach
I was getting this error too when running the automation script on physical device (iPad mini): org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Instruments crashed on startup) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 30.83 seconds
The app kept crashing on the real device.
But enabling UI Automation on iOS Device go to Settings>Developer>and Enable UI Automation HELPED to sort the issue out.
Thanks so much @MJanach!!!
I have the UI Automation enabled but still getting the same error.
FAILED CONFIGURATION: @BeforeMethod setUp
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Instruments crashed on startup) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 28.35 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'briefcasecritic-lmwificorpvivantcomau.local', ip: '169.254.229.93', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
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 org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.
SKIPPED CONFIGURATION: @AfterMethod tearDown SKIPPED: test01
Default test
Tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1
Default suite Total tests run: 1, Failures: 0, Skips: 1
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 5 ms [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@12bb4df8: 19 ms [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@3d04a311: 4 ms [TestNG] Time taken by org.testng.reporters.jq.Main@71bc1ae4: 25 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter2@4ac68d3e: 5 ms [TestNG] Time taken by org.testng.reporters.XMLReporter@1055e4af: 5 ms
We need the server logs, not the Java client logs. It should start with something along the lines of
[Appium] Welcome to Appium v1.5.1 (REV 0f65f2b6574744e3890886a5f5769cb71e55cafe)
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
Your application is not built for automation
info: [debug] [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug com.australiansuper.australiansuper.ent was denied. The app must be signed with a development identity (e.g. iOS Developer).
It needs to be built for a simulator if it is running on a simulator, or built for a real device with a developer identity, in a debug mode.
@imurchie I am getting this error. UI Automation has already been enabled.
DesiredCapabilities caps = new DesiredCapabilities(); caps.setCapability("deviceName", "iPad"); caps.setCapability("udid", "1c4208259e9c2b6ef99bd0dc7b70d51837c45ee9"); caps.setCapability("platformName", "ios"); caps.setCapability("platformVersion", "11.2.1"); caps.setCapability("bundleId", "net.harrisvotes.hccopollbook"); caps.setCapability("noReset", "true");
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Instruments crashed on startup) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 28.67 seconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'daffomac-37-munek-dfg-1231-munekkumardaffodilswcom.local', ip: '172.18.4.129', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.1', java.version: '1.8.0_131'
Driver info: driver.version: 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:423)
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$22(ProtocolHandshake.java:365)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:64)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:43)
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:250)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
If I build SafariLauncher using XCode, it launches and navigates to apple.com. Using Appium, SafariLauncher opens briefly then crashes a few times. If anyone has any good general trouble shooting steps or can find useful info in the logs below, it would be highly appreciated.
System Specs: Appium v1.3.6 Yosemite 10.10.2 Xcode 6.2(6C131e) iOS 8.2(12D508)
Terminal Output: Last login: Sun Mar 22 13:13:54 on ttys000
helpdesks-MacBook-Air:~ helpdesk$ appium &
[1] 3612
helpdesks-MacBook-Air:~ helpdesk$ info: Welcome to Appium v1.3.6 (REV 004f52f249d3513809e7d0734d9205d1fec19f8e)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug ios_webkit_debug_proxy -c 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7:27753
Connected :27753 to RMurthy’s iPad (0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7)
info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"io.appiumSafariLauncher","safariIgnoreFraudWarning":true,"platformVersion":"8.2","safariAllowPopups":false,"automationName":"Appium","platformName":"iOS","udid":"0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7","deviceName":"ITiPad"}}
info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
info: [debug] App is an iOS bundle, will attempt to run as pre-existing
info: [debug] Creating new appium session 8b45d1f2-27fc-4315-8c91-67b9952f27e8
info: [debug] Removing any remaining instruments sockets
info: [debug] Cleaned up instruments socket /tmp/instruments_sock
info: [debug] Setting Xcode folder
info: [debug] Setting Xcode version
info: [debug] Setting iOS SDK Version
info: [debug] Getting sdk version from xcrun with a timeout
info: [debug] iOS SDK Version set to 8.2
info: [debug] 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 /usr/local/lib/node_modules/appium/io.appiumSafariLauncher/en.lproj/Localizable.strings
info: Will try to parse the plist file as XML
info: [debug] Could not parse plist file (as XML) at /usr/local/lib/node_modules/appium/io.appiumSafariLauncher/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/helpdesk/Library/Application Support/appium/bootstrap
info: [debug] Dynamic env: {"nodePath":"/usr/local/Cellar/node/0.12.0/bin/node","commandProxyClientPath":"/usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js","instrumentsSock":"/tmp/instruments_sock","interKeyDelay":null,"justLoopInfinitely":false,"autoAcceptAlerts":false,"autoDismissAlerts":false,"sendKeyStrategy":"grouped"}
info: [debug] Dynamic bootstrap code: // This file is automatically generated. D...ot manually modify!
info: [debug] Dynamic bootstrap path: /Users/helpdesk/Library/Application Support/appium/bootstrap/bootstrap-8a852d5c6e8dd1ae.js
info: [debug] Reusing dynamic bootstrap: /Users/helpdesk/Library/Application Support/appium/bootstrap/bootstrap-8a852d5c6e8dd1ae.js
info: [debug] Getting device string from opts: {"forceIphone":false,"forceIpad":false,"xcodeVersion":"6.2","iOSSDKVersion":"8.2","deviceName":"ITiPad","platformVersion":"8.2"}
info: [debug] fixDevice is on
info: [debug] Final device string is: 'ITiPad (8.2 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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7
info: [debug] Checking app install status using: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7 --bundle io.appiumSafariLauncher
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7 io.appiumSafariLauncher -e UIASCRIPT "/Users/helpdesk/Library/Application Support/appium/bootstrap/bootstrap-8a852d5c6e8dd1ae.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-22 13:15:42.099 instruments[3636:63240] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-03-22 13:15:43.275 instruments[3636:63201] Automation Instrument ran into an exception while trying to run the script. UIAScriptAgentSignaledException
info: [debug] [INST] 2015-03-22 20:15:43 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.415652s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7 io.appiumSafariLauncher -e UIASCRIPT "/Users/helpdesk/Library/Application Support/appium/bootstrap/bootstrap-8a852d5c6e8dd1ae.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-22 13:15:49.191 instruments[3640:63268] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-03-22 13:15:50.417 instruments[3640:63268] Automation Instrument ran into an exception while trying to run the script. UIAScriptAgentSignaledException
info: [debug] [INST] 2015-03-22 20:15:50 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.377487s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7 io.appiumSafariLauncher -e UIASCRIPT "/Users/helpdesk/Library/Application Support/appium/bootstrap/bootstrap-8a852d5c6e8dd1ae.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-22 13:15:56.550 instruments[3644:63311] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-03-22 13:15:57.668 instruments[3644:63317] Automation Instrument ran into an exception while trying to run the script. UIAScriptAgentSignaledException
info: [debug] [INST] 2015-03-22 20:15:57 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 2.583296s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7
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 0bc9fbc3731cabed9d89b6cecc2bbef4a8a8e8f7 io.appiumSafariLauncher -e UIASCRIPT "/Users/helpdesk/Library/Application Support/appium/bootstrap/bootstrap-8a852d5c6e8dd1ae.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-22 13:16:04.983 instruments[3648:63336] WebKit Threading Violation - initial use of WebKit from a secondary thread.
info: [debug] [INST STDERR] 2015-03-22 13:16:06.352 instruments[3648:63336] Automation Instrument ran into an exception while trying to run the script. UIAScriptAgentSignaledException
info: [debug] [INST] 2015-03-22 20:16:06 +0000 Fail: An error occurred while trying to run the script.
info: [debug] [INST] Instruments Trace Complete (Duration : 1.114216s; Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
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
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 27330.979 ms - 182
Eclipse Application Output: Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Instruments crashed on startup) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 27.50 seconds
Build info: version: '2.43.1', revision: '5163bceef1bc36d43f3dc0b83c88998168a363a0', time: '2014-09-10 09:43:55'
System info: host: 'helpdesks-MacBook-Air.local', ip: '192.168.1.102', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.2', java.version: '1.8.0_31'
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:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:180)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:109)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:23)
at com.ag.appium4.App.main(App.java:34)