Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8884511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:04:37+00:00 2026-06-14T21:04:37+00:00

I want to use xcodebuild to archive one scheme with 3 different configurations, but

  • 0

I want to use xcodebuild to archive one scheme with 3 different configurations, but the configuration is never changed with archive action.

Here is the content in .sh

xcodebuild -workspace myApp.xcodeproj/project.xcworkspace -sdk iphoneos -scheme myApp -configuration Distribution clean archive

xcodebuild -workspace myApp.xcodeproj/project.xcworkspace -sdk iphoneos -scheme myApp -configuration Inhouse clean archive

xcodebuild -workspace myApp.xcodeproj/project.xcworkspace -sdk iphoneos -scheme myApp -configuration Release clean archive

update: build action works fine

xcodebuild -workspace myApp.xcodeproj/project.xcworkspace -sdk iphoneos -scheme myApp -configuration Distribution clean build

xcodebuild -workspace myApp.xcodeproj/project.xcworkspace -sdk iphoneos -scheme myApp -configuration Inhouse clean build

xcodebuild -workspace myApp.xcodeproj/project.xcworkspace -sdk iphoneos -scheme myApp -configuration Release clean build

I am using Xcode4.5/iOS6.0, It works fine with build action(configuration changes each xcodebuild run), any solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:04:38+00:00Added an answer on June 14, 2026 at 9:04 pm

    The configuration for archive action has no effect, maybe it’s a bug of xcodebuild.

    In order to change the configuration of archive, I write a shell script change the configuration of scheme each time before run archive command.

    May not be the best solution, but solve the problem.

    Here is the code:

    #! /bin/sh
    
    # Define Scheme name
    PACKAGE_PROJECT_NAME="MyApp"
    PACKAGE_SCHEME_NAME="MyApp"
    
    # Get Username
    PACKAGE_USER_NAME="$(whoami)"
    
    # Scheme Path
    PACKAGE_SCHEME_DIR="$SRCROOT/${PACKAGE_PROJECT_NAME}.xcodeproj/xcuserdata/${PACKAGE_USER_NAME}.xcuserdatad/xcschemes"
    PACKAGE_SCHEME_PATH="${PACKAGE_SCHEME_DIR}/${PACKAGE_SCHEME_NAME}.xcscheme"
    
    echo "PACKAGE_SCHEME_PATH = ${PACKAGE_SCHEME_PATH}"
    
    # Set Configuration
    # WARNING: BACKUP_CONFIGURATION MUST be same with build configuration of archive action in MyApp scheme
    BACKUP_CONFIGURATION="Distribution"
    
    # WARNING: Archive name of archive action in MyApp scheme MUST be set explicitly.
    # WARNING: BACKUP_ARCHIVENAME MUST be same with archive name of archive action in MyApp scheme
    BACKUP_ARCHIVENAME="MyAppArchive"
    
    echo "BACKUP_CONFIGURATION = ${BACKUP_CONFIGURATION}"
    echo "BACKUP_ARCHIVENAME = ${BACKUP_ARCHIVENAME}"
    
    # -------------------------------Archive Distribution---------------------------------------
    # Set Configuration
    OLD_CONFIGURATION="${BACKUP_CONFIGURATION}"
    NEW_CONFIGURATION="Distribution"
    OLD_ARCHIVENAME="${BACKUP_ARCHIVENAME}"
    NEW_ARCHIVENAME="${PACKAGE_SCHEME_NAME}_${NEW_CONFIGURATION}"
    
    # Clean
    xcodebuild -workspace ${PACKAGE_PROJECT_NAME}.xcodeproj/project.xcworkspace -sdk iphoneos -scheme ${PACKAGE_SCHEME_NAME} -configuration ${NEW_CONFIGURATION} clean
    
    # Change archive configuration
    sed -i .bak "/<ArchiveAction/,/<\/ArchiveAction>/{s/\"${OLD_CONFIGURATION}\"/\"${NEW_CONFIGURATION}\"/;s/\"${OLD_ARCHIVENAME}\"/\"${NEW_ARCHIVENAME}\"/;}" ${PACKAGE_SCHEME_PATH}
    
    # Archive
    xcodebuild -workspace ${PACKAGE_PROJECT_NAME}.xcodeproj/project.xcworkspace -sdk iphoneos -scheme ${PACKAGE_SCHEME_NAME} archive
    
    # -------------------------------Archive Inhouse------------------------------------------
    # Set Configuration
    OLD_CONFIGURATION="${NEW_CONFIGURATION}"
    NEW_CONFIGURATION="Inhouse"
    OLD_ARCHIVENAME="${NEW_ARCHIVENAME}"
    NEW_ARCHIVENAME="${PACKAGE_SCHEME_NAME}_${NEW_CONFIGURATION}"
    
    # Clean
    xcodebuild -workspace ${PACKAGE_PROJECT_NAME}.xcodeproj/project.xcworkspace -sdk iphoneos -scheme ${PACKAGE_SCHEME_NAME} -configuration ${NEW_CONFIGURATION} clean
    
    # Change archive configuration
    sed -i .bak "/<ArchiveAction/,/<\/ArchiveAction>/{s/\"${OLD_CONFIGURATION}\"/\"${NEW_CONFIGURATION}\"/;s/\"${OLD_ARCHIVENAME}\"/\"${NEW_ARCHIVENAME}\"/;}" ${PACKAGE_SCHEME_PATH}
    
    # Archive
    xcodebuild -workspace ${PACKAGE_PROJECT_NAME}.xcodeproj/project.xcworkspace -sdk iphoneos -scheme ${PACKAGE_SCHEME_NAME} archive
    
    # -------------------------------Archive Adhoc-------------------------------------------
    # Set Configuration
    OLD_CONFIGURATION="${NEW_CONFIGURATION}"
    NEW_CONFIGURATION="Release"
    OLD_ARCHIVENAME="${NEW_ARCHIVENAME}"
    NEW_ARCHIVENAME="${PACKAGE_SCHEME_NAME}_${NEW_CONFIGURATION}"
    
    # Clean
    xcodebuild -workspace ${PACKAGE_PROJECT_NAME}.xcodeproj/project.xcworkspace -sdk iphoneos -scheme ${PACKAGE_SCHEME_NAME} -configuration ${NEW_CONFIGURATION} clean
    
    # Change archive configuration
    sed -i .bak "/<ArchiveAction/,/<\/ArchiveAction>/{s/\"${OLD_CONFIGURATION}\"/\"${NEW_CONFIGURATION}\"/;s/\"${OLD_ARCHIVENAME}\"/\"${NEW_ARCHIVENAME}\"/;}" ${PACKAGE_SCHEME_PATH}
    
    # Archive
    xcodebuild -workspace ${PACKAGE_PROJECT_NAME}.xcodeproj/project.xcworkspace -sdk iphoneos -scheme ${PACKAGE_SCHEME_NAME} archive
    
    # ------------------------------Restore Configuration-------------------------------------
    sed -i .bak "/<ArchiveAction/,/<\/ArchiveAction>/{s/\"${NEW_CONFIGURATION}\"/\"${BACKUP_CONFIGURATION}\"/;s/\"${NEW_ARCHIVENAME}\"/\"${BACKUP_ARCHIVENAME}\"/;}" ${PACKAGE_SCHEME_PATH}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use from multiple upload image in codeigniter but problem is here that
I want use BYTE_ORDER macro in my Xcode project but i can't because i
I want use JQuery mobile for the front-end of my mobile application, but I
I want use a typedef struct that isn't already defined, but it is later.
I want use Kendo ui window, but I can't see what the problem is.
I believe svn externals is what I want to use but would like some
I want use the Scintilla controls and the RadControls for Winforms, but I do
I want use page that has this form: <form method=post action=modules.php?name=search> <input onkeypress=FKeyPress(this); onkeydown=FKeyDown(this);
I want use ORDER BY RAND() query mysql. But I have some question want
I need to use HTML comments to store specific data, but I don't want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.