facebookarchive / xctool

An extension for Apple's xcodebuild that makes it easier to test iOS and macOS apps.
Apache License 2.0
6.91k stars 737 forks source link

Cannot find Xcode's plist at: /Library/Developer/CommandLineTools/../Info.plist #751

Closed dimpiax closed 6 years ago

dimpiax commented 6 years ago

macOS High Sierra

Version 10.13.4

Fresh install: brew install xctool

~ » xctool
2018-07-17 15:30:37.353 xctool[55150:1196008] *** Assertion failure in NSString *XcodebuildVersion()_block_invoke(), /tmp/xctool-20171031-25148-trrh1c/xctool-0.3.4/Common/XCToolUtil.m:833
2018-07-17 15:30:37.354 xctool[55150:1196008] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot find Xcode's plist at: /Library/Developer/CommandLineTools/../Info.plist'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff5768732b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fff7ed05c76 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff5768d0c2 +[NSException raise:format:arguments:] + 98
    3   Foundation                          0x00007fff59812a0b -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 165
    4   xctool                              0x0000000108622bc8 __XcodebuildVersion_block_invoke + 525
    5   libdispatch.dylib                   0x00007fff7f8e5e08 _dispatch_client_callout + 8
    6   libdispatch.dylib                   0x00007fff7f8e5dbb dispatch_once_f + 41
    7   xctool                              0x00000001086229b8 XcodebuildVersion + 45
    8   xctool                              0x000000010861ca20 -[XCTool run] + 44
    9   xctool                              0x000000010861bfb3 main + 1508
    10  xctool                              0x0000000108616f24 start + 52
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    55150 abort      xctool
dimpiax commented 6 years ago

Seems that not totally successful Xcode installation, and this is not xctool issue.

Hope xctool in potential cases will show more detailed errors and possible solutions.

How to fix:

~ » xcodebuild
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
------------------------------------------------------------
~ » sudo xcode-select -s /Applications/Xcode.app/Contents/Developer