📅  最后修改于: 2023-12-03 14:39:01.570000             🧑  作者: Mango
ADB (Android Debug Bridge) is a versatile command-line tool that allows developers to communicate with an Android device or emulator. One of the useful features of ADB is the ability to take screenshots using the adb screenshot
command. This command captures the current screen of the connected Android device or emulator and saves it as an image file on the computer.
To take a screenshot using ADB, follow these steps:
adb devices
to verify that your device is detected by ADB.adb screenshot
.For example:
adb screenshot
This will capture the current screen of the connected device and save it as a PNG image file in the platform-tools directory.
The adb screenshot
command also provides some additional options to customize the screenshot capturing process. Here are some commonly used options:
-d <device>
: Specifies the device to capture the screenshot from when multiple devices are connected.
adb -s <device> screenshot
-e <file>
: Specifies the file to save the screenshot as.
adb screenshot -e path/to/save/screenshot.png
-p
: Displays the path of the saved screenshot file on the computer.
adb screenshot -p
-s
: Capture the screenshot and display it on the screen without saving it as a file.
adb screenshot -s
-r <scale>
: Specifies the scaling factor for the screenshot. The default value is 1.0.
adb screenshot -r 0.5
The adb screenshot
command is a powerful tool for capturing the screen of an Android device or emulator. Its flexibility and additional options make it a handy utility for developers to take screenshots for debugging, testing, or documenting purposes.