Search code examples
iosxcodexcodebuild

Error building iOS workspace from terminal


I'm having problems building an iOS app from the terminal. I'm following the xcodebuild -h help but I can't make it work... I've been googling a lot the errors I'm getting but can't find an answer to this...

This is what I'm doing:

xcodebuild -workspace AppName.xcworkspace -scheme 'Integration Tests' -configuration Debug

And the error I'm getting is:

The following build commands failed:
ProcessPCH /Users/UserName/Library/Developer/Xcode/DerivedData/AppName/Build/PrecompiledHeaders/AppName-Prefix/AppName-Prefix.pch.pth AppName/AppName-Prefix.pch normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
ProcessPCH /Users/UserName/Library/Developer/Xcode/DerivedData/AppName/Build/PrecompiledHeaders/AppName-Prefix/AppName-Prefix.pch.pth AppName/AppName-Prefix.pch normal armv6 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

I can't find whats failing, using xCode I do can compile and run this app without problem... Any idea in whats happening?

Thanks!


Solution

  • Have you tried selecting your xcode with xcode-select?

    xcode-select -switch /Applications/Xcode.app/Contents/Developer
    

    In most cases…

    You could also try to renew the xcodebuild via

    $sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
    $cd /usr/bin
    $sudo rm xcodebuild
    $ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild xcodebuild