问题
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 theSDK-Managerof 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