I’m in the process of adding OCUnit tests to an existing iOS code base. Throughout this process, the biggest pain point I have encountered has been the simulator taking over the screen after an application test suite has run. This behavior completely breaks the flow of red/green/refactor, especially when you are on a roll. Here is a typical round trip for me when testing using the default behavior: Make a code change Hit ⌘ + U to run the test suite Simulator appears and takes over the screen Tests complete in Xcode, which is now behind the simulator ⌘ + ⇥ back to Xcode to check the results, or ⌘ + ⇥ to the simulator, then ⌘ + Q to quit it I solved this problem by running a script to close the simulator.
Continue reading

When I am rapidly prototyping new features, I frequently need to blow out the entire app structure from the simulator and start fresh. To do this manually, I would follow the following steps. From Simulator (when simulator is open)*: 1. Go to Menu Bar 2. Click iOS Simulator 3. Click Reset Content and Settings Benefits of this approach: Easy to do/remember Blows out all settings and apps Drawbacks to this approach Destroys ALL content, including any general settings I frequently need to test something more complex, like uploading images.
Continue reading

Author's picture

Mark Struzinski

iOS dev @ Lowe’s Home Improvement

North Carolina, USA