Skip to content

Hot Topics

Joshua Moody edited this page Apr 29, 2015 · 50 revisions

The topics on this page change regularly.

Beware of linking directly to topic headers.

Contents

  1. Xcode 6.3 - instruments cannot launch my app on iOS 8.3 Simulators [RESOLVED]
  2. NSLog output can cause apps to become unresponsive during testing.
  3. cucumber is not compatible with ruby 2.2.*
  4. The app launches, then quits several times in rapid succession. (RunLoop::IncompatibleArchitecture)
  5. Enable Development After Upgrading Devices to 8.*
  6. Errno::EINTR: Interrupted system call

1. Xcode 6.3 cannot launch my app on iOS 8.3 Simulators [RESOLVED]

Starting in Xcode 6.3 instruments has been unable to launch apps that are already installed on the iOS 8.3 Simulator.

Waiting for device to boot...
Instruments Trace Error : Target failed to run: The operation couldn’t be completed. 
(FBSOpenApplicationErrorDomain error 8.) : Failed to launch process with bundle identifier
'com.lesspainful.example.LPSimpleExample-cal'

This issue has been resolved with run-loop 1.3.1.

2. NSLog output can cause apps to become unresponsive during testing.

If your app becomes unresponsive during testing, check your device or simulator logs for an unusual or a high volume of NSLog output.

It has been demonstrated that a spike in NSLog output can cause the UIAutomation API to become unresponsive. This has been reproduced using the Instruments.app with applications that are not linked with the calabash.framework. This is an Apple bug.

Viewing Simulator Logs

# Shell A
$ xcrun instruments -s devices
<snip>
iPhone 5s (8.1 Simulator) [08B232DB-82B9-43F0-85EA-D769D5697306]
<snip>
$ tail -f ~/Library/Logs/CoreSimulator/08B232DB-82B9-43F0-85EA-D769D5697306/system.log

# Shell B
$ be DEVICE_TARGET="iPhone 5s (8.1 Simulator)" cucumber

Viewing Device Logs

You can view device logs from Xcode.

  1. Open Xcode and use Command + Shift + 2 to show the Devices window.

====

2015-02-04_20-43-56

====

You can also tail device logs with idevicesyslog. NOTE: We do not maintain the ideviceinstaller, libimobiledevice, or homebrew tools. This is third-party software. If you have issues with these tools, you are on your own. Please do not report problems with these tools on the Calabash channels.

# Install with homebrew.
$ brew install ideviceinstaller
$ xcrun instruments -s devices
<snip>
denis (8.1) [19xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0d]
<snip>

# Shell A
$ idevicesyslog -u 19xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0d

$ Shell B
$ be DEVICE_TARGET=https://denis.local:37265 DEVICE_TARGET="19xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0d" cucumber

3. cucumber is not compatible with ruby 2.2.*

$ be cucumber --version
1.3.18
$ be cucumber -p ios
Using the ios, ios_common, common, ios_tags and ios_requires profiles...
@test @wip
Feature: My Awesome Feature

  Background: I am logged in and looking at the home page # features/awesome.feature:5
undefined method `extend_world' for nil:NilClass (NoMethodError)

You can downgrade to ruby <= 2.1.* or include 'minitest' in your Gemfile.

### Sample Gemfile
source 'https://rubygems.org'

gem 'minitest'
gem 'calabash-cucumber', '0.12.3'

The progress of ruby 2.2.0 support and cucumber is being tracked in this issue: ruby 2.2.0 + cucumber 1.3.18 raises undefined method `extend_world' for nil:NilClass

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

Before Calabash 0.12.0.

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.

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 will raise an error if the .app is incompatible for the target simulator.

Clear the Simulator Content & Settings.
# Resets _all_ the simulators
$ bundle exec calabash-ios sim reset
Building Compatible Binaries: xcodebuild

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 
Building Compatible Binaries: Xcode

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


2014-12-12_12-52-47


Links

See also these two issues:

5. Enable Development After Upgrading Devices to 8.*

The Settings.app > Developer table view row disappears after updating to iOS 8.1.1 or higher. 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.

6. Errno::EINTR: Interrupted system call

See the discussion here: https://github.com/calabash/run_loop/issues/35

This is an active issue; no comprehensive solution exists yet.

You can see this error if:

  1. The bundle identifier is incorrect.
  2. The device is not enabled for UIAutomation. Starting in iOS 8, you must enable UIAutomation on the device using the switch in Settings.app > Developer > Enable UIAutomation.
  3. The device is not enabled for development. We have observed that devices can change from enabled to disabled for development when migrating from iOS 7 to iOS 8 and between iOS 8 betas. The best practice is to restart the device after migrating. See instructions below for verifying that your device is enabled using the Instruments.app.
  4. The device should appear in Xcode's Devices window (Shift + Command + 2) without a yellow warning.
  5. The device must appear in Xcode's Scheme > Target device list as eligible. See below for a screenshot.

To work-around 3, 4, and 5, you can try plugging the problem device into another Mac that is running Yosemite and the latest (non-beta) version of Xcode.

Requesting Feedback

There is a simple, definitive test to determine if the Xcode toolchain or Calabash is blame. [1] Please report results in the run-loop GitHub issue. [2]

Testing if the Device is Enabled for Development
  1. Connect the device via USB.
  2. Open Instruments.app for your current version of Xcode.
  3. Select the Automation template
  4. In the top left corner of the window, select your device and the a target application.

If your device is not enabled for development, Instruments.app will tell you to open Xcode to enable the device for development.

image


Example of an Ineligible Device

image

Clone this wiki locally