AndroidStudio Gradle命令

2020-10-25 12:00:32

檢視gradle相關的版本資訊

gradlew -v

清除build資料夾

gradlew clean

打debug/release包,打出的包在 app/build/outputs/apk/release (或者debug資料夾)路徑下

gradlew assembleDebug

簡寫:

gradlew aD

gradlew assembleRelease

簡寫:

gradlew aR

打debug/release包並安裝到AndroidStudio連線的裝置上,打出的包路徑同上

gradlew installDebug

簡寫

gradlew iD

gradlew installRelease

簡寫

gradlew iR

檢視執行報錯"Error:Execution failed for task ':test:processDebugManifest'.> Manifest merger failed with multiple errors, see logs"更詳細的錯誤資訊

gradlew processDebugManifest --stacktrace

adb啟動服務

adb start -server

adb關閉服務

adb kill -server

adb 安裝apk包

adb install -r D:\WorkSpace\MyProject\JsBridgeDemo\app\build\outputs\apk\debug\app-debug.apk