How to screencap the smaller display of Samsung Galaxy Fold using ADB 'screencap' command? I'm trying to take a screenshot of Samsung Galaxy Fold's smaller display.

I use

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?
The screencap command can be configured to capture a specific display using the option -d.


  -d: specify the physical display ID to capture.
  See dumpsys SurfaceFlinger --display-id for 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 &lt;display_id&gt; -p /sdcard/testss1.png