Is there an environment variable for the Archive directory in Xcode? I wasn't able to find any in the documentation: https://help.apple.com/xcode/mac/8.0/#/itcaec37c2a6
Asked
Active
Viewed 550 times
1 Answers
1
It's called ARCHIVE_PRODUCTS_PATH
or ARCHIVE_PATH
, depending on which one you want.
To find out other useful (undocumented?) environment variables:
I made a script to print all the environment variables available during the archive process.
Add this is as a post-action Archive script (Schemes drop down → Edit Scheme... → Archive (expand dropdown) → Post-actions → Run Script → Paste the following:
#!/bin/sh
exec > ${PROJECT_DIR}/post-archive.log 2>&1
${PROJECT_DIR}/Scripts/print_all_environment_variables.sh
Script: (e.g. print_all_environment_variables.sh
), set
will print all environment variables
#!/bin/sh
set
Now you can have a look at post-archive.log
and it will have a bunch of environment variables (more than 1000 lines). The one you're looking for is:
ARCHIVE_PRODUCTS_PATH='/Users/username/Library/Developer/Xcode/Archives/DATE/Project Name DateTime.xcarchive/Products'
or,
ARCHIVE_PATH='/Users/username/Library/Developer/Xcode/Archives/DATE/Project Name DateTime.xcarchive'

Ben Butterworth
- 22,056
- 10
- 114
- 167
-
Can you please take a look at the following question:https://stackoverflow.com/q/66853550/9409877 – HKS Mar 29 '21 at 11:40