4

I have a simple Xcode project with a few tests. When I use xctool to build with simple command:

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

it works just fine. However, when I try to build & run my tests, I get an error when trying to run them.

I build test with:

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

I run tests with:

path/to/xctool.sh \
  -workspace YourProject.xcodeproj \
  -scheme YourScheme \
  run-tests

This complains that I need to specify SDK, so I append the -sdk iphonesimulator. Then I get the following error:

    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

I don't get why xctool looks for test cases in /Applications/Xcode.app/usr/bin/xcodebuild?

pprochazka72
  • 552
  • 5
  • 17
  • Are those your actual calls? If so, you probably have a different scheme defined for your tests, and soit should look more like this: `path/to/xctool.sh -workspace YourProject.xcodeproj -scheme YourSchemeTests run-tests` – wottle Jul 21 '15 at 20:01
  • When I write path/to/xctool.sh \ on terminal I am getting "-bash: path/to/xctool.sh: No such file or directory" can you pls explain how can you able to run this command. I have installed xctool with Homebrew.\ – Chandni Oct 23 '17 at 09:38

0 Answers0