Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

Fixed app_ids:add. Added certificates:create and profiles:create functionality with flags #185

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions Automated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
![Cupertino](https://raw.github.com/nomad/nomad.github.io/assets/cupertino-banner.png)

Automate the entire process of submitting a new app to development devices. Or automate the entire process of submitting a production app to the app store, now with more security!

## Requirements
1. Keypair Passphrase
1. ADC Account & Login Credentials
1. ADC Team Name (only if on multiple teams)
1. App Name
1. Local Environment Requirements
`bundle install && bundle exec bin/ios`

## Process

### Development
1. Generate Keypair
`$ ssh-keygen -t rsa -b 2048 -f keypair -N passphrase`
1. Generate CSR
`$ openssl req -nodes -new -key keypair -passin pass:passphrase -out request.csr -subj "/C=US/ST=NC/L=Raleigh/O=Queue Software/OU=DropSource/CN=UserApp`
1. Generate App ID
`$ ios -u user -p pass --team team app_ids:add DropSourceApp=com.queuesoftware.dropsource`
1. Generate & Download Certificate
`$ ios -u user -p pass --team team certificates:create --download --type development request.csr`
1. Add Devices
`$ ios devices:add "iPad 2"=def456 "iPad 3"=ghi789 ...`
1. Generate & Download Profile
`$ ios -u user -p pass --team team profiles:create --download "Dev Profile" "com.queuesoftware.dropsource"`

### Production
1. Generate Keypair
`$ ssh-keygen -t rsa -b 4096 -f keypair -N passphrase`
1. Generate CSR
`$ openssl req -nodes -new -key keypair -passin pass:passphrase -out request.csr -subj "/C=US/ST=NC/L=Raleigh/O=Queue Software/OU=DropSource/CN=UserApp`
1. Generate App ID
`$ ios -u user -p pass --team team app_ids:add --type distribution DropSourceApp=com.queuesoftware.dropsource`
1. Generate & Download Certificate
`$ cert=(ios -u user -p pass --team team certificates:create --download --type production --internalid request.csr com.queuesoftware.dropsource)`
1. Generate & Download Profile
`$ ios -u user -p pass --team team profiles:create --type production --certificateid $cert --download "Dev Profile" "com.queuesoftware.dropsource"`
36 changes: 36 additions & 0 deletions CSR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
![Cupertino](https://raw.github.com/nomad/nomad.github.io/assets/cupertino-banner.png)

## Generate Certificate Signing Request

### Option 1 - OSX Keychain & Security Tools
Generate the RSA keypair in the login keychain in OSX
```
$ security create-keypair -s 2048 [name]
```

Generate the CSR based on key in keychain
```
$ certtool r outputFileName [options]
```

### Option 2 - Linux Tools

1. Generate the RSA keypair
Example:
```
$ ssh-keygen -t rsa -b 2048 -f keypair -N passphrase
```
Options:
```
$ ssh-keygen -t rsa -b 2048 -f [keys-name] -N [user-password]
```

1. Generate the CSR
Example:
```
$ openssl req -nodes -new -key keypair -passin pass:passphrase -out request.csr -subj "/C=US/ST=NC/L=Raleigh/O=Queue Software/OU=DropSource/CN=UserApp"
```
Options:
```
$ openssl req -nodes -new -key [private-key-name] -passin pass:[user-password] -out [csr-file-name] -subj "/C=US/ST=NC/L=Raleigh/O=Queue Software/OU=DropSource/CN=[app-name]"
```
52 changes: 44 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@ $ gem install cupertino

```
$ ios login
$ ios [command] -u [username] -p [password]
```

_Credentials are saved in the Keychain. You will not be prompted for your username or password by commands while you are logged in. (Mac only)_

### Team Selection

```
$ ios [command] --team [TEAM]
```

This is also an interactive choice

### Devices

```
Expand Down Expand Up @@ -59,6 +68,23 @@ $ ios profiles:list
+----------------------------------+--------------+---------+
```

```
$ ios profiles:create "Profile 1" "ABCDEFG123.com.company.app"
Development profile created with all certificates and all devices

$ ios profiles:create --download "Profile 1" "ABCDEFG123.com.company.app"
Downloaded Profile_1.mobileprovision

$ ios profiles:create --certificateid "AB123XYZG" "Profile 1" "ABCDEFG123.com.company.app"
Development profile created with 1 certificate and all devices

$ ios profiles:create --type appstore --certificateid "AB123XYZG" "Profile 1" "ABCDEFG123.com.company.app"
App Store profile created called Profile 1

$ ios profiles:create --type adhoc --certificateid "AB123XYZG" "Profile 1" "ABCDEFG123.com.company.app"
Ad Hoc profile created with 1 certificate and all devices
```

---

```
Expand Down Expand Up @@ -139,6 +165,21 @@ $ ios certificates:download --type distribution
$ ios certificates:download NAME
```

```
$ ios certificates:create request.csr
$ ios certificates:create --type devpush request.csr 123ABCDEFG.com.mattt.bundle
$ ios certificates:create --type production request.csr
$ ios certificates:create --type prodpush request.csr 123ABCDEFG.com.mattt.bundle
$ ios certificates:create --type prodpush --download --internalid request.csr
$ ios certificates:create --download request.csr
$ ios certificates:create --download --internalid --type TYPE CSR (APPID)
```
App ID is required for Push Certificates.

The download flag retrieves the certificate file to the current directory

The internalid flag quiets all output but returns Apple's internal id for the created certificate to the STDOUT. Can be used in combination with the download flag.

## CSV Output

The following commands will format their output as [comma-separated values](http://en.wikipedia.org/wiki/Comma-separated_values) when the `--format csv` argument is passed:
Expand All @@ -155,6 +196,7 @@ The following commands will format their output as [comma-separated values](http
- `devices:add`
- `devices:list`
- `profiles:list`
- `profiles:create`
- `profiles:manage:devices`
- `profiles:manage:devices:add`
- `profiles:manage:devices:remove`
Expand All @@ -163,20 +205,14 @@ The following commands will format their output as [comma-separated values](http
- `profiles:devices:list`
- `certificates:list`
- `certificates:download`
- `certificates:create`
- `app_ids:add`
- `app_ids:list`

## Proxies

Cupertino will access the provisioning portal through a proxy if the `HTTP_PROXY` environment variable is set, with optional credentials `HTTP_PROXY_USER` and `HTTP_PROXY_PASSWORD`.

## Contact

Mattt Thompson

- http://github.com/mattt
- http://twitter.com/mattt
- m@mattt.me

## License

Cupertino is available under the MIT license. See the LICENSE file for more info.
1 change: 1 addition & 0 deletions cupertino.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Gem::Specification.new do |s|

s.add_development_dependency "rspec"
s.add_development_dependency "rake"
s.add_development_dependency "byebug"

s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|log|pkg|script|spec|test|vendor)/ }
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Expand Down