Codemagic CLI Tools is a collection of command-line utilities designed to simplify Android and iOS app builds, code signing, and deployment. These tools power the codemagic.io CI/CD service but can also be used locally or in other CI/CD environments. The library is currently at version 0.64.0 and sees active development with frequent releases addressing new features, bug fixes, and compatibility updates, often tied to Xcode and App Store Connect changes.
pip install codemagic-cli-toolsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up environment variables for App Store Connect API keys and then use the `app-store-connect fetch-signing-files` CLI command. This command is crucial for managing iOS code signing assets, such as provisioning profiles and certificates. Securely providing credentials via environment variables is a common and recommended practice.
Explicitly specify `--certificates-dir` and `--profiles-dir` arguments if your scripts depend on specific file paths, or update your build environment to expect the new default locations.
Upgrade to v0.62.0 or newer to ensure `app-store-connect publish` correctly fails when `altool` reports errors, providing more reliable feedback on upload status. Check `altool` output carefully if on older versions.
Double-check that `APP_STORE_CONNECT_ISSUER_ID`, `APP_STORE_CONNECT_KEY_IDENTIFIER`, `APP_STORE_CONNECT_PRIVATE_KEY_FILE` (or `GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS`) are set correctly and that the API key has the necessary 'App Manager' permissions for App Store Connect. Use `@env:` or `@file:` prefixes for sensitive values.
Use `android-app-bundle bundletool version` instead.
Explicitly specify the path to your main `.xcodeproj` file using the `--project` argument in your `xcode-project` commands within your `codemagic.yaml` workflow. For example: `xcode-project use-profiles --project ios/MyProject.xcodeproj`.
Modify your `xcode-project use-profiles` command to explicitly target your main application's `.xcodeproj` file, preventing it from processing dependency projects. For example: `xcode-project use-profiles --project ios/YOUR_PROJECT_NAME.xcodeproj` or `xcode-project use-profiles --project ios/*.xcodeproj`.
Log in to your Apple Developer account, navigate to 'Certificates, Identifiers & Profiles', edit the relevant provisioning profile to add the missing entitlement(s), ensure the correct bundle identifier is used, then download and re-upload the updated profile to Codemagic. Alternatively, ensure the capability is enabled for your App ID in the Apple Developer Portal.
Log in to your Apple Developer account on App Store Connect and review the 'Agreements, Tax, and Banking' section to accept any pending agreements or renew expired ones.
Install the tools using pip: `python3 -m pip install codemagic-cli-tools`. If already installed, ensure your PATH environment variable includes the directory where pip installs executables (e.g., `~/.local/bin` on Linux/macOS or Python's Scripts directory on Windows). You might also need to restart your terminal.