can not Deactivate this device Administrator - android

Have an application granted device administration, while trying to uninstall went to device Administrator screen, but the option to Deactivate this device administrator text's visibility is dim and i can not deactivate.

an app which is provisioned to be be device owner can not be removed as device owner by the user.
i think it make sense.
once the Device Owner application is set, it cannot be unset with the adb dpm command. it can be programmatically done by this code called by owner app itself.
DevicePolicyManager.clearDeviceOwnerApp()
or it has to be factory reset your device.

Run the following command in terminal.
adb shell dpm remove-active-admin com.your.App.Package/.DevAdminReceiver 0

Related

How to make my app device owner through code

I want to develop a kiosk mode app and need my app to be device owner. I have tried the command adb shell dpm set-device-owner and it works. But I want to publish this app so I can't obviously do this to all the devices. I have read in some posts that I can write
Runtime.getRuntime().exec("dpm set-device-owner ...");
I wrote this in my onCreate but it doesn't do anything. Is it related to my device not being rooted or am I missing something?

Disable a device owner app from android terminal

well, my problem is: I have an application which is set as the device owner of a device (my tablet in this case). I did it from the terminal in Ubuntu, connecting the tablet to my PC and executting this line in the adb shell:
dpm set-device-owner my.app.package/my.app.route.MyAdmin
So, I want to disable the device owner app without restoring the device, just executing a line similar to the last one. Me and my coworker have been researching for a long time and we've never found anything about this, so I would like to know if it is possible or not, and if it is, how to do that.
Thanks!
you can use the following ADB shell command to remove device owner
adb shell dpm remove-active-admin com.example.app/.AdminReceiver
Disables an active admin, the admin must have declared android:testOnly in the application in its manifest. This will also remove device owner and profile owners
You can use DevicePolicyManager.clearDeviceOwnerApp() from your device owner app.
However note that this method has been deprecated in Android Oreo, you can still use it on Oreo devices but it might be removed in future Android versions.

enable adb via adb sideload

Following scenario:
I have a unrooted (stock) android phone (Samsung) and I need to enable adb, but I don't have access to the device (forgot the lock code).
Is it possible to enable adb debugging via adb sideload from recovery?
For example creating a update.zip, that enables adb or installs an app, that enables adb on boot?
Thanks
Is it possible to enable adb debugging via adb sideload from recovery?
No. Your app would need special permissions to do such a thing. Obviously if an arbitrary app was able to turn on adb debugging without asking the user that'd be a bad thing.
As a side note, this sounds like what someone would ask if they had acquired a phone that didn't belong to them. Not that this would change the validity of my answer.

Remove Google Glass apk without having root access?

I was testing out the Glass quickstart and chose COMPASS to "re-upload" as a test (tutorial: https://developers.google.com/glass/develop/gdk/quick-start#for_android_beginners)
Now that it worked, I'm stuck with 2x "Compass - sample" and can't call either one by voice commands.
Compass isn't important to me but I am in the process of making an apps for the medical field and I would like to be able to remove it.
Is it possible to remove an .apk from Glass without rooting the device? I have Glass in debug mode and I'm capable of uploading apk's.
Thanks for the help!
You can remove it via the standard way over ADB:
adb shell pm uninstall com.example.MyApp
(where com.example.MyApp is the package name defined in the manifest).
If you have more than one device connected the command will fail - you can direct it to the only attached emulator via the -e flag, the only attached USB device via the -d flag, or a specific device via its serial number and the -s flag (serial numbers as listed in adb devices).

Creating an AVD profile via ADB

Is there any way to get or see all the device's
properties in Android Debug Bridege Shell?
adb-shell shows and retrieves only the device's, which is connected, current prosesses of the current session as I see.
I just wonder that there is an adb-shell script command to see that device's all technical product informations.
I am planning to create an Android Virtual Device profile, but I don't have any technical information about the device. But if I can get those informations from adb, then I will be able to create that profile to build and to run android applications.
To see all connected devices, you can type adb devices
To get the serial number, you can type adb serialno
Also, adb status-window opens a window with constant monitoring of the device
More crazy:
adb shell pm list features shows a list of features the device has
adb shell pm list users shows a list of users the device has (needs root)
You can't really get things like screen resolution etc through ADB unfortunately.

Categories

Resources