Configuration & .env
appitool uses a strict, deterministic configuration model. Commands resolve CLI options with environment variable fallbacks, while internal tasks, services, and flow presets receive resolved values explicitly.
Resolution Priority
Options and credentials are resolved in the following priority order (highest to lowest):
- Explicit CLI Flags (e.g.,
-b com.example.app,--apple-key-id ...) - Process Environment Variables (already exported in your shell or CI runner)
.envFile (automatically loaded from the current working directory if present; existing environment variables are not overwritten)
.env Parser (EnvLoader)
The built-in EnvLoader parses .env files without external dependencies and supports:
- Comments: Full-line
#comments and trailing inline comments preceded by a space (KEY=value # comment). exportprefix: Standard shell syntax likeexport APPLE_KEY_ID=2X9R4HXF34.- Single and double quotes: Single quotes (
'...') preserve literal values; double quotes ("...") unescape\n,\r,\t,\", and\\. - Multiline quoted values: Multiline PEM keys or JSON payloads enclosed in quotes.
=preservation: Base64 padding (=) and URL query strings (?token=...) are preserved intact.- Tilde (
~) expansion: Paths starting with~/expand to the current user's home directory where path resolution is supported. - Empty value handling: Keys with empty or whitespace-only values (e.g.,
MATCH_GIT_BRANCH=) are skipped during.envinjection and treated as unset when read viaEnvLoader.value(for:), so built-in defaults and fallbacks apply across both.envfiles and CI/shell environments.
Environment Variables Reference
Identifier Resolution Order
App identifiers are resolved the same way by every command: CLI option → .env variable → local project detection.
| Identifier | CLI Option | .env Variable | Project Detection |
|---|---|---|---|
| iOS bundle ID | -b, --bundle-id | APPLE_BUNDLE_ID | Main target bundle ID from the local Xcode project |
| Android package name | --package-name | GOOGLE_PACKAGE_NAME | applicationId / namespace from the local Android project |
| Firebase App ID | --firebase-app-id | FIREBASE_IOS_APP_ID / FIREBASE_ANDROID_APP_ID (by platform) | — |
flow iosandflow androidskip the generic project detection here because their presets detect identifiers themselves (scheme- and flavor-aware).
Apple App Store Connect & Developer Portal
| Variable | Description | Example / Default |
|---|---|---|
APPLE_KEY_ID | App Store Connect API Key ID | 2X9R4HXF34 |
APPLE_ISSUER_ID | App Store Connect API Issuer UUID | 57246542-96fe-1a63-e053-0824d011072a |
APPLE_KEY | Path to .p8 file, raw PEM string, or Base64-encoded .p8 | ./AuthKey_2X9R4HXF34.p8 |
APPLE_BUNDLE_ID | Default iOS bundle identifier | com.example.app |
APPLE_TEAM_ID | Apple Developer Team ID (10-character alphanumeric) | ABCDE12345 |
iOS xcodebuild Configuration
| Variable | Description | Default / Behavior |
|---|---|---|
XCODE_WORKSPACE | Path to .xcworkspace | Auto-discovered in . or ios/ |
XCODE_PROJECT | Path to .xcodeproj | Auto-discovered in . or ios/ |
XCODE_SCHEME | Xcode scheme name to build | Auto-inferred via xcodebuild -list -json |
XCODE_CONFIGURATION | Build configuration (Release or Debug) | Release |
XCODEBUILD_FORMATTER | Pipe formatter for xcodebuild output | xcbeautify --renderer github-actions |
Google Play Developer API
| Variable | Description | Example / Default |
|---|---|---|
GOOGLE_KEY | Path to Service Account JSON, raw JSON string, or Base64 JSON | ./service-account.json |
GOOGLE_PACKAGE_NAME | Target Android application package name | com.example.app |
GOOGLE_PLAY_ACCOUNT_ID | Play Console account ID for google user commands: the number in play.google.com/console/developers/<id> (not the Google Cloud project, service account, or package name). --account-id overrides it. | 1234567890123456789 |
Store Assets (apple assets & google assets)
| Variable | Description | Default / Behavior |
|---|---|---|
STORE_ASSETS_PATH | Folder that assets and metadata download write to and upload read from by default. Absolute, ~-prefixed, or relative to the current directory. Store folders go directly inside it: <path>/apple/<locale>/<type|metadata>/ and <path>/google/<locale>/<type|metadata>/ (no project folder, since the path is project-specific). -o, --output (download) and -f, --file (upload) still take precedence. | Unset or empty: ~/.appitool/assets/<project>/<store>/ |
APPLE_REVIEW_DEMO_PASSWORD | App Review demo account password sent by apple metadata upload when it differs from the current value. Never written to or read from metadata files; masked in output. | Unset: password is not changed |
Android Gradle & Keystore Signing
| Variable | Description | Default / Behavior |
|---|---|---|
ANDROID_PROJECT_DIR | Android root directory containing gradlew | ./android if present, else . |
ANDROID_FLAVOR | Gradle product flavor (e.g., production, staging); fallback for build android --flavor and flow android --flavor | None |
ANDROID_CONFIGURATION | Build type (Release or Debug) | Release |
ANDROID_KEYSTORE_PATH | Path to local .keystore / .jks file | None |
ANDROID_KEYSTORE | Base64-encoded keystore content (decoded to temporary keystore) | None |
ANDROID_KEYSTORE_PASSWORD | Keystore store password | None |
ANDROID_KEY_ALIAS | Key alias inside keystore | None |
ANDROID_KEY_PASSWORD | Key password | None |
Firebase (App Distribution & Auth)
| Variable | Description | Notes |
|---|---|---|
FIREBASE_IOS_APP_ID | Firebase App ID for iOS (1:<project>:ios:<hash>) | Used by check ios, flow ios -d adhoc, and firebase commands |
FIREBASE_ANDROID_APP_ID | Firebase App ID for Android (1:<project>:android:<hash>) | Used by check android, flow android -d adhoc, and firebase commands |
FIREBASE_PROJECT_ID | Firebase / Google Cloud project ID or project number | Falls back to GOOGLE_PROJECT_ID or project number parsed from FIREBASE_*_APP_ID |
GOOGLE_PROJECT_ID | Fallback Google Cloud project ID when FIREBASE_PROJECT_ID is unset | Used by FirebaseProjectOptions |
Match Code Signing (appitool match & flow)
| Variable | Description | Default / Behavior |
|---|---|---|
MATCH_GIT_URL | Git repository URL for certificates/profiles/keystores | Required for Match |
MATCH_GIT_BRANCH | Git branch name | master |
MATCH_GIT_TOKEN | HTTPS Git Personal Access Token or SSH private/deploy key (file path, raw PEM, or Base64) | Falls back to GITHUB_TOKEN, then GH_TOKEN |
MATCH_PASSWORD | Passphrase for AES-256 encryption/decryption | Required for Match |
MATCH_KEYCHAIN_NAME | Custom macOS keychain name or path | appitool |
MATCH_KEYCHAIN_PASSWORD | Password used to create/unlock custom keychain | appipass |
MATCH_READONLY | In flow ios (MatchOptions), read-only unless set to "false" | true (unless "false") |
MATCH_TYPE | Default Match profile type for match ios sync, nuke, and prune when -t, --type is omitted | appstore |
Webhook Notifications
| Variable | Description | Notes |
|---|---|---|
SLACK_URL | Slack incoming webhook URL | Used by slack and flow for success/failure attachments |
SLACK_BOT_TOKEN | Slack bot token (xoxb-…, chat:write scope) for chat.postMessage | Used by slack; takes precedence over SLACK_URL unless --url is passed |
SLACK_CHANNEL | Default channel ID or name for bot token delivery | Used by slack with a bot token |
KOKONO_URL | KokoNo webhook URL (https://kokono.me/notify?token=<token>) | Used by kokono and flow |
KOKONO_E2E_PUBLIC_KEY | Base64 X25519 recipient public key for KokoNo E2E encryption | Optional |
GitHub Self-Update
| Variable | Description | Notes |
|---|---|---|
GITHUB_TOKEN | Optional GitHub PAT to avoid API rate limits in self-update & Match HTTPS PAT fallback | Falls back to GH_TOKEN |
GH_TOKEN | Secondary fallback token in self-update & Match | Checked if GITHUB_TOKEN is unset |
Build Provenance Attestation (flow --attest)
flow ios --attest and flow android --attest read these variables. GitHub Actions sets all of them except APPITOOL_ATTEST_KEY itself (never put those in .env). The OIDC token request variables exist only when the job has permissions: id-token: write, and keyless signing needs them.
| Variable | Description | Notes |
|---|---|---|
ACTIONS_ID_TOKEN_REQUEST_URL, ACTIONS_ID_TOKEN_REQUEST_TOKEN | Request the job's OIDC token (audience sigstore) for the Sigstore signing certificate | Set by GitHub Actions with id-token: write |
GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_REF, GITHUB_SHA | The built source (externalParameters.source, resolvedDependencies) | Set by GitHub Actions |
GITHUB_WORKFLOW_REF | The signing workflow (runDetails.builder.id) | Set by GitHub Actions |
GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT | The run (runDetails.metadata.invocationId) | Set by GitHub Actions |
APPITOOL_ATTEST_KEY | ECDSA P-256 private key for --attest (file path, PEM, or Base64); --attest-key overrides it. Signs without the OIDC token and without a public log entry | Set it from a GitHub Actions secret; never commit it. Ignored without --attest |
CI Mode & Destructive Command Guard
appitool resolves CI mode in precedence order: explicit CLI flag (--ci / --no-ci) → CI → CI provider variables. When CI mode is active, destructive commands (apple delete-*, apple prune-*, apple devices disable, apple invitations cancel, apple versions delete, apple assets delete, google assets delete, google users delete, google invitations cancel, google users revoke, firebase apps delete, firebase users delete, firebase firestore delete, match ios nuke, match ios prune) are skipped as a no-op with a warning and exit code 0.
| Variable | Description | Notes |
|---|---|---|
CI | Generic CI indicator | Any non-empty value except 0, false, no, off enables CI mode; explicit falsy CI suppresses provider fallback |
GITHUB_ACTIONS, GITLAB_CI, BITRISE_IO, CIRCLECI, BUILDKITE, JENKINS_URL, TF_BUILD, TEAMCITY_VERSION, TRAVIS, CODEMAGIC_BUILD_ID, CI_XCODE_CLOUD | Provider-specific CI indicators (checked when CI is unset or blank) | Evaluated with the same truthy/falsy rules (0, false, no, off, and empty strings are ignored) |
Local Storage Architecture (~/.appitool)
appitool centralizes build artifacts, Xcode DerivedData, temporary keystores, and exported certificates under ~/.appitool (AppitoolPaths):
~/.appitool/
├── ios/
│ └── <TargetName>/
│ ├── build/
│ │ └── <version>_<build>[_adhoc|_development]/ # Falls back to <yyyy_MM_dd_HH_mm>
│ │ ├── <Scheme>.xcarchive
│ │ ├── <Scheme>.ipa
│ │ └── <Scheme>.app.dSYM.zip
│ └── derivedData/
├── android/
│ ├── <TargetName>/
│ │ └── build/
│ │ └── <version>_<build>[_adhoc|_development]/ # Falls back to <yyyy_MM_dd_HH_mm>
│ │ ├── <Target>_release.aab
│ │ └── <Target>_release.apk
│ ├── keystores/
│ │ └── <packageName>.keystore
│ └── tmp/
├── certs/
│ └── <type>/
├── assets/ # default store assets root; STORE_ASSETS_PATH replaces assets/<project>/ (older versions used ~/.appitool/screenshots/)
│ └── <project>/
│ ├── apple/<locale>/<type>/ # apple assets download / upload: screenshot types (01_<name>.png) and header|search (one image), .appitool-manifest.json for upload --sync
│ ├── apple/<locale>/metadata/ # apple metadata download / upload: <field>.txt (name, subtitle, description, keywords, …)
│ ├── apple/metadata/ # app-level: copyright, categories, App Review details, content rights, accessibility URL
│ ├── google/<locale>/<type>/ # Used by both download and default bulk upload (01.png, .appitool-manifest.json for upload --sync)
│ ├── google/<locale>/metadata/ # google metadata download / upload: title, short_description, full_description, video
│ └── google/metadata/ # app-level: contact_email, contact_phone, contact_website, default_language
└── match/
└── <UUID>/ # Temporary Git clone working directory (auto-cleaned)Use appitool clean to inspect sizes and prune old build artifacts and iOS derivedData directories safely (certs/ is always preserved; ~/.appitool/assets and the legacy ~/.appitool/screenshots are only cleaned with --assets).
