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

Choose Your Own Adventure with Environment Variables

We fixed a performance bug and verified behavior with our generated test data, but we don’t want to have to manually change the Objective-C code when we want to choose a data scenario. Instead we’ll choose which message to send to the data factory on the fly during application launch based on an environment-variable value.

Every Unix process, including iOS and OS X apps, has a set of variables made visible through that process’s environment. We can assign any string value we want to these environment variables through Xcode schemes, as we’ll see in a moment, and even from the command line, which we’ll use in Chapter 10, Command-Line Workflow.

Rather than hard-code the call to generate ...

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