Home

Awesome

Cook 👨🏻‍🍳

Cook is a macOS command line tool wrapped around Riley Testut's AltSign to automate common iOS development tasks, such as managing iOS certificates, app identifiers, devices, provisioning profiles and resigning .ipa files. It works with free Apple IDs (not enrolled in the developer program).

<img src="https://user-images.githubusercontent.com/11541888/71422933-f1f39600-2685-11ea-8e03-06061e74398f.png" alt="Cook demo" title="cook">

Usage

./cook [AUTHENTICATION] [RECIPE] [RECIPE_ARGUMENTS]

Generic arguments

-h, --help prints usage information

-v, --verbose enables verbose mode

-j, --json use json output (all --output-* args are ignored in this mode)

Authentication

To authenticate you can pass the following arguments to any recipe: --appleId (your Apple ID's email) and --password (Apple ID's Password).

If you prefer, you can set these environment variables instead: COOK_APPLEID_EMAIL and COOK_APPLEID_PASSWORD.

Pass --2fa-code to specify the six-digit two factor authentication code.

You can also specify --base64-anisette-data to use custom base64 encoded anisette data in your requests (for example, generated with anisette_server recipe).

NOTE: Your Apple ID is never sent to anyone but Apple. Feel free to create a new Apple ID account to test it.

Recipes

JSON Mode

In JSON mode (-j, --json flag), command output is formatted as JSON.

<details> <summary>See possible JSON responses</summary>
 'success':               '0' or '1'
 'error':                 Error description (if success is 0)

 - create_certificate recipe
   'pem_cert':            Plain text PEM cert
   'base64_p12_cert':     Base 64 encoded P12 cert
   'p12_password':        Plain text P12 password

 - update_profile recipe
   'base_64_profile':     Base 64 encoded mobileprovision

 - download_profiles recipe
   'profiles_count':      Number of profiles downloaded
   'base64_profile_i':    i-th base 64 encoded mobileprovision (0<i<=profiles_count)
 
 - anisette_server recipe
   'base64_encoded_data': Base 64 encoded anisette data
</details>

Sample usage

Here are some real world examples on how to use cook (authentication part is omitted):

<details> <summary>See examples</summary> </details>

Installation

Download latest cook.zip release from the releases page to your downloads folder and unzip it (or build manually from Xcode).

If you haven't already, you should install and enable the Mail.app plugin called CookMailPlugin (this is needed to fetch the correct headers to communicate with Apple's servers).

<details> <summary>See steps to install CookMailPlugin (only once):</summary>

Run the following commands:

$ cd ~/downloads/cook/
$ sudo codesign -f -s - CookMailPlugin.mailbundle
$ sudo mkdir -p /Library/Mail/Bundles
$ sudo cp -R CookMailPlugin.mailbundle /Library/Mail/Bundles
$ sudo defaults write "/Library/Preferences/com.apple.mail" EnableBundles 1

Then enable the plugin:

<img src="https://user-images.githubusercontent.com/11541888/71265083-c8fd9900-2345-11ea-9ac9-73031d9faf0e.png" alt="Cook mail plugin" title="mail plugin" width="50%"> </details>

Once the plugin is installed and enabled, you can use cook from the command line:

$ cd ~/downloads/cook/
$ ./cook -h

Build manually

Run the following commands:

$ cd ~/downloads
$ git clone https://github.com/n3d1117/cook.git
$ cd cook/
$ open cook.xcodeproj

Credits

License

Licensed under GNU General Public License v3.0. See LICENSE file for further information.