我想为我的库创建逻辑测试并在iOS设备上运行它们。我知道我们只能在模拟器上运行它们。但我已经看到我可以在iOS设备上运行默认测试。这是设置。
这是否意味着我也可以在设备上运行XCTests?
此外,当我尝试使用命令行运行相同的测试时,它给出了错误,指出该方案不可测试。为什么Xcode能够运行它?这是我在设备上运行的命令行。
xcodebuild test -scheme MyApp -configuration Debug -destination name=TestIPhone
并且看到以下消息
2014-03-14 16:04:12.423 xcodebuild[620:1207] [MT] DVTAssertions: Warning in /SourceCache/IDEFoundation/IDEFoundation-3582/Framework/Classes/Model/Execution/RunContext/IDEScheme.m:1290
Details: Scheme <IDEScheme:0x7ff6abc8d2b0:'MyAppTests'> was asked to test, but it is not testable and shouldn't have allowed this action.
Object: <IDEScheme: 0x7ff6abc8d2b0>
Method: -testOperationWithExecutionContext:buildIfNeeded:onlyBuild:destination:overridingProperties:overridingTestingSpecifiers:buildLog:overridingBuildConfiguration:restorePersistedBuildResults:invocationRecord:name:title:error:actionCallbackBlock:
Thread: <NSThread: 0x7ff6abc0e5d0>{name = (null), num = 1}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
xcodebuild: error: Failed to build project MyAppTests with scheme MyAppTests.
Reason: Scheme "MyAppTests" is not testable.
任何见解都会有所帮助。我很困惑。
答案 0 :(得分:0)
此问题已通过Xcode5.1更新解决。