Troubleshooting

Fixing commone issues when running test on local devices

PDF for offline use

Let us know how you feel about this


0/250

This guide will discuss some of the issues that can occur when trying to run Calabash.

Overview

This guide will discuss some of the issues that can occur when trying to run Calabash.

Enable Development After Upgrading Devices to iOS 8.x

The Settings > Developer table view row disappears after updating to iOS 8.1.1. The device will not be ready for Calabash testing until it has been re-enabled for Development. Open Xcode and navigate to the Devices window (Shift + Command + 2). Wait for Xcode to finish copying symbols and then check the device's Settings.app for the Developer settings.

Once this is done, reboot the device.

Does not contain a compatible architecture for target device (RunLoop::IncompatibleArchitecture)

Symptoms: When targeting a Simulator, the app launches, then quits several times in rapid succession.

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.

Update to the Latest Calabash Framework

The Calabash tests must use the same version of the Calabash server that the application is linked with. This section covers how to update the Calabash framework that will be used by Ruby.

First, ensure that the most recent version of calabash-cucumber is installed:

$ gem install calabash-cucumber
Fetching: run_loop-1.1.0.gem (100%)
Successfully installed run_loop-1.1.0
Fetching: calabash-cucumber-0.11.4.gem (100%)
Successfully installed calabash-cucumber-0.11.4
Parsing documentation for run_loop-1.1.0
Installing ri documentation for run_loop-1.1.0
Parsing documentation for calabash-cucumber-0.11.4
Installing ri documentation for calabash-cucumber-0.11.4
Done installing documentation for run_loop, calabash-cucumber after 2 seconds
2 gems installed

Next, download the Calabash server binary:

$ calabash-ios download

----------Info----------
caution: excluded filename not matched:  __MACOSX/*
caution: excluded filename not matched:  calabash.framework/.DS_Store
---------------------------

This will download the most recent Calabash server binary to your working folder.

Clear the Simulator Content & Settings:

The following command line will reset all simulators to their factory state:

$ bundle exec calabash-ios sim reset

Building Compatible Binaries using xcodebuild:

Here is an example of a xcodebuild command that will build an .app that is compatible for all simulators:

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.

Building Compatible Binaries using Xcode

Adjust the build settings of your Calabash target to always build a compatible binary.

Note: Calabash 0.12.0 will raise an error if the .app is an incompatible architecture for the target simulator.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.