Skip to content

Repository files navigation

Overview

Tool to upload .ipa files to TestFlight.

It's mostly a wrapper for fastlane pilot upload.
This exists as fastlane pilot upload can sometimes randomly fail. This retries it and add some nice logging.

To do

  • auto increase build number
  • extract project out to a more generic uploader (this one will contain UCB things: .ipa finder)
  • figure out why no fastlane logs (wait, did it succeed quietly??)
  • some way of reading changelog from file

Requirements

  • Python 3
  • git
  • fastlane (pilot)

Project Structure

repo-root/
pyproject.toml
README.md
package-structure.md
src/
pyliot/
__init__.py
...module files...

Install

Install from GitHub

pip install "pyliot @ git+https://github.com/OWNER/REPO.git"

Session-only install (venv)

bash setup_venv.sh

setup_venv.sh creates/uses .venv/ and installs project dependencies.

Quick Start

  1. Create API key (See: Creating Your API Key)
  2. Set parameters/environment variables (See: passing variables and variables docs)
  3. Run uploader
bash upload_to_testflight.sh

upload_to_testflight.sh calls setup_venv.sh and then runs the uploader entrypoint.

Direct module execution (debugging):

.venv/bin/python3 -m pyliot.upload_to_testflight_cmd_entry

Variables

These can be passed either as command line arguments or as environment variables.
CLI arguments override environment variables if both exist.

CLI NameENV NameTypeRequired (Default)Description
--app-store-connect-api-key-issuer-idAPP_STORE_CONNECT_API_KEY_ISSUER_IDstringIdentifies the issuer who created the authentication token.
Look for "Issuer ID" on the App Store Connect API page.
--app-store-connect-api-key-idAPP_STORE_CONNECT_API_KEY_IDstringLook for "Key ID" on your key in the App Store Connect API page.
--app-store-connect-api-key-contentAPP_STORE_CONNECT_API_KEY_CONTENTstringThe raw text contents of your API key (.p8 contents).
--ipa-pathIPA_PATHpath/stringPath to the .ipa file to upload.
--changelogCHANGELOGstringRelease notes text for this TestFlight upload.
--groupsGROUPScomma-separated stringTester groups to distribute to (groupA,groupB). If empty, build still goes to internal testers.
--max-upload-attemptsMAX_UPLOAD_ATTEMPTSint❌ (10)Maximum retry attempts for upload.
--attempt-timeoutATTEMPT_TIMEOUTint❌ (600)Max time each upload attempt can run in seconds.
--show-fastlane-logsSHOW_FASTLANE_LOGSbool❌ (false)

Passing Variables

Locally (.env file)

Put variables in a .env file at project root.
Do not commit this file; it contains sensitive values.

See example.env

Unity Cloud Build (Environment Variables)

Go to configuration -> Advanced Settings -> Environment variables.
Important: some required variables are provided automatically by UCB.

Command Line Arguments

You can pass any variable with CLI flags.

Example:

bash upload_to_testflight.sh \
--app-store-connect-api-key-issuer-id "<issuer-id>" \
--app-store-connect-api-key-id "<key-id>" \
--app-store-connect-api-key-content "<p8-content>" \
--ipa-path "./Builds/iOS/build.ipa" \
--changelog "Internal QA build" \
--groups "Internal QA" \
--max-upload-attempts 10 \
--attempt-timeout 600

Creating Your API Key

This is how the upload script authenticates with App Store Connect.

Create here: https://appstoreconnect.apple.com/access/integrations/api\ Apple docs: https://developer.apple.com/documentation/appstoreconnectapi/creating-api-keys-for-app-store-connect-api

Once you've created and downloaded it (.p8), store it securely. If you open it in a text editor, it should look like this:

-----BEGIN PRIVATE KEY-----
<key-content>
-----END PRIVATE KEY-----

About

Upload .ipa files to testflight. (Wraps fastlane pilot upload)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages