• Stars
    star
    317
  • Rank 132,216 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Your friendly iOS Code Signing Doctor

codesigndoc

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:

  1. Gathers all information required for the specified Xcode action.
  2. Runs a clean Xcode Archive or Xcode Build For Testing on your project.
  3. From the generated artifact it collects the Code Signing settings Xcode used during the action.
  4. Prints the list of required code signing files.
  5. Optionally it can also search for, and export these files.

Install / Run

One-liner

Just open up your Terminal.app on OS X, copy-paste this into it and hit Enter to run:

Xcode

For Archiving & Exporting IPA for 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 step will need them):

bash -l -c "$(curl -sfL https://raw.githubusercontent.com/bitrise-io/codesigndoc/master/_scripts/install_wrap-xcode.sh)"

For UI testing on real device for 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.

Manual install & run

  1. download the current release - it's a single, stand-alone binary
    • example (don't forget to replace the VERSIONNUMBER in the URL!): curl -sfL https://github.com/bitrise-io/codesigndoc/releases/download/VERSIONNUMBER/codesigndoc-Darwin-x86_64 > ./codesigndoc
  2. chmod +x it, so you can run it
    • if you followed the previous example: chmod +x ./codesigndoc
  3. run the scan command of the tool
    • if you followed the previous examples:
      • Xcode project scanner: ./codesigndoc scan xcode
      • Xcode project scanner for UI test targets: ./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.

Manually finding the required base code signing files for an Xcode project or workspace

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.

Troubleshooting the UITest scanner

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.

Development

Create a new release

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.

  1. Merge all changes to master.
  2. Increase the version in version/version.go.
  3. Merge the version change to master.
  4. Push version tag to master. This will trigger an automated release process.
  5. Download from GitHub and test the new release.
  6. Run bitrise run update-wrapper-versions. This will update the version numbers in the install scripts.
  7. Merge the updated wrapper versions.

More Repositories

1

bitrise

Bitrise runner CLI - run your automations on your Mac or Linux machine -
Go
836
star
2

android

ARCHIVE: This repository is sunsetted. The new image's repository will be made available later. | Android Docker image
Dockerfile
399
star
3

envman

Environment variable manager
Go
203
star
4

devcenter

HTML
168
star
5

bitrise.io

Bitrise.io public issues
162
star
6

bitrise-steplib

New Bitrise StepLib
151
star
7

bitrise-workflow-editor

Bitrise Workflow Editor
JavaScript
111
star
8

ipa_analyzer

iOS IPA file analyzer: collects embedded mobileprovisioning and Info.plist information from a .ipa, can generate pretty printed JSON output.
Ruby
75
star
9

bitrise-webhooks

Bitrise Webhooks processor
Go
59
star
10

workflow-recipes

50
star
11

android-ndk

ARCHIVE: This repository is sunsetted. The new image's repository will be made available later. | Android with pre-installed NDK docker image. Based on the base Android docker image ( https://github.com/bitrise-io/android ), and extends it with the NDK
Shell
43
star
12

go-utils

Common, utility packages for Go
Go
37
star
13

ioscodesigning

HTML
31
star
14

go-xcode

Go
29
star
15

stepman

Step collection manager
Go
25
star
16

Fruta

Swift
18
star
17

bitrise-base

ARCHIVE: This repository is sunsetted. The new image's repository will be made available later. | Base Bitrise Docker image
Dockerfile
18
star
18

ipa_install_plist_generator

Generates a .plist which can be used for an IPA install & can generate an install link for the .plist file
Ruby
15
star
19

trace-cocoa-sdk

Catch bugs before they reach production — get detailed crash reports and monitor how your app is performing across the entire install base.
Swift
15
star
20

bitrise-contrib

13
star
21

replica

DEPRECATED - Create a CI environment (with Docker / virtual machine)
Go
11
star
22

android-demo-app

Kotlin
10
star
23

xcodebuild-unittest-miniserver

Mini server (written in Go) to perform Xcode Unit Tests through SSH
Go
10
star
24

gows

Go Workspace / Environment Manager, to easily manage the Go Workspace during development.
Go
9
star
25

fastlane

Sample app for using fastlane http://fastlane.tools on Bitrise
Swift
9
star
26

sample-apps-ios-with-bitrise-yml

Simple iOS sample app with bitrise.yml
Swift
8
star
27

releaseman

Your friendly Release manager.
Go
7
star
28

build.issues

Issue / bug tracker for build related issues
7
star
29

stacks

Stack report static site
HTML
7
star
30

android-espresso-ui-test-sample

Java
6
star
31

sample-apps-ios-simple-objc

This is a simple iOS app project for testing and experimenting with Bitrise
Objective-C
6
star
32

bitrise-plugins-analytics

Go
6
star
33

bitrise-plugins-io

A Terminal / Command Line interface for bitrise.io, to manage your apps on bitrise.io right from your terminal / command line.
Go
6
star
34

steps-firebase-test-lab

Bitrise step for Firebase Test Lab
Go
6
star
35

xcode-project

Go
6
star
36

bitrise-init

Go
6
star
37

bitrise-plugins-step

Bitrise Plugin to interact with steps, list them, retrieve information, or create your own!
Go
6
star
38

sample-apps-android-sdk22

Android Sample, requires Android SDK 22
Java
6
star
39

go-android

Go
5
star
40

bitrise-blog

HTML
5
star
41

cmd-bridge

Stripped down, minimal server written in go which executes a command line command
Go
5
star
42

sample-swift-project-with-parallel-ui-test

Swift
5
star
43

ionic-2

JavaScript
5
star
44

sample-apps-react-native-expo

JavaScript
4
star
45

android-ndk-lts

ARCHIVE: This repository is sunsetted. The new image's repository will be made available later. | LTS "pin" of the android-ndk Bitrise Docker image
Dockerfile
4
star
46

sample-apps-wear-os

Sample Android App having a Wear OS module
Java
4
star
47

android-sdk22-code-sign

Android sample, using SDK v22 and includes code signing steps (both for creating the required signing files and to use it)
Java
4
star
48

sample-apps-xamarin-android

C#
4
star
49

sample-project-react-native

Objective-C
3
star
50

bitrise-yml-collection

Collection of example `bitrise.yml` files.
3
star
51

Bitrise-Flutter-Sample

Dart
3
star
52

Bitrise-iOS-Sample

Swift
3
star
53

android-multiple-test-results-sample

Java
3
star
54

go-steputils

Go
3
star
55

cheat-sheets

Cheat Sheets
3
star
56

addons-template-service

Go
3
star
57

sample-apps-unity3d

C#
3
star
58

github-license-collector

GitHub License Collector: collect all licenses used in repos of a GH org and in all of the dependencies of those
Go
3
star
59

bitrise-log-analyzer

Bitrise Log Analyzer tool
Go
3
star
60

steps-xcode-builder

DEPRECATED - in favor of the new Xcode steps: https://github.com/bitrise-io/?utf8=✓&query=steps-xcode-
Shell
3
star
61

bitrise-cli-webui

Simple local Web UI for Bitrise CLI - Work-in-Progress
Go
3
star
62

post-jira-comment-with-build-details-step

Shell
3
star
63

bitrise-oauth

Go
2
star
64

Bitrise-iOS-Fastlane-Sample

Minimal Fastlane iOS Sample
Swift
2
star
65

ReactNativeSample

Sample up for building React Native projects on bitrise.io
Objective-C
2
star
66

appetize-deploy-step

Shell
2
star
67

xamarin-builder

Ruby
2
star
68

sample-bitrise-yml-from-repo

Sample project, demonstrates how you can use your `bitrise.yml` directly from your repository for builds on bitrise.io
2
star
69

gotgen

Minimalistic Go Template based Generator
Go
2
star
70

internal-sample-app-ionic

TypeScript
2
star
71

steps-utils-bash-toolkit

Bash script toolkit: script snippets for debugging, testing, ...
Shell
2
star
72

Bitrise-Android-ProductFlavors-Sample

Kotlin
2
star
73

bitrise-step-collection

DEPRECATED - in favor of the new, unified StepLib: https://github.com/bitrise-io/bitrise-steplib
Ruby
2
star
74

bitrise-add-new-project

Go
2
star
75

steps-ipa-inspector

Ruby
2
star
76

bitrise-build-cache-cli

Bitrise Build Cache CLI
Go
2
star
77

bitrise-script-collection

Collection of copy-paste ready scripts which you can run on Bitrise.io
Shell
2
star
78

bitrise-docker-ssh

Dockerfile
2
star
79

go-xamarin

Go
2
star
80

goinp

Interactive CLI in Go (test)
Go
2
star
81

Bitrise-Android-Modules-Sample

Kotlin
2
star
82

sample-apps-ios-xcode7

Sample Xcode 7 iOS project
Swift
2
star
83

depman

DEPRECATED - Simple dependency manager
Go
2
star
84

steps-bash-script

DEPRECATED - use https://github.com/bitrise-io/steps-script instead
Shell
2
star
85

sample-apps-ios-react-native

2
star
86

sample-apps-ios-cocoapods

A sample iOS app which uses CocoaPods
Objective-C
2
star
87

Bitrise-Ionic-Sample

Sample Ionic app with tabs. It is using Cordova and Angular.
TypeScript
2
star
88

identity-info-server

Go
2
star
89

android-ndk-sample-app

Trivial NDK example, based on Android NDK hello-jni sample & https://github.com/mattlogan/NDKTest projects
Java
2
star
90

sample-apps-cordova-with-karma-jasmine

Java
1
star
91

sample-apps-ios-simple-objc-xcode9

Objective-C
1
star
92

bitrise-yml-converter

Bitrise YML converter
Go
1
star
93

sample-artifacts

1
star
94

xcodebuild-export-options-generator

Ruby
1
star
95

bitrise-plugin-hello-world

Hello world (base working example) plugin for bitrise; `bitrise :hello-world`
Go
1
star
96

bitrise-plugins-example

Shell
1
star
97

sample-apps-ios-unit-test

Simple iOS Unit Test Sample/Test app
Objective-C
1
star
98

addons-test-backend

Go
1
star
99

datapi

A very simple data collection / storage service
Ruby
1
star
100

sample-tvos-app

Swift
1
star