- Google Play Console account with admin access
- Your app published or ready for publishing on Google Play
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the Google Play Android Developer API:
- Go to "APIs & Services" > "Library"
- Search for "Google Play Android Developer API"
- Click "Enable"
- Go to "IAM & Admin" > "Service Accounts"
- Click "Create Service Account"
- Fill in details:
- Name:
fastlane-service-account - Description:
Service account for Fastlane Google Play Store uploads
- Name:
- Click "Create and Continue"
- Skip role assignment for now
- Click "Done"
- Find your service account in the list
- Click on it > "Keys" tab
- Click "Add Key" > "Create new key"
- Select "JSON" format
- Download the JSON file (keep it secure!)
- Go to Google Play Console
- Select your app
- Go to "Users and permissions" (left sidebar)
- Click "Invite new users"
- Enter your service account email (from JSON file)
- Grant these permissions:
- ✅ View app information and download bulk reports (read-only)
- ✅ Manage store presence
- ✅ Manage production releases
- ✅ Manage testing tracks
- Click "Send Invitation"
- The service account will receive an email invitation
- Accept it (this is automatic for service accounts)
# Create a secure directory for keys
mkdir -p ~/.fastlane/keys
# Move your JSON key file there
mv ~/Downloads/your-service-account-key.json ~/.fastlane/keys/play-store-key.json
# Set proper permissions
chmod 600 ~/.fastlane/keys/play-store-key.json# Add to your ~/.zshrc or ~/.bashrc
echo 'export GOOGLE_PLAY_JSON_KEY_FILE=~/.fastlane/keys/play-store-key.json' >> ~/.zshrc
# Reload shell
source ~/.zshrc# Check environment variable
echo $GOOGLE_PLAY_JSON_KEY_FILE
# Test Fastlane connection
fastlane run validate_play_store_json_key json_key:~/path/to/your/key.json# Upload only screenshots
fastlane android upload_screenshots# Build, take screenshots, and upload everything
fastlane android build_and_uploadGoogle Play Store expects screenshots in specific folders:
maestro/screenshots/screenshots/
├── en-US/
│ ├── phoneScreenshots/
│ │ ├── calculator-empty.png
│ │ ├── calculator-bill-entered.png
│ │ └── ...
│ ├── sevenInchScreenshots/
│ └── tenInchScreenshots/
# Create directory structure
mkdir -p maestro/screenshots/screenshots/en-US/phoneScreenshots
# Move screenshots to correct location
mv maestro/screenshots/screenshots/*.png maestro/screenshots/screenshots/en-US/phoneScreenshots/-
"Invalid service account" error
- Check that the service account email is correct
- Ensure the service account has been invited to Play Console
- Wait 24-48 hours after inviting the service account
-
"Permission denied" error
- Verify the service account has the correct permissions in Play Console
- Check that the JSON key file path is correct
-
"Package name not found" error
- Ensure your app is published or in draft status
- Verify the package name matches exactly
-
Screenshot upload issues
- Check screenshot dimensions (required: various sizes)
- Ensure screenshots are in PNG format
- Verify the directory structure matches Play Store requirements
# Test JSON key validity
fastlane run validate_play_store_json_key
# Check app details
fastlane run get_google_play_store_app_details
# Verbose output
fastlane android upload_screenshots --verbose-
Never commit JSON keys to git
- Add
*.jsonto.gitignore - Store keys in secure location (
~/.fastlane/keys/)
- Add
-
Use environment variables
- Don't hardcode paths in Fastfile
- Use
ENV["GOOGLE_PLAY_JSON_KEY_FILE"]
-
Limit permissions
- Only grant necessary permissions to service account
- Regularly rotate service account keys
Once setup is complete, you can:
-
Upload screenshots only:
fastlane android upload_screenshots
-
Upload APK + screenshots:
fastlane android upload_all
-
Full automated workflow:
fastlane android build_and_upload
Your app screenshots will be uploaded to Google Play Store and ready for review!