Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCodeBuild is not picking a configuration from my workspace

This is my build command

xcodebuild -workspace MyApp.xcworkspace \
           -scheme MySchemeName \
           -configuration AdHoc \
           clean archive

It works but its uses the default configuration for the archive scheme (which is release) instead of AdHoc which I specified. In fact if you specify -scheme ASchemeNameThatDosnNotExist it still works and silently ignores the configuration name.

The project is setup like this:

xcodebuild -list
Targets:
    MyApp
    MyAppTests

Build Configurations:
    Debug
    AdHoc
    Release

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

This project contains no schemes.

And the workspace like this:

xcodebuild -workspace MyApp.xcworkspace -list
Schemes:
    MyApp
    Pods
    Pods-AFNetworking
    .. More pods

I.e. There are no targets and no configurations in the workspace.

How do I make a target visible to the workspace? Or is there another way?

like image 811
Robert Avatar asked Oct 15 '25 04:10

Robert


1 Answers

It's impossible to configure target for workspace. You can create a scheme based on a particular target and then build a project passing scheme name. Setting configuration via '-configuration' switch works fine for me. I use xcode v. 5.0.2.

In general a configuration is set via action. You can create multiple schemes for archiving (with different configurations) and there's no need to pass configuration at all. Default configuration will be taken.

like image 69
Opal Avatar answered Oct 17 '25 20:10

Opal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!