android adb截屏

阅读 72

2023-02-16



1.使用screencap这个命令,配合adb命令来实现截图并保存到手机的/sdcard目录中:

adb shell screencap -p /sdcard/testcap.png

2.用adb pull将手机中的文件取回本地:

adb pull /sdcard/
testcap

在linux中

使用

在.bashrc里加入以下的函数


# For Android Device Screenshot
function droidshot() {
adb shell screencap -p /sdcard/$1.png && adb pull /sdcard/$1.png
}

执行~/.bashrc

立即生效


. ~/.bashrc


droidshot testcap

精彩评论(0)

0 0 举报