- składnia:
<profileable android:shell=["true" | "false"] android:enabled=["true" | "false"] />
- zawarte w:
<application>
- description:
- Określa dostęp do tej aplikacji przez osoby tworzące profil.
- atrybuty:
android:shell
-
Określa, czy użytkownik urządzenia może profilować tę aplikację za pomocą debugowania lokalnego
Oto niektóre z nich:
- Interfejsy API śledzenia
android.os.Trace
(Android 11 i starsze) simpleperf
- Polecenia
am profile
- Programy profilujące:
perfetto
(pamięć natywna, pamięć Java, procesor)
false
, te narzędzia i interfejsy API działają tylko wtedy, gdydebuggable
Aplikacje możliwe do debugowania powodują znaczne i zróżnicowane pogorszenie wydajności i nie są przydatne dokładnie mierzyć czas. Ten element jest zdecydowanie zalecany ze względu na skuteczność lokalną pomiarów, aby uzyskać dokładne wyniki.Ten element jest przeznaczony do użytku w wersjach produkcyjnej lub w wersji produkcyjnej, umożliwiając profilowanie lokalne. Powoduje to minimalne ryzyko ujawnienia danych: narzędzia do profilowania hosta nie mogą odczytywać żadnych danych pamięci i powłoki. Czytelne są tylko zrzuty stosu, które są zwykle zaciemnione lub nie zawierają symboli w kompilacjach do publikacji.
- Interfejsy API śledzenia
android:enabled
-
Określa, czy aplikacja może być profilowana przez usługi systemowe lub narzędzia powłoki.
W tym drugim przypadku musisz też ustawić
android:shell
. Jeśli zasada ma wartość false (fałsz), aplikacji nie można w ogóle profilować. Wartość domyślna to true (prawda). Ten atrybut został dodany na poziomie interfejsu API 30.
- wprowadzone w:
- Poziom 29 API
<profileable>
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-27 UTC."],[],[],null,["# <profileable\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cprofileable android:shell=[\"true\" | \"false\"] android:enabled=[\"true\" | \"false\"] /\u003e\n ```\n\ncontained in:\n: [\u003capplication\u003e](/guide/topics/manifest/application-element)\n\ndescription:\n: Specifies how profilers can access this application.\n\nattributes:\n:\n\n `android:shell`\n :\n Specifies whether the user of the device can profile this application through local debugging\n tools such as the following:\n\n - [android.os.Trace](/reference/kotlin/android/os/Trace) tracing APIs (Android 11 and lower)\n - [simpleperf](/ndk/guides/simpleperf)\n - [am profile](/studio/command-line/adb#am) commands\n - [`perfetto` profilers](/studio/command-line/perfetto) (native memory, Java memory, CPU)\n\n\n If this isn't set, or is set to `false`, these tools and APIs work only when an app is\n [debuggable](/guide/topics/manifest/application-element#debug).\n Debuggable apps incur significant and varied performance degradation and aren't useful for\n measuring timing accurately. This element is strongly recommended for local performance\n measurements, to capture accurate results.\n\n This element is designed to be usable in release, or production, builds to enable local profiling.\n It incurs minimal risk of data exposure: no memory data is readable by the host profiling tools\n and the shell process. Only stack traces are readable, which are typically obfuscated or lacking symbols\n in release builds.\n\n:\n\n `android:enabled`\n :\n Specifies whether the application can be profiled by system services or shell tools.\n For the latter, you also set [`android:shell`](#shell).\n If false, the application can't be profiled at all. The default is true.\n\n This attribute was added in API level 30.\n\nintroduced in:\n: API Level 29"]]