The problem is that the binary in incompatible with the simulator version.
For example, if you build an app iPhone 6 Simulator it will contain an x86_64 instruction slice. You can install this binary on an iPhone 4s simulator, but it will not launch because the iPhone 4s Simulator because that simulator requires an i386 instruction set. Simply put, you must build an app that is compatible for the simulator you are targeting.
Here are some steps you can take to solve this problem.
Make sure you have the latest version of calabash and the latest version of the framework. [1] If you are not using bundler already, now would be a good time to start. [2]
UPDATE Calabash 0.12.0.pre1 will raise an error if the .app is incompatible for the target simulator.
# Resets _all_ the simulators
$ bundle exec calabash-ios sim reset
Here is an example of a xcodebuild
command that will build an .app that is compatible for all simulators.[3][4]
xcrun xcodebuild \
-SYMROOT=build \
-derivedDataPath build \
ARCHS="i386 x86_64" \
VALID_ARCHS="i386 x86_64" \
ONLY_ACTIVE_ARCH=NO \
-project ./path/to/your/.xcproject directory \
-scheme "The Name of your Calabash Scheme" \
-sdk iphonesimulator \
-configuration DEBUG \
clean build
The .app can be found in this directory: "./build/Build/Products/Debug-iphonesimulator/YourApp.app" Use this path as your APP path. [5]
$ export APP="./build/Build/Products/Debug-iphonesimulator/YourApp.app"
$ bundle exec cucumber
Adjust the build settings of your Calabash target to always build a compatible binary.
- [1] Updating Calabash
- [2] Why use bundler?
- [3] Animated Happiness Build Script
- [4] Briar iOS Example Build Script
- [5] APP and APP_BUNDLE_PATH API docs
See also these two issues: