当前位置: 代码迷 >> 综合 >> android adb截屏
  详细解决方案

android adb截屏

热度:10   发布时间:2024-01-19 16:16:20.0


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

adb shell screencap -p /sdcard/testcap.png

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

adb pull /sdcard/testcap.png

在linux中

使用 在.bashrc里加入以下的函数

# For Android Device Screenshot
function droidshot() {    adb shell screencap -p /sdcard/$1.png && adb pull /sdcard/$1.png
}
执行~/.bashrc 立即生效
. ~/.bashrc

droidshot testcap

  相关解决方案