iOS: xcodebuild: error: The workspace '' d

2019-07-21 07:42发布

问题:

I'm trying to release a Simulator build for Facebook review of my app.

When I run this command I see a scheme called "Roomify":

xcodebuild -list
Information about project "Roomify":
    Targets:
        Roomify
        RoomifyTests

    Build Configurations:
        Debug
        Release

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    Schemes:
        Roomify
        RoomApp

However, when I try to build it fails telling me the scheme doesn't exist, why so?

    >xcodebuild -arch i386 -sdk iphonesimulator8.3 -workspace Roomify.xcworkspace/ -scheme Roomify
    Build settings from command line:
        ARCHS = i386
        SDKROOT = iphonesimulator8.3

    xcodebuild: error: The workspace 'Roomify' does not contain a scheme named 'Roomify'.

回答1:

Turns out I used the wrong command to list the schemes in my workspace.

Instead of:

xcodebuild -list

Do:

xcodebuild -workspace Roomify.xcworkspace -list