如何检查Android App是否是设备所有者? [英] How to check if an Android App is a device owner?

查看:527
本文介绍了如何检查Android App是否是设备所有者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用机器人框架执行一个测试用例,其中必须安装一个应用程序并使其成为设备所有者,然后检查同一应用程序是否已成为设备所有者。我已经搜索了Stack Overflow和其他搜索引擎的结果,但是在那里,他们提到了如何使应用程序成为设备所有者,而不是如何检查应用程序是否是设备所有者。

I am executing one test case using robot framework where I have to install an app and make it as device owner and then check if the same app has become a device owner or not. I have searched though Stack Overflow and other search engine results but there, they have mentioned on how to make an app as device owner but not the way how to check if an app is a device owner.

我已经使用以下命令使我的应用成为设备所有者:

I have used following command to make my app as device owner :

adb shell dpm set-device-owner com.myapp.package/.main.receiver.DeviceAdminReceiver

现在,我想验证是否是设备所有者,或现在使用ADB命令。

Now, I wanted to validate whether it is a device owner or now using ADB command.

推荐答案

adb shell getprop ro.device_owner

如果启用了设备所有者模式,则返回 true

returns true if device owner mode is enabled.

这篇关于如何检查Android App是否是设备所有者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆