Launch "Instant Run" from the command line

I am launching my Android application from Android Studio, and Instant Run is starting up, which is great. I want to run the same thing from the command line.

In the Android Studio event log, I see

22:00:28 Executing tasks: [:app:incrementalDevDebugSupportDex] 22:00:48 Gradle build finished in 20s 286ms 22:00:51 Instant Run applied code changes and restarted the current Activity. 

So, I expected that I could run this task from the command line: ./gradlew :app:incrementalDevDebugSupportDex . However, it was not found:

 FAILURE: Build failed with an exception. * What went wrong: Task 'incrementalDevDebugSupportDex' not found in project ':app'. 

Is there a way to start using Instant Run from the command line?

+5
source share
3 answers

It is currently not possible to use instant start outside of Android Studio. This was mentioned on the Android Dev Summit, but I can’t remember exactly what conversation it was in.

+8
source

You can start instant start from the command line as follows:

 ./gradlew clean :sample-app:assembleDebug -Pandroid.optional.compilation=INSTANT_DEV -Pandroid.injected.build.api=24 
+2
source

This is currently possible. You can run the command below to execute an instant start:

 ./gradlew :app:incremental"buildvarientname"DebugJavaCompilationSafeguard 

You can add the same to the gradle task by adding the incremental"buildvarientname"DebugJavaCompilationSafeguard inside the task in the launch configuration window,

0
source

Source: https://habr.com/ru/post/1244398/


All Articles