Running Tests on an Attached Device

Running tests on the simulator is a great first line of defense for testing behavior, but it is important to check them on the device as well. There’s just enough difference between the SDKs and architectures to make it worth our while to explore how to do it from the command line.

Instruments is quite capable of pulling this off, but we’ll need to adjust how we build the application with xcodebuild. We also need to choose a different set of scripts depending on what device is connected. And we’ll look into an unofficial hack that sometimes works to install the app automatically on a device marked for development. At least we’ll wrap the mechanism in a part of the script that we can swap out with an official ...

Get Test iOS Apps with UI Automation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.