Grant a permission from a computer with adb
Some permissions can only be given over USB debugging. Install Google's platform-tools, connect your phone, and run the one command the app shows you.
Which app is this for
- Charge Control
Needs
WRITE_SECURE_SETTINGSso the built-in limit can switch on your phone's own battery protection. - Ampere Alarm
Needs
BATTERY_STATSto read the battery's own health figure and dates, on Android 14 and newer. - App Freezer
Uses
WRITE_SECURE_SETTINGSto turn wireless debugging back on after a restart. It usually grants this itself.
What you need
- A Windows, Mac or Linux computer.
- A USB cable that carries data, not only charge.
- The app installed on your phone.
Settings paths are for stock Android, as on a Pixel, with Android's UK English names. Phone makers move and rename some of them; where we're sure of a maker's own path, we give it.
The commands
Each app shows its own line, with a Copy command button where it applies. They're the same as these:
Charge Control: the built-in limit
adb shell pm grant com.rhs.ccontrol android.permission.WRITE_SECURE_SETTINGSIn the app: Settings › Control engine › Built-in limit, under Grant from a computer.
Ampere Alarm: manufacturer data
adb shell pm grant com.rhs.battery android.permission.BATTERY_STATSIn the app: Stats › Health, on the Manufacturer data card. Android 14 and newer.
App Freezer: reconnect after a restart
adb shell pm grant com.rhs.appfreezer android.permission.WRITE_SECURE_SETTINGSYou rarely need this one. App Freezer gives itself the permission over wireless debugging once it's connected. It's used only on Android 11 and newer.
Note
Where to run them
Run these on your computer, in a terminal, not inside the app or in a message to us. None of them roots your phone or gives the app your files.
Step by step
Download platform-tools. Get Google's SDK Platform-Tools for Windows, Mac or Linux from the platform-tools page. It's free and has
adbin it. Unzip it anywhere, such as your Downloads folder: there's nothing to install.- Windows may need your phone maker's USB driver. Google links to them from Install OEM USB drivers.
- Mac needs nothing more.
- Ubuntu Linux needs two set-up steps, the
plugdevgroup andudevrules, listed in Google's device set-up.
Open a terminal in the platform-tools folder.
- Windows: open the
platform-toolsfolder in File Explorer, click the address bar, typecmdand press Enter. A Command Prompt opens in that folder. - Mac: open Terminal, type
cdand a space, drag theplatform-toolsfolder onto the window, and press Enter. - Linux: open a terminal in the
platform-toolsfolder.
Note
On a Mac, on Linux and in PowerShell
Type
./adbinstead ofadbat the start of every command, for example./adb devices.- Windows: open the
Turn on USB debugging on the phone. Open Settings › About phone and tap Build number seven times to turn on Developer options. Then open Settings › System › Developer options and switch on USB debugging.
On Samsung phones, Build number is under Settings › About phone › Software information, and Developer options appears at the bottom of the main Settings list.
Connect the phone and allow the computer. Plug the phone into the computer, unlock it, and run:
Command adb devicesThe phone asks Allow USB debugging? and shows the computer's RSA key fingerprint. Tick Always allow from this computer if it's your own, and tap Allow.
Check the phone is listed. Run
adb devicesagain. You should see one line that ends indevice:What it looks like List of devices attached 0a388e93 deviceIf it ends in
unauthorized, look at the phone for the prompt. If nothing is listed, see Common problems.Run the app's command. Copy the line for your app from the commands above, paste it into the terminal and press Enter. If it worked, it prints nothing and the prompt comes back. A message means something went wrong: see Common problems.
Unplug the phone. The permission stays after you unplug, and after a restart, until you take it away or uninstall the app.
Warning
Only allow your own computer
A computer you've allowed can control the phone while USB debugging is on. Don't allow a computer you don't trust, and switch USB debugging off when you're done, unless an app you use needs it.
App Freezer: freeze one app from a computer
If you try to freeze an app before setting up a freeze method, App Freezer offers Use a computer instead. It shows two commands for that app, with its package name and your user number filled in, each with a copy button. For the phone's main user, they look like this:
adb shell pm disable-user --user 0 com.example.app
adb shell pm enable --user 0 com.example.appThe first freezes the app, the second unfreezes it. Copy them from App Freezer rather than typing them: the package name has to match exactly. Frozen apps stay frozen after a restart.
App Freezer's device owner needs no command
App Freezer sets up its device owner method itself, through wireless ADB or Shizuku, so there's nothing to run on a computer. It only works on a phone with no accounts signed in, which in practice means straight after a factory reset. If Dhizuku is already device owner on your phone, App Freezer can use it instead, with no reset.
Read App Freezer's freeze methods before you choose it: your phone shows as managed, some banking and streaming apps refuse to run on managed phones, and App Freezer can't be uninstalled until you turn device owner off.
Check it worked
- Charge Control: tap Check again on the built-in limit screen. It says Permission granted, and you can tap Use built-in limit.
- Ampere Alarm: open Stats › Health again. The Manufacturer data card shows the battery's own health figure, and when it was made or first used, where your phone reports them. If it says This phone doesn't report manufacturer battery data, the permission is there but the phone doesn't share these figures.
- App Freezer: there's nothing to see straight away. After a restart on a Wi-Fi network you've allowed for wireless debugging, App Freezer reconnects by itself.
Common problems
- The terminal says
'adb' is not recognizedorcommand not found. - The terminal isn't open in the
platform-toolsfolder, or you need./adb(Mac, Linux and PowerShell). Go back to step 2. adb devicesshowsunauthorized.- Unlock the phone and allow the computer in the Allow USB debugging? prompt. If no prompt appears, unplug the phone, tap Revoke USB debugging authorisations in Developer options, and plug it in again.
adb deviceslists nothing.- Try another cable or USB port: some cables only charge. On Windows, install your phone maker's USB driver. Then restart adb with
adb kill-serverand runadb devicesagain. - It says
adb: more than one device/emulator. - Unplug the other phones, or put
-sand the serial number fromadb devicesafteradb, for exampleadb -s 0a388e93 shell pm grant …. - The command ends in an error that mentions
Unknown package. - The app isn't installed on this phone, or the line was mistyped. Copy it from the app or from this page.
- The command ends in a
SecurityExceptionon a Xiaomi, Redmi or POCO phone. - Switch on USB debugging (Security settings) in Developer options as well, then run the command again. It's a separate switch from USB debugging.
- The app still asks for the permission.
- Close the app fully and open it again. In Charge Control, tap Check again.
Undo it
Warning
Charge Control: turn charge control off first
When you turn charge control off, Charge Control puts your phone's own battery setting back the way it was. It can only do that while it still has the permission.
Take a permission back with pm revoke and the same names:
adb shell pm revoke com.rhs.ccontrol android.permission.WRITE_SECURE_SETTINGSadb shell pm revoke com.rhs.battery android.permission.BATTERY_STATSadb shell pm revoke com.rhs.appfreezer android.permission.WRITE_SECURE_SETTINGS- Uninstalling the app also removes its permissions.
- To stop trusting every computer you've allowed, tap Revoke USB debugging authorisations in Developer options.
- Switch off USB debugging when you don't need it.
Sources
Commands and package names are the ones our apps show or run, or come from these sources. We checked the steps against them on .
- Android Developers: SDK Platform-Tools release notes and downloads
- Android Developers: Android Debug Bridge (adb), including pm grant and pm revoke
- Android Developers: Configure on-device developer options
- Android Developers: Run apps on a hardware device
- Android Developers: Install OEM USB drivers
Something here wrong, or different on your phone? Email support@softplex.io with your phone model and Android version.