
I posted last week about writing some scripts to sanity-check and validate Android bundles before uploading to Google Play Store (and having them rejected!).
I’ve made the scripts – one for AABs and APKs – open source as public gists.
curl -s https://gist.githubusercontent.com/minademian/71a5a3d0243496ce6a2a49956c01e4cd/raw/05189c8da3c8833595546a68325a3617cbd1944f/verify_aab_release.sh | bash
curl -s https://gist.githubusercontent.com/minademian/6e841c8e1a84308c6b3dc937a2d4a4cd/raw/4768df88d3d3111c134700c0637ed030a97af3a9/verify_apk_release.sh | bash
You can take it one step further and add it to your precommit hook, using the hook management tooling of your choice.
It will look like this:
yarn test || exit 1
# script in package.json: "bash./scripts/verify_aab_release.sh",
yarn validate-packages || exit 1
npx lint-staged || exit 1