If your Android device won’t shut down or restart remotely via ADB, the problem is almost always a permission issue (either ADB isn’t authorized on the phone, or the shell user lacks the rights to issue power commands). The fix is to re-authorize the ADB connection, grant the necessary permissions, and use the correct command syntax.
Why Remote Shutdown/Restart Fails
ADB (Android Debug Bridge) lets a computer send commands to an Android device over USB or Wi-Fi. The commands adb reboot and adb shell reboot are the standard ways to restart, but there is no built-in adb shutdown command. To shut down, you must send the power key event: adb shell input keyevent 26 (which toggles the power button) or use adb shell svc power shutdown on some devices. These commands fail when:
- The device shows an “Allow USB debugging?” prompt that you didn’t accept.
- The ADB key on the computer was revoked or the device was re-paired.
- The shell user doesn’t have permission to execute power-related commands (especially on newer Android versions).
- The device is in a locked state that blocks input events.
- The Wi-Fi ADB connection dropped or the port changed.
Step-by-Step: Re-authorize and Fix Permissions
Follow these steps in order. They work for ADB over USB and Wi-Fi on Android 11 and newer.
- Reconnect and re-authorize: Plug the device into your computer via USB. Run
adb devices. If you see “unauthorized,” unlock the phone and look for the “Allow USB debugging?” dialog. Check “Always allow from this computer” and tap Allow. Then runadb devicesagain—it should now say “device.” - Restart the ADB server: Sometimes the server holds stale permissions. Run
adb kill-serverthenadb start-server, then reconnect. - For restart: Use
adb reboot. This works without root on most devices. - For shutdown: Try
adb shell svc power shutdownfirst. If that returns an error like “permission denied,” useadb shell input keyevent 26. Note that keyevent 26 toggles the power button: if the screen is on, it will turn off (not shut down). To force a shutdown, you may need to press and hold the power button viaadb shell input keyevent 26followed by a long-press event—but that’s not reliably supported. A more reliable method is to useadb shell reboot -p(the -p flag powers off). - If permission is still denied: On some Android versions, the shell user is not allowed to issue
svc power shutdownwithout root. In that case, the only reliable way is to use the keyevent method or install a third-party ADB app that has theandroid.permission.SHUTDOWNpermission (which is normally only granted to system apps).
ADB Over Wi-Fi: Common Pitfalls
Android 11 introduced wireless debugging, but it’s not the same as ADB over TCP/IP from older versions. To use Wi-Fi ADB:
- Go to Settings > Developer Options > Wireless debugging and enable it.
- Use
adb pairwith the pairing code shown on the device, thenadb connect IP:PORT. - If the connection drops, the port may change. Re-check the Wireless debugging screen for the new IP and port.
- Make sure the computer and phone are on the same network and that the firewall on the computer allows ADB (port 5555 or the dynamic port).
A common mistake is trying to use adb connect without pairing first on Android 11+. That will fail with “failed to authenticate.”
What to Do When ADB Commands Hang or Timeout
If adb reboot seems to hang, it might be because the device is unresponsive or the USB cable is faulty. Try a different cable and port. Also check that the device is not in “charge only” mode—set USB mode to “File Transfer” or “PTP” in the notification shade. If the device is off, ADB won’t work at all; you’ll need to power it on manually.
Alternative: Using a Third-Party App
If you need to shut down or restart your Android device remotely on a regular basis, consider using an app like “ADB over Wi-Fi” or a network-based remote control app that runs on the device itself (not via ADB). These apps often require root or special permissions, but they can provide a more reliable shutdown command. For non-rooted devices, the keyevent method is the only way that works without extra permissions.
Security Considerations
ADB is a powerful tool. Leaving wireless debugging enabled on a public network is a security risk—anyone on the same network could connect and issue commands. Always disable wireless debugging when not in use. Also, never accept an ADB authorization prompt unless you are sure the computer is yours.
Frequently Asked Questions
Why does adb reboot work but adb shutdown doesn’t?
There is no adb shutdown command. The standard way is adb shell reboot -p or adb shell svc power shutdown. The latter may fail without root on some devices.
How do I grant ADB permission on a locked phone?
You can’t. You must unlock the phone and accept the “Allow USB debugging” prompt. If the screen is broken, you may need to use a tool like scrcpy to control it from the computer first.
Can I restart my Android remotely without ADB?
Yes, if you have a remote control app like TeamViewer or AirDroid installed, but those require the app to be running and may not have the permission to reboot without root. Some manufacturer apps (like Samsung’s Find My Mobile) allow remote restart if the device is registered.
Why does adb devices show “offline”?
This usually means the ADB key on the computer doesn’t match the device. Re-authorize by revoking USB debugging permissions on the device (Developer Options > Revoke USB debugging authorizations) and then reconnect.
Is there a way to shut down a rooted Android via ADB?
Yes, with root you can run adb shell su -c 'reboot -p' or adb shell su -c 'svc power shutdown'. Root gives the shell user the necessary permissions.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix 0x80070005 DISM Error & the 0x800070005 Typo
- Fix Access Denied Adding Shared Printer in Windows 10
- How to Play Minesweeper: Rules, Tips, and Winning Strategy
- Browser SQL Sandbox for Games: Build Guide
- Snapchat Face Swap: Step-by-Step Guide
- Fix a Computer Chair Height Adjuster: Step-by-Step