Xcode 4: Run tests from the command line (xcodebuild)?

后端 未结 5 763
执笔经年
执笔经年 2020-11-30 18:00

I\'ve created a brand new iOS project in Xcode 4, and included unit tests. The default app has 2 targets, the main application and the unit test bundle. Using \"Product > Te

5条回答
  •  难免孤独
    2020-11-30 18:54

    I was inspired by Jonah's post and found a way to do it:

    http://longweekendmobile.com/2011/04/17/xcode4-running-application-tests-from-the-command-line-in-ios/

    Basically, you need Xcode 4 and you have to hack a script to make it work, but it does.

    The key point is convincing Xcode 4 to run your iOS test bundle as if it was a MacOS X bundle - it's a problem with the platform, Xcode doesn't want to run application tests out of the box on the command line. Funny, because it seems to work.

    There's also a sample project on the site.

提交回复
热议问题