How to Enable Fastlane for App Deployment
Android
Enable API access
- Open the Google Play Android Developer API page
- Select the project in the top bar
- Click
Enableto enable the API
Create a Service Account
- Go to the Google Cloud Console
- Click
+ Create Service Accountat the top - Leave the display name blank
- Set ID to "project-name-fastlane"
- Set Description to "Service account for fastlane deployment"
- Click
Create and Continue - Click
Continue(no role needed) - Click
Done
Add a Service Account Key
Be prepared to store the key securely - this procedure immediately downloads the new key to your computer.
Create a key:
- Click the 3 dots at the right of the service account we just created, and select
Manage keys - From the
Add Keymenu, selectCreate new key - Chose JSON
- Click
Createto create and download the key - Move the key to
secret/**project-name**-fastlane.json
Invite the service account to the Play Console
- Open the Play Console
- Choose
Users and permissionsfrom the left menu - Click
Invite new users - Use the service account email (from the JSON key file)
- Under App permissions, select
Add app - Select the app
- Grant
Admin (all permissions)access - Click
Invite user
Bootstrap Fastlane in the repo
- Copy the fastlane files from an existing app to the app directory
p=pines
mkdir -p ${p}_app/fastlane/metadata/android/en-US/changelogs
cp noble_app/fastlane/*file ${p}_app/fastlane/ - Edit
Appfileto fix package name and json key pathperl -p -i -e "s/noble/${p}/g" ${p}_app/fastlane/Appfile
Test Fastlane access
cd ${p}_app
fastlane run validate_play_store_json_key