最白目
最白目

Reputation: 3654

Read Xcode Build Settings from terminal

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

Answers (1)

trojanfoe
trojanfoe

Reputation: 122458

Probably not the most elegant solution...

export PROVISIONING_PROFILE=$(xcodebuild -showBuildSettings -project <project>.xcodeproj | grep PROVISIONING_PROFILE | cut -d' ' -c3)

Upvotes: 5

Related Questions