Make the release build traceable: profileable, with composable names

System Tracing on the phone only records an app's own trace sections when
the app is debuggable or profileable, and the phone runs a build that is
neither once release builds exist. profileable shell="true" admits shell
profilers and nothing else. runtime-tracing names composables inside those
sections and is inert until a trace is recording.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
irisandClaude Fable 5.1 committed 2026-09-02 05:10:18 -04:00
1 parent f87c99c71b
commit 486842e4aa
3 files changed
+12

No files matched your search

+1
View File
@@ -137,6 +137,7 @@ dependencies {
coreLibraryDesugaring(libs.desugar.jdk.libs) coreLibraryDesugaring(libs.desugar.jdk.libs)
implementation(libs.compose.runtime) implementation(libs.compose.runtime)
implementation(libs.compose.runtime.tracing)
implementation(libs.compose.foundation) implementation(libs.compose.foundation)
implementation(libs.compose.material3) implementation(libs.compose.material3)
implementation(libs.compose.ui) implementation(libs.compose.ui)
@@ -29,6 +29,12 @@
android:allowBackup="true" android:allowBackup="true"
android:theme="@android:style/Theme.Material.Light.NoActionBar" android:theme="@android:style/Theme.Material.Light.NoActionBar"
tools:ignore="MissingApplicationIcon"> tools:ignore="MissingApplicationIcon">
<!-- Lets the phone's own System Tracing see this app's trace sections
(Compose's phases, and the composable names runtime-tracing
adds) in a release build, so a frame cost measured on the real
device can be attributed. shell="true" limits it to profilers
run from the shell; it grants nothing to other apps. -->
<profileable android:shell="true" />
<!-- adjustResize (not the system's default pan): the layout handles <!-- adjustResize (not the system's default pan): the layout handles
the keyboard itself via imePadding(), so the window must resize the keyboard itself via imePadding(), so the window must resize
rather than slide the top bar off screen. --> rather than slide the top bar off screen. -->
+5
View File
@@ -68,6 +68,11 @@ androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", vers
# Declared directly rather than through the plugin's `compose.*` accessors, # Declared directly rather than through the plugin's `compose.*` accessors,
# which are deprecated as of CMP 1.11. # which are deprecated as of CMP 1.11.
compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose-multiplatform" } compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose-multiplatform" }
# Names composables in a system trace, which is how a per-frame cost on the
# phone gets attributed to a composable rather than to "Compose". Inert until
# a trace is being recorded. Its own release train: 1.12.0 was the newest
# stable on Google Maven on 2026-09-02.
compose-runtime-tracing = { module = "androidx.compose.runtime:runtime-tracing", version = "1.12.0" }
compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose-multiplatform" } compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose-multiplatform" }
compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "compose-material3" } compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "compose-material3" }
compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "compose-multiplatform" } compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "compose-multiplatform" }