ADB command - screencap
2022-07-01 本文已影响0人
享受健身和阅读
adb shell screencap -h
usage: screencap [-hp] [-d display-id] [FILENAME]
-h: this message
-p: save the file as a png.
-d: specify the physical display ID to capture (default: 4630947043778501762)
see "dumpsys SurfaceFlinger --display-id" for valid display IDs.
If FILENAME ends with .png it will be saved as a png.
If FILENAME is not given, the results will be printed to stdout.
例子:
adb shell screencap -p -d 1 /sdcard/test3.png
adb pull /sdcard/test3.png
-d参数代表如果手机有两个屏幕。例如折叠屏手机,需要用不同的displayid代表不同的屏幕,默认是0
查看displayid:
adb shell dumpsys SurfaceFlinger --display-id
Display 4630947043778501763 (HWC display 3): port=131 pnpId=QCM displayName=""
Display 4630947043778501762 (HWC display 0): port=130 pnpId=QCM displayName=""