Custom Android APK names

Is there any way to give specific names for Apps artifacts? For example, android builds artifacts have standart names app-debug.apk I’d like to have APP_NAME-debug-BUILD_NUM.apk

Hi @klitovchenko,

Sure, you can do this in your Gradle config directly, see e.g.:

Alternatively you can of course use e.g. a Script step to rename the APK, it’s up to you what fits your use case / project better.

If you have any questions, just let us know!

Note: the Deploy to Bitrise.io step deploys the artifacts with the file name of the artifact, so to change the name you just have to change the file name (e.g. with a Script step).

Thanks for replies!
But Script step can not replace Environment Variables. I need Bitrise build number and other information about build. Gradle is a good way, but I’m still need the same for iOS builds.

It definitely can, you just have to expose a new value for the same key, using envman: Environment Variables - Bitrise Docs

Something like this should work:

#!/bin/bash
set -ex

# config
new_ipa_path="${BITRISE_DEPLOY_DIR}/MyNewAppName-${BITRISE_BUILD_NUMBER}.ipa"

# rename the ipa
mv "$BITRISE_IPA_PATH" "$new_ipa_path"
# expose the new path/value as an env var, for the same key
# overwriting the previous value
envman add --key BITRISE_IPA_PATH --value "$new_ipa_path"
2 Likes