החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
בדיקת התכונה 'ניהול מכשירים'
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדי להבטיח תמיכה מינימלית בפרופילים מנוהלים, מכשירי OEM חייבים לכלול את הרכיבים החיוניים הבאים:
רשימת הדרישות המלאה מופיעה במאמר הטמעת ניהול מכשירים. כדי לבדוק את התכונות של ניהול המכשיר, בעלי המכשירים יכולים להשתמש באפליקציית TestDPC שמתוארת בהמשך.
הגדרת הבעלים של המכשיר לצורך בדיקה
כדי להגדיר סביבה לבדיקה של בעלי המכשיר, פועלים לפי ההוראות הבאות.
- מאפסים את מכשיר היעד להגדרות המקוריות.
- מוודאים שהמכשיר לא מכיל חשבונות משתמשים (למשל, חשבונות המשמשים להתחברות לשירותים אונליין). כדי לוודא, עוברים אל הגדרות > חשבונות.
- מגדירים את אפליקציית הבדיקה באחת מהשיטות הבאות:
- מגדירים את אפליקציית TestDPC כבעלים של המכשיר באמצעות הפקודה הבאה:
adb shell dpm set-device-owner "com.afwsamples.testdpc/.DeviceAdminReceiver"
- מבצעים את ההגדרה של הבעלים של המכשיר במכשיר (הצפנה, בחירת רשת Wi-Fi).
אימות ההגדרה של בעלי המכשיר
כדי לוודא שבעלי המכשיר הוגדר בצורה נכונה, עוברים אל הגדרות > אבטחה > אדמינים של מכשירים ומוודאים ש-TestDPC נמצא ברשימה. מוודאים שלא ניתן להשבית אותו (המשמעות היא שהוא בעל המכשיר).
דוחות על באגים ויומני אירועים
החל מגרסה 7.0 של Android, בעלי מכשיר עם לקוח מדיניות מכשירים (DPC) יכולים לקבל דוחות באגים ולצפות ביומני תהליכים ארגוניים במכשיר מנוהל.
כדי להפעיל דוח על באג (כלומר, הנתונים המקבילים שנאספים על ידי adb bugreport
, שמכילים את dumpsys
, את dumpstate ואת נתוני logcat), משתמשים ב-DevicePolicyController.requestBugReport
. אחרי שהדוח על הבאג נאסף, המשתמש מתבקש להביע הסכמה לשליחת הנתונים של דוח הבאג. התוצאות מתקבלות על ידי DeviceAdminReceiver.onBugreport[Failed|Shared|SharingDeclined]
. למידע נוסף על התוכן של דוחות על באגים, קראו את המאמר קריאת דוחות על באגים.
בנוסף, חשבונות DPC של בעלי המכשיר יכולים גם לאסוף יומנים שקשורים לפעולות שמשתמשים ביצעו במכשיר המנוהל. תיעוד ביומן של תהליכים בארגון נדרש לכל המכשירים שמדווחים על device_admin, והוא מופעל באמצעות מאגר אבטחה חדש ביומן שרק שרת המערכת יכול לקרוא (כלומר, $ adb logcat -b security
לא יכול לקרוא את המאגר). השירות ActivityManager והרכיבים של Keyguard מתעדים ביומן האבטחה את האירועים הבאים:
- תהליכי אפליקציות מתחילים
- פעולות של אבטחת מקשים (למשל, כישלון וביטול נעילה)
adb
פקודות שהופעלו במכשיר
כדי לשמור יומנים במהלך הפעלות מחדש (לא הפעלה מחדש קרה) ולאפשר ל-DPC של בעלי המכשיר לגשת אליהם, ליבה של המכשיר צריכה לכלול את הפונקציות pstore
ו-pmsg
, ו-DRAM צריך להיות מופעל ומתרענן בכל שלבי ההפעלה מחדש כדי למנוע פגיעה ביומנים שנשמרים בזיכרון. כדי להפעיל את התמיכה, משתמשים בהגדרה config_supportPreRebootSecurityLogs
בקטע frameworks/base/core/res/res/values/config.xml
.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. 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,["# Test device management\n\nTo ensure minimal support for managed profiles, OEM devices must contain the\nfollowing essential elements:\n\n- Profile owner (as described in [Ensuring\n Compatibility with Managed Profiles](https://developer.android.com/training/enterprise/app-compatibility.html))\n- Device owner\n\nFor a complete list of requirements, see\n[Implement device\nmanagement](/docs/devices/admin/implement). To test device management features, device owners can\nuse the TestDPC application described below.\n\nSet up device owner for testing\n-------------------------------\n\nUse the following instructions to set up a device owner testing environment.\n\n1. Factory reset the target device.\n2. Ensure the device does not contain any user accounts (for example, those used to log into online services). To verify, check *Settings \\\u003e Accounts*.\n3. Set up the testing application using one of the following methods:\n - [Download\n the TestDPC application](https://play.google.com/store/apps/details?id=com.afwsamples.testdpc&hl=en) (available from Google Play).\n - [Build\n the TestDPC application](https://github.com/googlesamples/android-testdpc/) (available from github.com).\n4. Set the TestDPC app as the device owner using the following command: \n\n ```\n adb shell dpm set-device-owner \"com.afwsamples.testdpc/.DeviceAdminReceiver\"\n ```\n5. Go through device owner setup on the device (encrypt, select Wi-Fi).\n\nVerify device owner setup\n-------------------------\n\nTo verify the device owner was correctly setup, go to *Settings \\\u003e\nSecurity \\\u003e Device Administrators* and confirm TestDPC is in the\nlist. Verify it cannot be disabled (this signifies it is a device owner).\n\nBug reports and logs\n--------------------\n\nAs of Android 7.0, device owner Device Policy Client (DPCs) can get bug\nreports and view logs for enterprise processes on a managed device.\n\nTo trigger a bug report (that is, the equivalent data collected by\n`adb bugreport` containing `dumpsys`, dumpstate, and\nlogcat data), use `DevicePolicyController.requestBugReport`. After\nthe bug report is collected, the user is prompted to give consent to send the\nbug report data. Results are received by\n`DeviceAdminReceiver.onBugreport[Failed|Shared|SharingDeclined]`. For\ndetails on bug report contents, see\n[Reading bug reports](/docs/setup/read-bug-reports).\n\nIn addition, device owner DPCs can also collect logs related to actions a\nuser has taken on a managed device. Enterprise process logging is required for\nall devices that report device_admin and enabled by a new log security buffer\nreadable only by the system server (that is, `$ adb logcat -b security`\ncannot read the buffer). ActivityManager service and Keyguard components log the\nfollowing events to the security buffer:\n\n- Application processes starting\n- Keyguard actions (for example, unlock failure and success)\n- `adb` commands issued to the device\n\nTo optionally retain logs across reboots (not cold boot) and make these logs\navailable to device owner DPCs, a device must have a kernel with\n`pstore` and `pmsg` enabled, and DRAM powered and\nrefreshed through all stages of reboot to avoid corruption to the logs retained\nin memory. To enable support, use the\n`config_supportPreRebootSecurityLogs` setting in\n`frameworks/base/core/res/res/values/config.xml`."]]