calabash/run_loop — pull request #16 by jmoody (2014-08-21 23:54:22+00:00)
Title: only enable accessibility when targeting a simulator

### Motivation

We are migrating the 'enable accessibility' behavior in calabash to run-loop.

As of PR https://github.com/calabash/run_loop/pull/10, run-loop's 'enabling accessibility' behavior has been less than ideal.

ATM, both calabash _and_ run-loop enable accessibility which is redundant (and slows everything down).

Run-loop has had no unified way of detecting if a simulator or a device is being targeted, so the behavior has been to enable accessibility on the simulators _always_ - even when testing on devices.

This PR adds `RunLoop::Core.simulator_target?` which can detect if simulator is being targeted.

Detecting a simulator works for all supported versions of Xcode and Xcode 6b6. \*

#### How it works

RunLoop::Core.simulator_target? inspects the :device_target value in the options hash that is passed to RunLoop.run.

```
# Legacy support
* 'simulator', nil, and '' ==> true

# Xcode >= 5.1 support
* If the :device_target value contains 'simulator' ==> true

# Xcode >= 6b6 support
* If the :device_target value is a simulator UDID ==> true
* If the :device_target value is a 'named simulator' ==> true
```

\* **WARING: It does not work on previous Xcode 6 beta versions.**