Back to Expo

Submit to the Google Play Store

docs/pages/submit/android.mdx

latest8.6 KB
Original Source

import { ContentSpotlight } from '/ui/components/ContentSpotlight'; import { Prerequisites, Requirement } from '/ui/components/Prerequisites'; import { Terminal } from '/ui/components/Snippet'; import { Tabs, Tab } from '/ui/components/Tabs';

This guide outlines how to submit your app to the Google Play Store from your computer or from a CI/CD service.

Submitting your app from your computer

<Prerequisites numberOfRequirements={7}> <Requirement number={1} title="Sign up for a Google Play Developer account"> A Google Play Developer account is required to submit your app to the Google Play Store. You can sign up for a Google Play Developer account on the [Google Play Console sign-up page](https://play.google.com/apps/publish/signup/). </Requirement> <Requirement number={2} title="Create an app on Google Play Console"> Create an app by clicking **Create app** in the [Google Play Console](https://play.google.com/apps/publish/). </Requirement> <Requirement number={3} title="Create a Google Service Account"> EAS requires you to upload and configure a Google Service Account Key to submit your Android app to the Google Play Store. You can create one with the [uploading a Google Service Account Key for Play Store submissions with EAS](https://github.com/expo/fyi/blob/main/creating-google-service-account.md) guide. </Requirement> <Requirement number={4} title="Install EAS CLI and authenticate with your Expo account"> Install EAS CLI and login with your Expo account:
<Terminal cmd={['$ npm install -g eas-cli && eas login']} />
</Requirement> <Requirement number={5} title="Include a package name in app.json"> Include your app's package name in **app.json**:
```json app.json
{
  "android": {
    "package": "com.yourcompany.yourapp"
  }
}
```
</Requirement> <Requirement number={6} title="Build a production app"> You'll need a production build ready for store submission. You can create one using [EAS Build](/build/introduction/):
<Terminal cmd={['$ eas build --platform android --profile production']} />

Alternatively, you can build the app on your own computer with `eas build --platform android --profile production --local` or with Android Studio.
</Requirement> <Requirement number={7} title="Upload your app manually at least once"> You have to upload your app manually at least once. This is a limitation of the Google Play Store API.
Learn how with the [first submission of an Android app](https://expo.fyi/first-android-submission) guide.
</Requirement> </Prerequisites>

Once you have completed all the prerequisites, you can start the submission process.

Run the following command to submit a build to the Google Play Store:

<Terminal cmd={['$ eas submit --platform android']} />

The command will lead you step by step through the process of submitting the app. You can configure the submission process by adding a submission profile in eas.json. Learn about all the options you can provide in the eas.json reference.

To speed up the submission process, you can use the --auto-submit flag to automatically submit a build after it's built:

<Terminal cmd={['$ eas build --platform android --auto-submit']} />

Learn more about the --auto-submit flag in the automate submissions guide.

Submitting your app using CI/CD services

<Prerequisites numberOfRequirements={8}> <Requirement number={1} title="Sign up for a Google Play Developer account"> A Google Play Developer account is required to submit your app to the Google Play Store. You can sign up for a Google Play Developer account on the [Google Play Console sign-up page](https://play.google.com/apps/publish/signup/). </Requirement> <Requirement number={2} title="Create an app on Google Play Console"> Create an app by clicking **Create app** in the [Google Play Console](https://play.google.com/apps/publish/). </Requirement> <Requirement number={3} title="Create a Google Service Account"> EAS requires you to upload and configure a Google Service Account Key to submit your Android app to the Google Play Store. You can create one with the [uploading a Google Service Account Key for Play Store submissions with EAS](https://github.com/expo/fyi/blob/main/creating-google-service-account.md) guide. </Requirement> <Requirement number={4} title="Install EAS CLI and authenticate with your Expo account"> Install EAS CLI and login with your Expo account:
<Terminal cmd={['$ npm install -g eas-cli && eas login']} />
</Requirement> <Requirement number={5} title="Include a package name in app.json"> Include your app's package name in **app.json**:
```json app.json
{
  "android": {
    "package": "com.yourcompany.yourapp"
  }
}
```
</Requirement> <Requirement number={6} title="Upload your Google Service Account key to EAS dashboard"> Then, you need to upload your Google Service Account key to EAS dashboard under project's credentials. <Tabs> <Tab label="EAS dashboard"> - Go to your project's EAS dashboard, click **Credentials**, and under **Android**, click your app's **Application identifier**. - Under **Service Credentials**, click **Add a Google Service Account Key**. - Under **Change Google Service Account Key**, ensure **Upload new key** is selected and upload the downloaded JSON key. This will add the key to your project's credentials.
<ContentSpotlight
  alt="Uploading the Google Service Account key to EAS dashboard under Service Credentials"
  src="/static/images/tutorial/eas/credentials-03.png"
  className="max-w-[540px]"
/>
</Tab>
<Tab label="EAS CLI">
You can also upload the JSON key to the EAS dashboard using EAS CLI:
- Run `eas credentials --platform android`
- When prompted **Which build profile do you want to configure?**, select **production**
- When prompted **What do you want to do?**, select **Google Service Account** > **Upload a Google Service Account Key**
- Then add the JSON key file path to the upload the file to EAS dashboard

<ContentSpotlight
  alt="Uploading the Google Service Account key to EAS dashboard under Service Credentials"
  src="/static/images/tutorial/eas/credentials-03.png"
  className="max-w-[540px]"
/>

</Tab>
</Tabs>
</Requirement> <Requirement number={7} title="Build a production app"> You'll need a production build ready for store submission. You can create one using [EAS Build](/build/introduction/):
<Terminal cmd={['$ eas build --platform android --profile production']} />

Alternatively, you can build the app on your own computer with `eas build --platform android --profile production --local` or with Android Studio.
</Requirement> <Requirement number={8} title="Upload your app manually at least once"> You have to upload your app manually at least once. This is a limitation of the Google Play Store API.
Learn how with the [first submission of an Android app](https://expo.fyi/first-android-submission) guide.
</Requirement> </Prerequisites>

Once you have completed all the prerequisites, you can set up a CI/CD pipeline to submit your app to the Google Play Store.

Use EAS Workflows CI/CD

You can use EAS Workflows to build and submit your app automatically.

  1. Create a workflow file named .eas/workflows/submit-android.yml at the root of your project.

  2. Inside submit-android.yml, you can use the following workflow to kick off a job that submits an Android app:

    yaml
    on:
      push:
        branches: ['main']
    
    jobs:
      build_android:
        name: Build Android app
        type: build
        params:
          platform: android
          profile: production
    
      # @info #
      submit_android:
        name: Submit to Google Play Store
        needs: [build_android]
        type: submit
        params:
          profile: production
          build_id: ${{ needs.build_android.outputs.build_id }}
      # @end #
    

    The workflow above will build the Android app and then submit it to the Google Play Store.

Use other CI/CD services

You can use other CI/CD services to submit your app with EAS Submit, like GitHub Actions, GitLab CI, and more by running the following command:

<Terminal cmd={['$ eas submit --platform android --profile production']} />

This command requires a personal access token to authenticate with your Expo account. Once you have one, provide the EXPO_TOKEN environment variable in the CI/CD service, which will allow the eas submit command to run.