Taking a screenshot and video for kitkat only from a device display

suggest change

Screen shot: Option 1 (pure adb)

The shell adb command allows us to execute commands using a device’s built-in shell. The screencap shell command captures the content currently visible on a device and saves it into a given image file, e.g. /sdcard/screen.png:

adb shell screencap /sdcard/screen.png

You can then use the pull command to download the file from the device into the current directory on you computer:

adb pull /sdcard/screen.png

Screen shot:Option 2 (faster)

Execute the following one-liner:

(Marshmallow and earlier):

adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png

(Nougat and later):

adb shell screencap -p > screen.png

The -p flag redirects the output of the screencap command to stdout. The Perl expression this is piped into cleans up some end-of-line issues on Marshmallow and earlier. The stream is then written to a file named screen.png within the current directory. See this article and this article for more information.

Video

this only work in KitKat and via ADB only. This not Working below Kitkat To start recording your device’s screen, run the following command:

adb shell screenrecord /sdcard/example.mp4, This command will start recording your device’s screen using the default settings and save the resulting video to a file at /sdcard/example.mp4 file on your device.

When you’re done recording, press Ctrl+C (z in Linux) in the Command Prompt window to stop the screen recording. You can then find the screen recording file at the location you specified. Note that the screen recording is saved to your device’s internal storage, not to your computer.

The default settings are to use your device’s standard screen resolution, encode the video at a bitrate of 4Mbps, and set the maximum screen recording time to 180 seconds. For more information about the command-line options you can use, run the following command:

adb shell screenrecord –help, This works without rooting the device. Hope this helps.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


ADB Android Debug Bridge:
* Taking a screenshot and video for kitkat only from a device display
* Backup

Table Of Contents
2 Gradle
5 Intent
17 Service
19 WebView
31 SQLite
32 ADB Android Debug Bridge
35 Glide
37 Dialog
38 ACRA
44 Handler
53 Toast
63 Menu
65 Picasso
70 Volley
71 Widgets
78 Realm
90 Spinner
95 OkHttp
108 TextView
109 ListView
111 Loader
118 Xposed
119 Security
121 ImageView
123 Doze Mode
130 Drawables
131 Colors
134 Fresco
139 AdMob
145 Keyboard
146 Button
150 EditText
155 Vk SDK
163 ExoPlayer
169 XMPP
175 OpenCV
177 Threads
184 ORMLite
186 TabLayout
190 LruCache
192 Zip files
194 Fastlane
199 FileIO
202 Moshi
210 VideoView
216 Paint
218 ProGuard
226 CleverTap
228 ADB shell
229 Ping ICMP
230 AIDL
234 Context
240 JCodec
242 Okio
249 FuseView
254 Looper
261 Fastjson
263 Jackson
267 Smartcard