Question: I'm trying to automate the build and upload process for a signed APK of an Android app without using Android Studio, so I'm running everything in Terminal. The first command is:

```
./gradlew assembleRelease

```

Which generates an unsigned, unaligned APK in the /APP NAME/build/outputs/apk folder. However, since APP NAME won't be the same for every app, I can't just hard code the location of the output file into the next step of signing it. Are there any arguments I can use with the gradlew command to specify an output directory and file name of my choice?

Answer: 
There is no such command to specify the output.But you can write a script to make this possible.As you have got the `/build/outputs/app-release.apk`, you can copy and rename it to everywhere you want.
you can dynamically append some script to that build file(build.gradle) to set the `buildDir` of any project. 

for example:

```
allprojects {
  buildDir = System.properties['user.home']+"/"+project.name;
}

```