DNB5brims
DNB5brims

Reputation: 30598

How can I use terminal to assign the cert, and build an iOS application?

I would like to use terminal to automatic my application build working flow, how can I change the cert and build the application from terminal only? Thanks.

Upvotes: 0

Views: 265

Answers (1)

user207128
user207128

Reputation:

Yes, you may use terminal to build the app. There is an xcodebuild tool which allows to do that ($ man xcodebuild would explain a lot).

As for your question – as I understand you're trying to make a build with a different mobileprovision profile. It's possible by adding PROVISIONING_PROFILE parameter to xcodebuild command. And you need to provide profile's UUID.

In two words, each mobileprovision profile has an identifier and it should be "installed" (installation via Xcode is OK). So, you should follow these steps to make a build from the terminal:

  1. Check if the mobileprovision profile is installed (it could be done from Xcode).
  2. Get the mobileprovisioning UUID. The simplest way to do that is the next:

    • Find the profile in Xcode's organizer
    • Reveal it in Finder (profile's file name differs from the profile name)
    • Open the profile in vim or any other editor (it's a signed plist so don't be afraid of the binary part)
    • Find the <key>UUID</key> string and the corresponding identifier (it should look like AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE), BTW this UUID is used by Xcode as a file name.
  3. Go to your project's folder in terminal (this one which contains .xcodeproj) and run the next command: xcodebuild PROVISIONING_PROFILE=<YOUR-PROFILE-IDENTIFIER>

That would make a build and store its results in build directory.

You may also specify configuration which should be used, base sdk, target and a lot of different parameters.

Upvotes: 1

Related Questions