Reputation: 3654
I found you can get a list of all environment variables from my project`s build settings by doing:
xcodebuild -showBuildSettings -project <project>.xcodeproj
It also prints out the PROVISIONING_PROFILE, which I want to use for a build script
PROVISIONING_PROFILE = d0eff791-6b39-4d9b-a164-3e768f63b333
however if I do a
echo $PROVISIONING_PROFILE
or
sudo echo $PROVISIONING_PROFILE
it prints nothing.
How can I access the ${PROVISIONING_PROFILE}
variable from outside XCode, like in terminal or a build script?
Upvotes: 4
Views: 2213
Reputation: 122458
Probably not the most elegant solution...
export PROVISIONING_PROFILE=$(xcodebuild -showBuildSettings -project <project>.xcodeproj | grep PROVISIONING_PROFILE | cut -d' ' -c3)
Upvotes: 5