androidbashshellandroid-studiogradle

Get build folder path for Android Studio project via bash script


In my bash script I can build my Android Studio project like this:

#!/bin/bash
./gradlew assembleRelease

That creates .apk file in project's build folder but I don't know the path to that folder inside my script.
Is there any way to get it?


Solution

  • You could add a line 'finding' it-

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

    If you want the absolute path-

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