网上很多信息说xcode4.5版本以后不支持命令行运行unit test。其实这种说法有误。
官方文档:
应用xcodebuild test 命令行运行测试用例
根据自己的实际schema配置情况,灵活调整 destination 参数。
如官网示例:
xcodebuild test -project MyAppProject.xcodeproj -scheme MyApp -destination 'platform=OS X,arch=x86_64'
而在我的配置环境下
xcodebuild test -scheme aptTests -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.1'
-project在project当前目录下,且只有一个project文件,是可选参数,可以不写