ADB Concepts :How to extract ‘Screen Resolution’ & ‘Screen Density’ & ‘Screen Parameters’
- adb shell wm size
- adb shell wm density
- adb shell dumpsys window displays

Please go through the below video for complete details:
Summary:
Case-1: Command to display the physical size of an Android device screen
Command:
adb shell wm size
Explanation:
adb shell: Will initiates a shell interface on the Android device, which allows you to execute commands directly on the device from your computer.
wm: This command allows the user to access the display-related properties which were managed by the window manager.
size: This argument requests the command to print out the physical dimensions of the device’s screen in pixels.
Output:

Note: Output indicates that device’s screen dimensions , 1080 pixels in width & 2400pixels in height
Case-2: Command to display the physical density of an Android device screen
Command:
adb shell wm density
Explanation:
adb shell: Will initiates a shell interface on the Android device, which allows you to execute commands directly on the device from your computer.
wm: This command allows the user to access the display-related properties which were managed by the window manager.
density: This argument fetches the screen density information which shows how many pixels are present per inch of the screen.
Output:

Note: Physical density: 420
Case-3: Command to display the comprehensive display information
Command:
adb shell dumpsys window displays
Explanation:
Explanation:
adb shell: Will initiates a shell interface on the Android device, which allows you to execute commands directly on the device from your computer.
dumpsys: Is the tool that runs on Android devices and provides information about system services.
Output:

GitHub Link:
No comments:
Post a Comment