Build Android Studio app via command line

后端 未结 12 1759
梦谈多话
梦谈多话 2020-11-27 10:36

I want to build an Android Studio app (the Gradle build system), but I want to do this via the command line.

12条回答
  •  渐次进展
    2020-11-27 11:17

    You're likely here because you want to install it too!

    Build

    gradlew
    

    (On Windows gradlew.bat)

    Then Install

    adb install -r exampleApp.apk
    

    (The -r makes it replace the existing copy, add an -s if installing on an emulator)

    Bonus

    I set up an alias in my ~/.bash_profile, to make it a 2char command.

    alias bi="gradlew && adb install -r exampleApp.apk"
    

    (Short for Build and Install)

提交回复
热议问题