moredip/Sim-Launcher — pull request #25 by jtomson-mdsol (2014-01-28 16:54:22+00:00)
Title: Fix intermittent failures invoking SimLauncher::Simulator::xcode_version

Using Xcode 5.0.2 on OS X 10.9, ```xcodebuild -version``` will intermittently have a non-zero exit on success.

Example of non-zero exits:
```ruby
run_num = 0
last_exit = 0
until last_exit != 0 do
run_num += 1
`xcodebuild -version`
last_exit = $?
end
puts "Got non-zero exit after #{run_num} runs"
```
Output (above saved as 'txc.rb'):
```
cranky:tmp jtomson$ ruby txc.rb
Got non-zero exit after 8 runs
cranky:tmp jtomson$ ruby txc.rb
Got non-zero exit after 181 runs
cranky:tmp jtomson$ ruby txc.rb
Got non-zero exit after 421 runs
cranky:tmp jtomson$ ruby txc.rb
```
When this non-zero exit occurs, Frank-Cucumber Scenarios will fail.

This change will detect ```xcodebuild``` invocation failure via parsing exceptions instead of exit code for ```Simulator::xcode_version```, and clean up its usage (currently its result passed to ```iphonesim_path``` is unused)