- תחביר:
<profileable android:shell=["true" | "false"] android:enabled=["true" | "false"] />
- בתוך:
<application>
- תיאור:
- ההגדרה קובעת איך ליוצרי פרופילים תהיה גישה לאפליקציה הזו.
- :
android:shell
-
המדיניות מציינת אם המשתמש במכשיר יכול ליצור פרופיל לאפליקציה הזו באמצעות ניפוי באגים מקומי
כלים כמו:
android.os.Trace
ממשקי API למעקב (Android 11 ומטה)simpleperf
- פקודות
am profile
perfetto
יוצרי פרופילים (זיכרון מקורי, זיכרון Java, מעבד (CPU))
false
, הכלים וממשקי ה-API האלה פועלים רק כשאפליקציהdebuggable
. אפליקציות שניתנות לניפוי באגים סובלות מירידה משמעותית בביצועים, והן לא מועילות מדידה מדויקת של התזמון. הרכיב הזה מומלץ מאוד לביצועים מקומיים מדידה, כדי להשיג תוצאות מדויקות.הרכיב הזה נועד להיות שימושי בגרסה להפצה, או בסביבת הייצור, כדי לאפשר יצירת פרופילים מקומיים. קיים סיכון מינימלי לחשיפת נתונים: כלי הפרופיילינג של המארחים לא יכולים לקרוא נתוני זיכרון ואת תהליך המעטפת. אפשר לקרוא רק דוחות של קריסות. בדרך כלל הם מעורפלים (obfuscation) או שחסרים בהם סמלים בגרסאות build של גרסה.
android:enabled
-
מציינת אם שירותי המערכת או כלי המעטפת יכולים ליצור פרופיל של האפליקציה.
מגדירים גם
android:shell
בשדה השני. אם הערך הוא False, לא ניתן ליצור פרופיל של האפליקציה בכלל. ברירת המחדל היא True. המאפיין הזה נוסף ברמת API 30.
- הושקו ב:
- רמת API 29
<profileable>
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 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"]]