Friday 3 May 2019

How to Capture screenshot and video using adb commands

adb command There are multiple situations where you want to capture the screenshots or video and store in a folder all programmatically. This is simple and one line adb command that can be used to capture the screenshot and video.

Capture Screenshot:

Please find the below steps to capture the screenshot of an android device

1. Connect device to laptop. To confirm whether device is connected or not, run below command
 2. Screencap is the adb command which is used for capturing the screenshots



3. Once the screenshot is captured, its time to pull out from device to laptop.



The image is pulled on your system.

Capture Video:

Please find the below steps to capture the video of an android device. This is generally required when you want to give steps for reproducing certain issues.

1. Connect device to laptop. To confirm whether device is connected or not, run below command


2. Screenrecord is the adb command which is used for capturing the screenshots


3. Once the screen activities are recorded press ctrl+C to stop the recording.

The video which was captured is stored on sdcard. To pull out the video from sdcard please run below command

Here is simple program that depicts how programatically you can use above two commands
Same way we can also write script for video recording.


No comments:

Post a Comment

Feature Posts

Python Appium - Step by step procedure for capturing screenshot

 Why To capture screenshot? It is as important as your logs. If there is any failure for any test scenario, we can provide screenshot for th...