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 7546033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:05:41+00:00 2026-05-30T09:05:41+00:00

I’m building/archiving my Mac app for distribution from a command line call (below), with

  • 0

I’m building/archiving my Mac app for distribution from a command line call (below), with Xcode 4.3 installed. To be clear, I didn’t have a working solution for this problem earlier to Xcode 4.3, so advice for earlier Xcode releases could easily still be valid. Here’s the call:

/usr/bin/xcodebuild -project "ProjectPath/Project.pbxproj" -scheme "Project" -sdk macosx10.7 archive

This runs successfully, and it generates an .xcarchive file, located in my ~/Library/Developer/Xcode/Archives/<date> folder. What’s the proper way to get the path the the archive file generated? I’m looking for a way to get a path to the .app file contained therein, so I can distribute it.

I’ve looked at the MAN page for xcodebuild (and done copious searching online) and didn’t find any clues there.

  • 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-05-30T09:05:42+00:00Added an answer on May 30, 2026 at 9:05 am

    Building on the answer provided here, I came up with a satisfactory multi-part solution. The key to it all, was to use the environment variables Xcode creates during the build.

    First, I have a post-action on the Archive phase of my build scheme (pasted into the Xcode project’s UI). It calls a Python script I wrote (provided in the next section), passing it the names of the environment variables I want to pull out, and a path to a text file:

    # Export the archive paths to be used after Archive finishes
    "${PROJECT_DIR}/Script/grab_env_vars.py" "${PROJECT_DIR}/build/archive-env.txt"
    "ARCHIVE_PATH" "ARCHIVE_PRODUCTS_PATH" "ARCHIVE_DSYMS_PATH"
    "INSTALL_PATH" "WRAPPER_NAME"
    

    That script then writes them to a text file in key = value pairs:

    import sys
    import os
    
    def main(args):
        if len(args) < 2:
            print('No file path passed in to grab_env_vars')
            return
    
        if len(args) < 3:
            print('No environment variable names passed in to grab_env_vars')
    
        output_file = args[1]
    
        output_path = os.path.dirname(output_file)
        if not os.path.exists(output_path):
            os.makedirs(output_path)
    
        with open(output_file, 'w') as f:
            for i in range(2, len(args)):
                arg_name = args[i]
                arg_value = os.environ[arg_name]
                #print('env {}: {}'.format(arg_name, arg_value))
                f.write('{} = {}\n'.format(arg_name, arg_value))
    
    def get_archive_vars(path):
        return dict((line.strip().split(' = ') for line in file(path)))
    
    if __name__ == '__main__':
        main(sys.argv)
    

    Then, finally, in my build script (also Python), I parse out those values and can get to the path of the archive, and the app bundle therein:

    env_vars = grab_env_vars.get_archive_vars(ENV_FILE)
    archive_path = env_vars['ARCHIVE_PRODUCTS_PATH']
    install_path = env_vars['INSTALL_PATH'][1:] #Chop off the leading '/' for the join below
    wrapper_name = env_vars['WRAPPER_NAME']
    archived_app = os.path.join(archive_path, install_path, wrapper_name)
    

    This was the way I solved it, and it should be pretty easily adaptable to other scripting environments. It makes sense with my constraints: I wanted to have as little code as possible in the project, I prefer Python scripting to Bash, and this script is easily reusable in other projects and for other purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.