Your friendly iOS Code Signing Doctor.
codesigndoc
collects all the code signing files required for
Xcode Archive and IPA export or Xcode Build For Testing action.
What this tool does:
Just open up your Terminal.app
on OS X, copy-paste this into it and hit Enter
to run:
Xcode
project (project or workspace):Exporting the code signing files of the App target and it's dependent targets for the Archive and IPA generation (e.g: [Xcode Archive & Export for iOS](https://github.com/bitrise-io/steps-xcode-archive) step will need them): ``` bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-io/codesigndoc/master/_scripts/install_wrap-xcode.sh)" ```
Xcode
project (project or workspace) e.g: Xcode Build for testing for iOS & iOS Device Testing:--- _Note: For UI testing you will need the code signing files for the App target and it's dependent targets and for the UI test targets too._ _So you will need to run the `install_wrap-xcode.sh ` and the `install_wrap-xcode-uitests.sh` as well._ --- First you need to export the code signing files of the App target and it's dependent targets: ``` bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-io/codesigndoc/master/_scripts/install_wrap-xcode.sh)" ``` Secondly you need to export the code signing files of the UI test targets: ``` bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-io/codesigndoc/master/_scripts/install_wrap-xcode-uitests.sh)" ``` --- If the UITest scanner cannot find the desired scheme, follow these steps: 1. Make sure your scheme is valid for running a UITest. - It has to contain a UITest target that is enabled to run. 2. Refresh your project settings: - Select the Generic iOS Device target for your scheme in Xcode. - Clean your project: ⌘ Cmd + ↑ Shift + K. - Run a build for testing: ⌘ Cmd + ↑ Shift + U. - Run codesigndoc again.
VERSIONNUMBER
in the URL!):
curl -sfL https://github.com/bitrise-io/codesigndoc/releases/download/VERSIONNUMBER/codesigndoc-Darwin-x86_64 > ./codesigndoc
chmod +x
it, so you can run it
chmod +x ./codesigndoc
scan
command of the tool
./codesigndoc scan xcode
./codesigndoc scan xcodeuitests
Optional xcodebuild flags:
-sdk
: If a value is specified for this flag it'll be passed to xcodebuild as the value of the -sdk
flag. For more info about the values please see xcodebuild's -sdk
flag docs. Example value: iphoneos
")
-destination
: The xcodebuild -destination
option takes as its argument a destination specifier describing the device (or devices) to use as a destination i.e generic/platform=iOS
.
If you'd want to manually check which files are required for archiving your
project (regardless of the distribution type!), you have to do a clean archive
on your Mac, using Xcode's command line tool (xcodebuild
) and check the
logs. The easiest way is open the Terminal app, cd
into the directory where
your Xcode project/workspace file is located, and do a clean archive from
Terminal.
Performing a clean archive from Terminal is as easy as running this command (on
your Mac) if you use an Xcode Workspace: xcodebuild -workspace "YOUR.xcworkspace" -scheme "a Shared scheme" clean archive
or this one if you
use an Xcode Project: xcodebuild -project "YOUR.xcodeproj" -scheme "a Shared scheme" clean archive
In the output you'll see code signing infos, namely you should search for the
text Signing Identity
which is followed by a Provisioning Profile
line.
There might be more than one configuration in the log - these are the
configurations used by Xcode on your Mac when you do an Archive.
To make an Xcode Archive work on any Mac, you need the same Code Signing Identity (certificate) and Provisioning Profile(s). The signing Identities (certificates) and Provisioning Profiles present in the log are required, regardless of the final distribution type you use.
To run the xcodebuild
command and only show these lines you can add the
postfix: | grep -i -e 'Signing Identity' -e 'Provisioning Profile' -e '
to
your call, for example: xcodebuild -workspace "YOUR.xcworkspace" -scheme "a Shared scheme" clean archive | grep -i -e 'Signing Identity' -e 'Provisioning Profile' -e '
. This will run the exact same command, but will filter out every
other text in the output except these lines you're searching for.
By running this command you'll see an output similar to:
Signing Identity: "iPhone Developer: Viktor Benei (F...7)"
Provisioning Profile: "BuildAnything"
(9.......-....-....-....-...........0)
If you see more than one Signing Identity
or Provisioning Profile
line that
means that Xcode had to switch between code signing configurations to be able to
create your archive. All of the listed certificates & provisioning profiles
have to be available to create an archive of your project with your current
code signing settings.
If the UITest scanner cannot find the desired scheme, follow these steps:
Make sure your scheme is valid for running a UITest.
Refresh your project settings:
You must do the release in two steps. You cannot merge version/version.go
changes and bitrise run update-wrapper-versions
changes in one step, because
the install scripts have to refer to valid, existing releases.
version/version.go
.bitrise run update-wrapper-versions
. This will update the version numbers in the install scripts.