DO NOT FOLLOW THE INSTRUCTIONS ON THIS PAGE WITHOUT FIRST READING how to install
Find and enable developer options
On your Android device, open the Settings app (gear icon) and search for About Phone
. Click on it. You should see various technical information about your device, such the Android version and so on (TODO: screenshot here).
One of the items in the About listing, usually the bottommost one, is labeled Build number
and it contains a single line of long text made up of numbers, letters and dashes and so on, such as QPGS30.82-141-15-4
. Tap on Build number
about 8 times. While you do this, a message should appear on your screen informing you that you are about to become a developer. Continue tapping until a message appears that tells you that you have become a developer. After this message, no more messages should show up when you tap Build number
.
Exit the About
section and search for Developer options
in the Settings app. It is usually in the System
section at the very bottom. On some devices, it is even hidden in an Advanced
section. Open the Developer options.
Enable USB debugging
Within the Developer options
, there is a long list of settings that can be adjusted. Most of them are not of interest and should not be changed. Scroll down the list until you reach the item labeled USB debugging
. Depending on your device vendor, there may be two or more listings that deal with this topic.
Use the switch to enable USB debugging
. If there are other items relevant to USB debugging
, review all of them. On Xiaomi devices, for example, you might need to enable installation of apps via USB also enable commands via USB in a setting called Security settings for USB debugging
.
USB debugging is now enabled on the device.
Connect and authorize computer for USB debugging
To be able to use ADB on your computer to configure your device you must authorize the computer once. Connect your device to the computer using a USB cable. On the screen of the Android device (not the computer), there should a notification about the USB connection, probably showing that your device is being charged. Click this notification to open a menu to change the USB mode. Select “File transfer” or “Android Auto”. On some devices, this is already set by default.
Once your device is connected to the computer via a USB cable and the USB mode is set correctly you can start running ADB commands. Open a command prompt and navigate to the folder where your Android platform tools are stored. On Windows the path is similar to C:\Users\You\AppData\Local\Android\Sdk\platform-tools
, and on Linux it should be something like /usr/local/android-sdk/platform-tools
or /home/user/Android/Sdk/platform-tools
.
In the command prompt run the following command:
adb devices
Trouble on Ubuntu. If you see output similar to the following:
$ adb devices
List of devices attached
55555XXXX55555 no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]
Try this:
adb kill-server
sudo adb start-server
adb devices
It should print a list of devices, which might be empty. If the list is empty, ADB can’t find your device. Something is odd with the preconditions. You should first try a different USB cable. Otherwise double-check the previous steps in this guide. If the list contains a device that is marked as “unauthorized”, check the screen of your device. It should have opened a prompt asking for authorization for USB-Debugging. Allow the authorization. Run the same command again which should now print a list of devices (probably containing only a single one).
Installing Andoff
The easiest way to install Andoff is by installing it from the Play Store. The app is available in early access and you can find it by searching for “Andoff” or by following this link:
https://play.google.com/store/apps/details?id=app.plucky.dpc
Alternatively, you can download the APK file using the link https://up.pluckeye.net/andoff.apk directly onto your device and install it from there. If you are reading this page on a different computer, you can scan the QR code to easily transfer the link to your device.
To install the APK after download, you might need to permit the installation of apps from unknown sources first, which your device should instruct you to do so. Once the app is installed you need to make it the device owner.
You can also download the app to your computer and install it using an ADB command. Use this command for installing the app:
adb install path/to/app.apk
Note: On Windows, use backslashes instead of forward slashes.
Making Andoff the device owner
You can now use ADB to make our app the device owner on your device. To do this, first, remove the Google account that is registered on the device. You can do this in the “Accounts” section of the Settings app. After the setup is done you can sign back into your account.
Run the following command to make our app the device owner:
adb shell dpm set-device-owner app.plucky.dpc/.PluckyDAR
If the command runs successfully it will print something like this:
Success: Device owner set to package ComponentInfo{app.plucky.dpc/app.plucky.dpc.PluckyDAR}
Active admin set to component {app.plucky.dpc/app.plucky.dpc.PluckyDAR}
If the command instead outputs something that starts with…
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device
… then there is still an account that is set as the device owner. Remove all remaining accounts, including your vendor account (Samsung, Xiaomi, …) and try again. After the setup is done you can sign back into all of the accounts.
If the command outputs something else and reports an error, something might be wrong with the USB debugging
permissions. Review those and check whether more USB debugging
options in the Developer options
of your device can be adjusted. Try out whether any of the configurations solves this problem.
If in the end, you cannot get this command to run successfully, ADB might not be able to make our app the device owner on your device. There are vendors and devices where this essentially seems impossible. We do not know about the number of devices that are affected by this. If you experience this, please reach out to us and tell us which device you are using. This is very helpful information for us and we might be able to assemble a list of devices for other people to look up whether they can use ADB or not.
Last updated: 2024-02-26