Upload mappings for Android
- 1
Download CLI
Required - 2
Authenticate
RequiredTo authenticate the CLI, you can call the
logincommand and follow the instructions:TerminalIf you are using the CLI in a CI/CD environment such as GitHub Actions, you can set environment variables to authenticate:
Environment Variable Description Source POSTHOG_CLI_HOSTThe PostHog host to connect to [default: https://us.posthog.com] Project settings POSTHOG_CLI_ENV_IDPostHog project ID Project settings POSTHOG_CLI_TOKENPersonal API key with error tracking writeandorganization readscopesAPI key settings You can also use the
--hostoption instead of thePOSTHOG_CLI_HOSTenvironment variable to target a different PostHog instance or region. For EU users:Terminal - 3
Inject and upload
RequiredAGP v8 or later
Automatic mappings uploading is handled through the Gradle build process on Android.
Install the PostHog Android Gradle Plugin on your app's
build.gradle.ktsfile.Kotlin