I want to build an Android Studio app (the Gradle build system), but I want to do this via the command line.
Try this (OS X only):
brew install homebrew/versions/gradle110 gradle build
brew install homebrew/versions/gradle110
gradle build
You can use gradle tasks to see all tasks available for the current project. No Android Studio is needed here.
gradle tasks
Android Studio