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?

  • Welcome to Android Enthusiasts Stack Exchange! Looks like you've got an answer by our community member. If you feel the answer is the most helpful, considering accepting the answer by clicking the gray tick below the vote on the answer. You can always change the acceptance if there is a better answer in the future. Thank you :) – Andrew T. Nov 7 '19 at 10:28

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 <display_id> -p /sdcard/testss1.png
  • It worked. If anyone will face same problem - the Fold's smaller display ID is 5 – Pablo Nov 7 '19 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.