Syntax
Arguments
platform
The platform to check. Required.android- Check Google Play Storeios- Check Apple App Store Connectboth- Check both platforms
Options
—google-service-key=PATH
Path to Google Service Account JSON key file (required for Android).GOOGLE_SERVICE_ACCOUNT_KEY in .env.
—api-key=PATH
Path to App Store Connect API key file (required for iOS).APP_STORE_API_KEY_PATH in .env.
—update
Update local build number to store latest + 1.NATIVEPHP_APP_VERSION_CODE in your .env file.
—jump-by=NUMBER
Add extra number to the suggested version (e.g.,--jump-by=10 to skip ahead).
Examples
Check Android build number
Check and auto-update
.env with next build number.
Check with jump ahead
Check both platforms
What it does
Android
- Connects to Google Play Console API using service account
- Retrieves latest version code from all tracks (internal, alpha, beta, production)
- Compares with local
NATIVEPHP_APP_VERSION_CODE - Suggests next version code (latest + 1 + jump-by)
- Optionally updates
.envwith new version code
iOS
- Connects to App Store Connect API
- Retrieves latest build number from all builds
- Compares with local
NATIVEPHP_APP_VERSION_CODE - Suggests next build number (latest + 1)
- Optionally updates
.envwith new build number
Build number vs Version name
-
Build number (version code): Integer that must increase with each release
- Android:
versionCode(e.g., 42) - iOS: CFBundleVersion (e.g., 42)
- Set via:
NATIVEPHP_APP_VERSION_CODE
- Android:
-
Version name: User-facing version string
- Android:
versionName(e.g., “1.2.3”) - iOS: CFBundleShortVersionString (e.g., “1.2.3”)
- Set via:
NATIVEPHP_APP_VERSION
- Android:
Requirements
Android (Google Play)
You need a Google Cloud Service Account with Play Console access:- Go to Google Cloud Console
- Create a service account
- Download JSON key
- Grant “Release Manager” access in Play Console
- Set path in
.envor use--google-service-key
iOS (App Store Connect)
You need App Store Connect API credentials:- Go to App Store Connect > Users and Access > Keys
- Create an API key with “Developer” role
- Download
.p8file - Note the Key ID and Issuer ID
- Set in
.envor use CLI options
Environment variables
Common workflows
Before building for production
Check and update build number before packaging:Reserve build numbers
Skip ahead to reserve numbers:CI/CD integration
Automate in your deployment pipeline:Troubleshooting
”No releases found”
This appears for new apps with no published builds. The suggested next build number is 1.”Could not connect to Play Console”
Check:- Service account JSON key is valid
- Service account has “Release Manager” role
- API is enabled in Google Cloud Console
”Could not connect to App Store Connect”
Check:- API key file path is correct
- Key ID and Issuer ID are correct
- API key has “Developer” role
See also
- native:release - Bump version name
- native:package - Package with version