You can turn off your Android phone using ADB (Android Debug Bridge) by executing a specific command in your computer's terminal or command prompt: adb shell reboot -p
. This command instructs your device to power down completely.
Understanding the ADB Command for Power Off
The core command to power off your Android device via ADB is adb shell reboot -p
. This is a powerful and direct way to shut down your phone, especially useful if your physical power button is not working or if you're automating tasks.
Let's break down the command:
adb
: This is the main Android Debug Bridge command-line tool that allows communication with an Android device.shell
: This subcommand opens a shell on the target Android device, allowing you to run Linux commands directly on the device's operating system.reboot
: Within the device's shell, this is the command for initiating a restart or shutdown process.-p
: This is a flag (or option) passed to thereboot
command, which specifically tells it to power off the device instead of simply rebooting it. Without this flag,adb shell reboot
would restart your phone.
Prerequisites for Using ADB
Before you can turn off your phone with ADB, ensure you have the following set up:
- ADB Installed: You must have the Android SDK Platform-Tools (which includes ADB) installed on your computer.
- USB Debugging Enabled: On your Android phone, you need to enable Developer Options and then toggle on USB Debugging. This allows your computer to communicate with your phone via ADB.
- Phone Connected: Your Android phone must be connected to your computer using a USB cable. Ensure it's properly recognized by your computer.
- Authorized Connection: When you first connect your phone with USB Debugging enabled, a pop-up on your phone will ask you to "Allow USB debugging." You must grant this permission.
Step-by-Step Guide
Follow these steps to power off your phone using ADB:
- Connect Your Phone: Plug your Android phone into your computer using a USB cable.
- Open Terminal/Command Prompt:
- Windows: Open the Command Prompt or PowerShell. You might need to navigate to the directory where your ADB tools are located (e.g.,
C:\platform-tools
). - macOS/Linux: Open the Terminal. You can typically run ADB commands from any directory if ADB is added to your system's PATH.
- Windows: Open the Command Prompt or PowerShell. You might need to navigate to the directory where your ADB tools are located (e.g.,
- Verify ADB Connection (Optional but Recommended):
- Type
adb devices
and press Enter. You should see your device listed with a "device" status, confirming a successful connection.
- Type
- Execute the Power Off Command:
- Type the following command and press Enter:
adb shell reboot -p
- Type the following command and press Enter:
Your phone will then begin the shutdown process and power off completely.
ADB Power Management Commands
ADB offers various commands for managing your device's power state, as summarized below:
Command | Description |
---|---|
adb reboot |
Reboots the device normally. |
adb reboot -p |
Powers off the device. |
adb reboot recovery |
Reboots the device into recovery mode. |
adb reboot bootloader |
Reboots the device into bootloader (fastboot) mode. |
adb shell input keyevent 26 |
Simulates a single press of the power button (useful for turning the screen on/off or waking up the device). |
Important Considerations
Using ADB to power off your device is particularly useful in scenarios where the physical power button is broken, or you need to automate a shutdown process. It provides a reliable software-based method to control your device's power state. Always ensure USB debugging is enabled and you've authorized the connection before attempting these commands.