Get path to build folder for Android Studio project using bash script

In my bash script, I can create my Android Studio project as follows:

#!/bin/bash
./gradlew assembleRelease

This creates a file .apkin the project creation folder, but I do not know the path to this folder inside my script.
Is there any way to get it?

+2
source share
1 answer

You can add the string 'find' it -

path=`find ./ -name "*.apk"`
echo "$path"

If you need an absolute path -

path=`find ./ \`pwd\` . -name "*.apk"`
echo "$path"
0
source

Source: https://habr.com/ru/post/1570525/


All Articles