I'm trying to take a screenshot of Samsung Galaxy Fold's smaller display.
shell screencap -p /sdcard/testss1.png
but it only captures the main display ― which is off ― and gets a black image.
How to change the display used for capturing?
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.Sign up to join this community
The screencap command can be configured to capture a specific display using the option
-d: specify the physical display ID to capture. See
dumpsys SurfaceFlinger --display-idfor valid display IDs.
The output of
dumpsys SurfaceFlinger --display-id is a bit longer, therefore you can filter out the display ids:
dumpsys SurfaceFlinger --display-id | grep display_id
On my device I only have one display with display_id=0.
Therefore the final command looks like this (just replace display_id):
shell screencap -d <display_id> -p /sdcard/testss1.png