farhanchoksi / play-upload
Upload Android App Bundles (.aab) to Google Play Developer API
Requires
- php: ^8.2 || ^8.3
- google/apiclient: ^2.15
- guzzlehttp/guzzle: ^7.8
- illuminate/console: ^11.0
- illuminate/container: ^11.0
- illuminate/support: ^11.0
- laravel/prompts: ^0.1.24
README
play-upload is a production-ready, high-performance Command Line Interface (CLI) built with Laravel Zero (PHP 8.3+) for uploading Android App Bundles (.aab) to the Google Play Store via the official Google Play Developer API.
✨ Features
- 🌐 Automated 1-Click Browser Login: Opens your Mac default browser automatically, authenticates via Google OAuth, and logs in with zero manual Client ID typing!
- 📄 Service Account JSON Support: Drag & drop your Google Play Console
.jsonkey file for quick bot / CI/CD authentication. - 👥 Multi-Account Management: Link multiple Google accounts, list active sessions, and switch between accounts instantly.
- 🎯 All Release Tracks Supported: Upload
.aabbundles toInternal Testing,Closed Testing (Alpha),Open Testing (Beta), orProduction. - 📊 Interactive Terminal UI: Built with Laravel Prompts — features select dropdowns, text inputs, animated spinners, and a real-time upload progress bar.
- 🩺 Human-Readable Error Diagnostics: Intercepts Google API errors and provides clear explanations and step-by-step solutions.
- 📜 Audit History & Logging: Saves upload records to
~/.config/play-upload/history.jsonand logs events toplay-upload.log.
💻 Installation
Global Installation via Composer (Recommended)
Run the following command from any terminal:
composer global require farhanchoksi/play-upload
Make sure your composer global bin directory is in your system's PATH. If not, add this to your ~/.zshrc or ~/.bashrc:
export PATH="$HOME/.composer/vendor/bin:$PATH"
Manual Installation (Development)
# 1. Clone the repository and navigate to the folder cd /Volumes/Data2/Farhan.mtzinfotech/play-upload # 2. Install dependencies composer install # 3. Create a global symlink sudo ln -sf /Volumes/Data2/Farhan.mtzinfotech/play-upload/play-upload /usr/local/bin/play-upload
⚡ Command Reference & Usage Guide
1. play-upload login
Description: Authenticate and link a Google Account to the CLI.
play-upload login
Options Offered:
- 🌐 Browser Web Sign-In (Recommended): Automatically opens your Mac browser. Select your Google account, click Allow, and return to terminal. Login is completed automatically with zero code copy-paste!
- 📄 Service Account JSON Key File: Drag & drop your downloaded Google Play Console
.jsonkey file. - 🔑 Custom OAuth Credentials: Manually enter custom GCP Client ID & Secret.
2. play-upload whoami
Description: Display current active Google Account details.
play-upload whoami
Example Output:
Active Google Account Details:
┌───────────────────────┬───────────────────────────┐
│ Property │ Value │
├───────────────────────┼───────────────────────────┤
│ Account Email │ farhanchoksipvt@gmail.com │
│ Auth Type │ OAUTH │
│ Key / Config Location │ OAuth Storage │
│ Date Registered │ 2026-07-30 06:57:52 │
└───────────────────────┴───────────────────────────┘
3. play-upload accounts
Description: View all registered Google Accounts and switch the active account.
play-upload accounts
Allows selecting which account to set as default for future uploads.
4. play-upload apps
Description: Test and verify Google Play Console permissions for an Android package.
play-upload apps
Prompts for an Android package name (e.g. com.example.app) and initializes a test Edit session on Google Play Console to confirm access.
5. play-upload upload
Description: Full interactive wizard to upload an .aab file to Google Play Store.
play-upload upload
Step-by-Step Flow:
- Prompts for the
.aabfile path (validates file existence and.aabextension). - Asks for target Google Account from stored sessions.
- Asks for target Android Package Name (
com.example.app). - Asks to select Release Track:
Internal TestingClosed Testing (Alpha)Open Testing (Beta)Production
- Asks for optional Release Notes.
- Streams upload with a real-time progress bar.
- Commits the release to Google Play Console and logs history.
Example Terminal Output:
🚀 Google Play AAB Upload Wizard (play-upload)
Uploading /Users/farhan/Desktop/app-release.aab ...
Uploading AAB file... [============================] 100%
✅ Upload Successful
Package Name: com.example.app
Version Code: 125
Track: Internal
Status: Processing / Completed
Account: example@gmail.com
6. play-upload logout
Description: Safely remove stored credentials for an account.
play-upload logout
📁 Data & Configuration Storage
All account credentials, active pointers, and logs are stored securely with strict permissions (0600) in:
- Config Path:
~/.config/play-upload/ - Accounts File:
~/.config/play-upload/accounts.json - Active Pointer:
~/.config/play-upload/active.json - Audit Logs:
~/.config/play-upload/play-upload.log - Upload History:
~/.config/play-upload/history.json
🩺 Error Handling & Troubleshooting
If an upload fails (e.g. version code conflict, missing API permissions, expired session), play-upload displays exact API error details along with an actionable fix:
- Version Code Conflict: "Increment the
versionCodein your Android project (build.gradle), rebuild the .aab, and try again." - API Access Disabled: "Enable 'Google Play Android Developer API' in GCP Console for your service account project."
- Permission Denied: "Grant access to this account under Google Play Console -> Setup -> API Access with Release Manager permissions."
📄 License
MIT License. Designed for production deployment.