adb shell dpm

1 需求


2 语法

C:\>adb shell dpm help
DevicePolicyManager Service (device_policy) commands:

  help
    Prints this help text.

  is-operation-safe <OPERATION_ID>
    Checks if the give operation is safe

  is-operation-safe-by-reason <REASON_ID>
    Checks if the operations are safe for the given reason

  set-operation-safe <OPERATION_ID> <REASON_ID>
    Emulates the result of the next call to check if the given operation is safe

  list-owners
    Lists the device / profile owners per user

  list-policy-exempt-apps
    Lists the apps that are exempt from policies

  set-active-admin [ --user <USER_ID> | current ] <COMPONENT>
    Sets the given component as active admin for an existing user.

  set-device-owner [ --user <USER_ID> | current *EXPERIMENTAL* ] [ --name <NAME> ] [ --device-owner-only ]<COMPONENT>
    Sets the given component as active admin, and its package as device owner.

  set-profile-owner [ --user <USER_ID> | current ] [ --name <NAME> ] <COMPONENT>
    Sets the given component as active admin and profile owner for an existing user.

  remove-active-admin [ --user <USER_ID> | current ] [ --name <NAME> ] <COMPONENT>
    Disables an active admin, the admin must have declared android:testOnly in the application in its manifest. This will also remove device and profile owners.

  clear-freeze-period-record
    Clears framework-maintained record of past freeze periods that the device went through. For use during feature development to prevent triggering restriction on setting freeze periods.

  force-network-logs
    Makes all network logs available to the DPC and triggers DeviceAdminReceiver.onNetworkLogsAvailable() if needed.

  force-security-logs
    Makes all security logs available to the DPC and triggers DeviceAdminReceiver.onSecurityLogsAvailable() if needed.

  mark-profile-owner-on-organization-owned-device [ --user <USER_ID> | current ] <COMPONENT>
    Marks the profile owner of the given user as managing an organization-owneddevice. That will give it access to device identifiers (such as serial number, IMEI and MEID), as well as other privileges.

3 示例


4 参考资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值