Skip to content

Instantly share code, notes, and snippets.

@jmoody
Created August 10, 2017 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmoody/d48431cdd9f286fe2a353dad5796839f to your computer and use it in GitHub Desktop.
Save jmoody/d48431cdd9f286fe2a353dad5796839f to your computer and use it in GitHub Desktop.
NSLog output can cause apps to become unresponsive during testing

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment