appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
18.98k stars 6.08k forks source link

iOS Simulator failed to install the application. #1815

Closed bootstraponline closed 10 years ago

bootstraponline commented 10 years ago

If I run mobile :reset multiple times, the iOS simulator generates an alert:

iOS Simulator failed to install the application. Selenium::WebDriver::Error::UnknownError: Instruments crashed on startup

penguinho commented 10 years ago

Is this in trunk or 0.14.2?

bootstraponline commented 10 years ago

appium rev a2dff90975d33fd66bd2cd9ae618d30ae423f7a0

bootstraponline commented 10 years ago

It happened again. This is a fatal error when using appium for iOS testing on the simulator.

I think AppleScript could at least accept the alert so appium doesn't wait forever?

jlipps commented 10 years ago

Yeah maybe we should build in an applescript alert watcher :-(

On Jan 29, 2014, at 9:20 AM, bootstraponline notifications@github.com wrote:

It happened again. This is a fatal error when using appium for iOS testing on the simulator.

I think AppleScript could at least accept the alert so appium doesn't wait forever?

— Reply to this email directly or view it on GitHub.

bootstraponline commented 10 years ago

appium needs an applescript watcher for this. I'm running ios via Jenkins and it's not possible to run for more than a day without hitting the issue. I will try to submit a pull request with a fix soon.

bootstraponline commented 10 years ago

Appium uses the following to start instruments. If I paste it into the Terminal manually, the app launches. When run via Jenkins with #!/bin/bash --login either the simulator timeout dialog or the app failed to install dialog is triggered.

/Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /workspace/appium-ios-local/woven-automation/binary/WoveniOS.app -e UIASCRIPT /appium/lib/devices/ios/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments/

jlipps commented 10 years ago

I think I got around this problem by authorizing instruments for every user, not just Developer group users.

joe-mcg commented 10 years ago

What were the steps you followed to authorise every user?

bootstraponline commented 10 years ago

I've run sudo grunt authorize from the Terminal and it doesn't help when instruments is invoked by Jenkins. Is there a different set of commands to authorize everything?

jlipps commented 10 years ago

hmm weird. I have noticed that running via ssh causes different behavior in instruments sometimes too.

i'm out of ideas then.

Joe, authorizing every user is now done as part of authorize; previously it used to only authorize users in the developer group.

bootstraponline commented 10 years ago

I had it working on cloudbees last week. I didn't change anything and now Jenkins can't launch instruments. Maybe they'll figure it out.

joe-mcg commented 10 years ago

I'm definitely seeing this issue as well, I've run authorise-ios.js and it hasn't helped. My tests are also run from Jenkins but I see the same behaviour when run locally with maven.

The behaviour seems intermittent which is weird.

Appium version 0.14.2.

bootstraponline commented 10 years ago

CloudBees fixed the failure to launch instruments by using a launch agent instead of a daemon to start jenkins cli. I'm leaving this issue open as appium still doesn't handle the simulator dialogs such as timed out or failed to install.

sangeethasriniv commented 10 years ago

Upon appium launch (appium &) I get the following error and unable to run any iOS tests

info: Welcome to Appium v0.15.0 (REV a7b47d73a27074cc928cc5b325e5d4de1b6e5594) info: Appium REST http interface listener started on 0.0.0.0:4723 info - socket.io started info: Spawning instruments force-quitting watcher process info: [FQInstruments STDERR] Force quit unresponsive instruments v0.0.1

imurchie commented 10 years ago

Please don't hijack other people's issues.

But: That's not an error, just the final output before Appium waits for commands to come in. You should be able to run tests against it.

sangeethasriniv commented 10 years ago

When i try to run tests i get the exception: WebDriverException: Message: u'A new session could not be created. (Original error: Instruments crashed on startup)' I am using mac 10.9.1 and Xcode 5.0.2, appium-doctor says i am fine and also did the authorize_ios @imurchie please point me to an appropriate issue, i could not find one

sangeethasriniv commented 10 years ago

Crashes when i build the app with iphoneos7.0 sdk, building with iphonesimulator7.0 seems to be working fine

jlipps commented 10 years ago

yes, the app must be built with the sim sdk to run it on the sim

jkozlowska commented 10 years ago

I have the same error on iphone simulator 7.0: errors=[1] failures=[0] tests=[1] time=[22.394] errorsmg=[Message: u'A new session could not be created. (Original error: Instruments crashed on startup). ios simulator throw error: ios simulator failed to install the application. I have couple of tests in python which are triggered approximately every 10 minutes by Nagios. I have Mac OS 10.8.5, Appium 0.15.0, Xcode 5.0.2. I have appium registered to grid. Maybe something in my config.json is wrong? this is my capabilities: image

danubiusdan commented 10 years ago

I also have the "Failed to install problem". Appium version 0.15.0.

jlipps commented 10 years ago

This is a runaway thread; the error can be caused by a large variety of circumstances. For future readers, it's best to send in a query to the discussion group.

lock[bot] commented 5 years ago

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.