运行测试时出现xctool错误

时间:2015-03-16 09:00:09

标签: ios xcode xctool

我有一个简单的Xcode项目,有一些测试。当我使用xctool使用简单命令构建时:

path/to/xctool.sh \
  -project YourProject.xcodeproj \
  -scheme YourScheme \
  build

它运作得很好。但是,当我尝试构建&运行我的测试,尝试运行它时出错。

我用以下方法构建测试:

path/to/xctool.sh \
  -project YourProject.xcodeproj \
  -scheme YourScheme \
  build-tests

我用:

运行测试
path/to/xctool.sh \
  -workspace YourProject.xcodeproj \
  -scheme YourScheme \
  run-tests

这抱怨我需要指定SDK,所以我追加-sdk iphonesimulator。然后我收到以下错误:

    Failed to query the list of test cases in the test bundle: sh: /Applications/Xcode.app/usr/bin/xcodebuild: No such file or directory
    /Applications/Xcode.app/usr/bin/xcodebuild fails with 32512 - Unknown error: 32512
2015-03-16 09:53:52.953 sim[15747:4298865] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'launch path not accessible'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8d0fa66c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff86cc776e objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8d0fa51d +[NSException raise:format:] + 205
    3   Foundation                          0x00007fff8b7186ac -[NSConcreteTask launchWithDictionary:] + 444
    4   sim                                 0x000000010f713584 sim + 5508
    5   sim                                 0x000000010f714a3a sim + 10810
    6   libdyld.dylib                       0x00007fff86eea5c9 start + 1
    7   ???                                 0x0000000000000005 0x0 + 5
)
libc++abi.dylib: terminating with uncaught exception of type NSException

我不明白为什么xctool会在/Applications/Xcode.app/usr/bin/xcodebuild中查找测试用例?

0 个答案:

没有答案