Adding a build configuration in Xcode

后端 未结 3 1147
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 05:27

I\'d like to add a new build configuration in Xcode 5, \"QA\", to the other three we currently have (Debug, Distribution, Release). However, when I click \"Editor > Add Conf

相关标签:
3条回答
  • 2020-11-28 05:43
    Project -> Scheme -> Build Configuration -> Build Configuration File
    

    You are able to duplicate an existing Build Configuration to use it in you scheme

    Navigate to Configurations

    • Editor -> Add Configuration -> Duplicate <configuration_name> Configuration
    • Click plus button under configuration list

    Much more powerful feature is build configuration file (.xcconfig) which you can assign for your configuration

    File -> New -> File... -> Configuration Settings File
    //Do not include it to any target
    
    Select your configuration -> chose `configuration file`
    

    For example add name into Build Configuration File

    PRODUCT_NAME = THE BEST NAME
    

    The result you can find on Build Settings

    CocoaPods and Build Configuration File

    project '<project_name>', '<scheme_name_1>' => :<build_congiguration_file_name_1>
    //For example
    project 'MyProject', 'debug' => :conf1, 'release' => :conf2
    
    0 讨论(0)
  • 2020-11-28 05:45

    I ran into this same problem and figured it out. Here is a screenshot of the problem. I want to duplicate my "Release" configuration, but the option to do so is disabled. Why?

    enter image description here

    The answer is hiding behind this little button here (circled in red)...

    enter image description here

    This menu will open to reveal that you currently have a build target selected. Build targets don't have their own configurations.

    Configurations are project-wide. If you select the project file, the menu will work, as shown here.

    You also have to make sure that the 'Info' tab is selected, the options are still greyed out if you are on the 'Build Settings' page

    enter image description here

    0 讨论(0)
  • 2020-11-28 06:10

    For Xcode 11 + , you can add your custom configuration here:

    0 讨论(0)
提交回复
热议问题