iOS application unit tests from the command line: Xcode 4.5 update
By Mark on November 11th, 2012Tags: iOS, unit testing, xcode, xcode4
We receive a decent amount of traffic from a post I wrote 18 months ago in which we described how to trick Xcode 4.x into running your application unit tests from the command line.
Unfortunately, as of Xcode 4.5, this trick appears to be broken. You’ll get this error message when you run your tests:
Unknown Device Type. Using UIUserInterfaceIdiomPad based on screen size
Terminating since there is no workspace.
(For more details, see this StackOverflow post regarding Xcode 4.5 command line unit testing.)
Worse yet, if you’re like us and using command line unit testing in a CI (=Jenkins) environment, you probably didn’t even notice the failure at first, because the xcodebuild command doesn’t fail — it completes successfully despite not running any of your tests (!).
Luckily, a gentleman named Scott Thompson on StackOverflow had found a way a few months prior (even to Xcode 4.5) to use ios-sim to launch the iOS simulator with some arguments and environment variables to tell the simulator to running application unit tests, much in the way Xcode magically does when you press Command-U in the IDE.
The solution involves creating a new scheme for your tests, and then using a post-build script to run ios-sim with the right flags. There’s no point to reproduce the solution here, as the SO answer is well-written and clear:
Best of luck, and thanks Scott and Pawel!
Great Mobile UX: Slideshare Presentation of the Day
In addition to being a Long Weekender, I work for a great company in Tokyo called Moneytree. Last weekend I gave [...]
Reading Chinese on your iPhone Just Got Easier
Reading Chinese on your iPhone Just Got Easier Makers of popular language study applications Rikai Browser and Chinese Flash release [...]
Learn iOS Complete – Teaching Series
In partnership with Swinburne University of Technology in 2011 we ran a variety of courses teaching software development for the [...]
Rikai Browser 1.5 Released
Rikai Browser, the easy way to read Japanese websites on your iPhone & iPad, has just been updated. In this [...]
Juliette Review on Geek Mom
We recently launched Juliette & The Shiny Red Ballon, our first iPad children’s book. As we pointed out, it also [...]
Our First Storybook Helps Kids with Cancer
Long Weekend and the Tyler Foundation recently announced the release of Juliette and the Shiny Red Balloon, a bedtime storybook for iPad presented in English [...]
New iPad Storybook Supports Families of Children with Cancer
TOKYO – The Tyler Foundation, a charity supporting children with cancer and their families, has a new venue for fundraising: [...]
Should we add this to Japanese & Chinese Flash?
We consider Japanese Flash and Chinese Flash to be pretty mature products: most of the code has been developed over [...]
New iOS App Chinese Flash Combines Vocab Study, Tone Practice
TOKYO – Jan 9, 2012 – Chinese Flash, a new tool for studying Chinese vocabulary, launched today on the Apple [...]
20MB Limit: Finding the Real Size of an App Binary
In our language learning products Japanese Flash & Chinese Flash, we have quite large sql files. This puts us over [...]
older posts >




