美文网首页ADB Shell
ADB command - screencap

ADB command - screencap

作者: 享受健身和阅读 | 来源:发表于2022-07-01 14:42 被阅读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=""

    相关文章

      网友评论

        本文标题:ADB command - screencap

        本文链接:https://www.haomeiwen.com/subject/ntucbrtx.html