Cloud Build to Google Play upload

Hi. There’s an option to build aab files via cloud build - but i found no way to upload it to Google Play.
I managed to set uploading to appstore automatically - and i really like how it works.
This is the postbuild code i’m using

#!/bin/bash
echo "Uploading IPA to Appstore Connect..."
#Path is "/BUILD_PATH/<ORG_ID>.<PROJECT_ID>.<BUILD_TARGET_ID>/.build/last/<BUILD_TARGET_ID>/build.ipa"
path="$WORKSPACE/.build/last/default-ios/build.ipa"

if xcrun altool --upload-app --type ios -f $path -u $ITUNES_USERNAME -p $ITUNES_PASSWORD ; then
    echo "Upload IPA to Appstore Connect finished with success"
else
    echo "Upload IPA to Appstore Connect failed"
fi

But what is analogue for Google Play ?
I found some topics but no working solution…
https://stackoverflow.com/questions/35894762/how-to-upload-apk-to-google-play-store-via-command-line

Atm i set up aab build with my keystore file. looks like resulting file is

OnPostprocessBuild for target Android at path /BUILD_PATH/astanid.skybox.default-android-aab/temp20220214-5101-84fac6/Default Android aab.aab

What path will look like ? And where can i get passwords needed ?

Hi,

You might want to check out this Forum post: Unity Cloud Build Fastlane for Android to get the full bash script for uploading your Android build to Google Play.

And here is the fastlane doc with further information.
https://docs.fastlane.tools/actions/upload_to_play_store/#uploading-an-aab

Hope it helps!

2 Likes