O'Reilly logo

Test iOS Apps with UI Automation by Jonathan Penn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Seeding Data in Xcode with Application Data Packages

For our first technique, we’re going to use a feature of Xcode schemes that lets us specify an application data package to load into the simulator or device alongside the app when built and run from the Xcode GUI. This package completely replaces whatever is in the application’s sandbox, effectively resetting documents and preferences. You can pull these packages off live devices, so it’s a great way to take a snapshot of state you want to save for later.

To learn this technique, we’ll write a behavior test for the sorting in NearbyMe that depends on a specific set of search terms. We’ll first create an application data package that we’ll use as a baseline. We’ll store this data package ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required