A
A
afafefasd2015-05-23 15:01:08
Android
afafefasd, 2015-05-23 15:01:08

How to run adb programmatically in android 5.0?

Guys, there was a problem
In the emulator on versions 4.4.4, I took a screenshot
Process screencap = Runtime.getRuntime().exec("adb shell screencap -p " + screenshotFile);
screencap.waitFor();
But on version 5.0 of Nexus 5 I can’t take a screenshot programmatically
If I just do “adb shell” process.waitFor() it takes forever
without it (screencap -p "+ screenshotFile) I get an empty file
Doesn’t work on standard Google and genimotion
If I just write it in the terminal in the studio "adb shell screencap -p " + screenshotFile" then the screenshot is
taken Help who can)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Chvalov, 2015-06-08
@Chvalov

Look here:
stackoverflow.com/questions/11668767/android-take-...
stackoverflow.com/questions/20136121/android-how-t...
https://github.com/googlesamples/android-ScreenCapture

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question