Is there any way to get screenshot in Android Studio
(or via ADB
) for Raspberry Pi 3 Model B with Android Things Developer Preview on it? (any other way not via Android Studio
/ADB
also accepted).
Asked
Active
Viewed 2,582 times
2

Andrii Omelchenko
- 13,183
- 12
- 43
- 79
-
Try this: https://developer.android.com/studio/command-line/adb.html#screencap, or just take a screen shot from the terminal. – Kolten Sturgill Jan 10 '17 at 20:22
-
I was try https://developer.android.com/studio/command-line/adb.html#screencap - file created, but it's size is 0. – Andrii Omelchenko Jan 10 '17 at 20:44
-
How about this instead: http://raspberrypi.stackexchange.com/questions/7423/how-to-printscreen-on-raspberry-pi ? I'm assuming you're on the GUI version. – Kolten Sturgill Jan 10 '17 at 20:48
-
That approach not going to work for me: there is `Android Things` OS on my `Raspberry Pi` board, not `Raspbian`. – Andrii Omelchenko Jan 10 '17 at 20:53
-
1if everything else fails you can use Vysor and take screenshots on the PC https://twitter.com/blundell_apps/status/816024685100023809 – Blundell Jan 10 '17 at 21:04
-
My mistake. Then that only leaves my earlier suggestion, maybe try saving in different locations? I've never used Android Things, but I've taken screenshots from the command line on Android devices. Best of luck. – Kolten Sturgill Jan 10 '17 at 21:06
-
1You might try [this solution](http://stackoverflow.com/questions/41534666/android-things-take-a-screenshot/41795301#41795301) – Onik Jan 22 '17 at 19:56
-
@Onik I was tried, and indeed got file with nonzero length, but I can't convert it to image by any utils (ffmpeg, ImageMagic etc.) :( – Andrii Omelchenko Jan 23 '17 at 09:11
-
@Andriy Omelchenko I've got just 2 parameters left to change in my solution: screen resolution and pixel format... Anyways, how did you convert the video gained by `screenrecord` in the accepted answer? – Onik Jan 23 '17 at 09:21
-
I'm just pull adb pull `screen.mp4` file from Raspberry Pi 3 with by `adb pull /sdcard/screen.mp4` command and play it in default windows mediaplayer. No video converter needed. – Andrii Omelchenko Jan 23 '17 at 14:20
-
@Andriy Omelchenko _"I'm just pull adb pull screen.mp4 file...and play it in default windows mediaplayer"_ In this case it's called a video file, not screenshot, which is to be of `png`, `jpeg`, etc. formats. – Onik Jan 23 '17 at 16:17
-
@Onik Indeed. But at least I got `.mp4` file, which I can open in player. `screenshot` file from [here](http://stackoverflow.com/a/41795301/6950238) I can't open in anywhere. By the way, how determine parameters (screen resolution or pixel format) for `ffmpeg` command line? – Andrii Omelchenko Jan 23 '17 at 17:17
-
@Andriy Omelchenko _"screenshot file from here I can't open in anywhere"_ It doesn't mean the solution isn't working, it means you do use it in a wrong way. _"By the way, how determine parameters"_ You should have known your display resolution, otherwise how did you configured your display on the first `Android Things` boot? Anyways, there are many ways, e.g. `adb shell dumpsys window | grep mUnres` – Onik Jan 23 '17 at 18:34
-
1@Onik I'm never wrote that Your solution didn't working. I just wrote that I can't do anything with received file. May be someone can convert it. Thanks for ADB command (seems there is no need to know display resolution for `Android Things` boot). I will try Your solution again! – Andrii Omelchenko Jan 23 '17 at 18:51
3 Answers
3
It's not a "screenshot", but how about mp4 movie instead?
adb shell screenrecord --verbose /sdcard/screen.mp4 --time-limit 1
Though the recorded movie is not correctly recorded, it's still like a "screenshot". (I cannot get a frame out of it using QuickTime Player, but any other tool might be able to extract it.)
It seems that AndtoidThings supports old limited OpenGL version that unsupports screenshots.
01-01 00:00:10.606: I/SurfaceFlinger(148): version : OpenGL ES-CM 1.0
01-22 02:07:02.687: E/libEGL(148): called unimplemented OpenGL ES API
01-22 02:07:02.687: E/SurfaceFlinger(148): glCheckFramebufferStatusOES error 0
01-22 02:07:02.687: E/SurfaceFlinger(148): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot

Tatsuhiko Arai
- 184
- 6
-
-
1I doubt it's because of _"old limited OpenGL version"_. I have `OpenGL ES-CM 1.1` on my `Android 4.2` phone and the `screencap` works as expected. Probably it's a buffer-handling thing... – Onik Jan 26 '17 at 00:47
1
You can get screenshot from Vysor application installed on chrome browser.To do this follow the procedure below.
- install Vysor in chrome browser.
- Connect PC with Pi using adb connect.
- Open Vysor on PC and enjoy.

Pravin Londhe
- 865
- 7
- 14
0
You can also use the Android Device Monitor
.
Open it from Android Studio menu Tools -> Android -> Android Device Monitor
or run it from the sdk directory sdk/tools/monitor
.

Elyess Abouda
- 659
- 12
- 20