Where is InstallDebug in Gradle? How to install a test Android App?

淺唱寂寞╮ 提交于 2020-01-15 11:23:28

问题


I'm trying to install an Android app I'm developing in Android Studio on my test device. I normally do this with the Gradle task called "InstallDebug. In my newly created project however, I now don't see this task in my list of Gradle Tasks anymore. The only two things I see starting with Install* are

  • installDefaultFlavorDebug
  • installDefaultFlavorTest

Does anybody know which Gradle Task I need to use to install my app on my phone to test it?


回答1:


Now you will find this tasks:

gradlew install<Flavor><Build Type>.

Example: 2 flavors f1,f2, and 2 build types debug, release.

You will find:

installF1Debug - Installs the Debug build for flavor f1
installF1DebugTest - Installs the Test build for the f1 build
installF1Release -- Installs the Release build for flavor f1
installF2Debug - Installs the Debug build for flavor f2
installF2DebugTest - Installs the Test build for the f2 build
installF2Release -- Installs the Release build for flavor f2



回答2:


I encountered a similar issue. The symptom is:

Under the Gradle-Tasks / Install category, there's only 1 task "InstallAll"

My Solution is:

1.Install Android NDK, using the SDK-Manager of Andorid-Studio.
2.Make sure the "Android NDK Location" field of the project-settings (File -> Project Structure) is not empty. It should be something similar to: /Users/charlie/Library/Android/sdk/ndk-bundle

After I have the Android NDK installed, I can see many other Install-Tasks in Android-Studio now.



来源:https://stackoverflow.com/questions/21457546/where-is-installdebug-in-gradle-how-to-install-a-test-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!