Reputation: 6497
I'd like to upload may android apps (.aab files) automatically to google play console (creating a new internal test) using a bash script (part of my CI/CD pipeline).
On a high level it looks like I have to
However, I'm stuck at step 2. All the documentation I found on this seems to be outdated.
For example according to this page, under the "Service account overview" section, I should be able to see the newly created service account:
However, when I click on "API Access" under Google Play Console it's pretty much empty:
This sounds like a well documented task but it isn't. Any hints or up-to-date step by step guide for doing this?
Upvotes: 3
Views: 1978
Reputation: 6497
Here is a rough solution of how I fixed my problem:
create a sevice project on google cloud (follow this tutorial)
link that project to google play console
In Google Play Console → user management and permissions → add new google cloud service account
Install Fastlane (I'm on Windows and installed Ruby via "rubyinstaller-devkit-3.2.2-1-x64.exe")
Install fastlane via ruby
gem install fastlane -NV
fastlane init
fastlane supply init
(This last command should download metadata of your app if I remember correctly !?)
Download google cloud json authentication key (explained in the video above, min 2:50): my-authentication-key.json
gcloud auth activate-service-account --key-file=my-authentication-key.json
Run fastlane authentication command
fastlane run validate_play_store_json_key my-authentication-key.json --verbose
Create a Fastfile
mkdir fastlane
touch fastlane/Fastfile
Paste the following content into the file:
# Fastfile
default_platform(:android)
platform :android do
desc "Deploy a new version to the Google Play"
lane :deploy_to_play_store do |options|
aab_path = options[:aab] # Path to the AAB file
metadata_path = options[:metadata_path] # Path to metadata directory
upload_to_play_store(
track: 'internal', # Track for the release
aab: aab_path, # Path to the AAB file
release_status: 'completed', # Release status (draft, inProgress, halted, completed)
metadata_path: metadata_path, # Path to the metadata directory
skip_upload_apk: true, # Explicitly skip uploading APK files
skip_upload_metadata: true, # Skip uploading other metadata
skip_upload_images: true, # Skip uploading images
skip_upload_screenshots: true, # Skip uploading screenshots
# Any additional parameters you need
)
end
end
fastlane android deploy_to_play_store aab:MyAndroidApp.aab metadata_path:metadata
Upvotes: 1