Android Instant Apps: how to debug an instant application?

When I debug my instant application in Android Studio, the debugger joins the instant application process and pauses execution at most breakpoints. However, it seems to ignore breakpoints with my main onCreate method. I tried the "Debug" and "Postpone debugger to Android process" options. What am I missing?

+4
source share
2 answers

Basic information about using the Android Studio debugger to debug an Android application is available on the Developer Documentation Debugging your application .

The Android Studio debugger usually works most of the time when debugging an instant application. However, you will notice that the debugger will not be able to stop at breakpoints at an early stage of the application life cycle (for example, Application.onCreateor Activity.onCreate) on devices running Android N and below.

When your instant application is up and running, it runs under the name of your application. However, when the application starts, there is a short period of time when it starts under the temporary name of the package, in the following form:

com.google.android.instantapps.supervisor.isolated[0-9]+

. Android Studio , .

, adb, . , . .

=> adb shell 'while true; do ps | grep com.google.android.instantapps.supervisor.isolated; sleep 1; done'
u0_i6     31908 630   1121664 29888          0 00ea57eed4 R com.google.android.instantapps.supervisor.isolated15

, , . , " ", " ".

=> adb shell am set-debug-app -w --persistent com.google.android.instantapps.supervisor.isolated15
+11

.

" "

" . ."

" " "" Android-.

0

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


All Articles