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參數(shù)代表如果手機有兩個屏幕午磁。例如折疊屏手機拦止,需要用不同的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=""