Android display offset/change position

17,521

Here is the wm command usage:

usage: wm [subcommand] [options]
       wm size [reset|WxH|WdpxHdp]
       wm density [reset|DENSITY]
       wm overscan [reset|LEFT,TOP,RIGHT,BOTTOM]
       wm scaling [off|auto]
       wm screen-capture [userId] [true|false]

wm size: return or override display size.
         width and height in pixels unless suffixed with 'dp'.

wm density: override display density.

wm overscan: set overscan area for display.

wm scaling: set display scaling mode.

wm screen-capture: enable/disable screen capture.

wm dismiss-keyguard: dismiss the keyguard, prompting the user for auth if necessary.

So the command you're looking for is wm overscan to offset the display:

adb shell wm overscan a,b,c,d

Before Android 4.3:

adb shell am display-size

ref: https://plus.google.com/+AdamWPowell/posts/cz5TxuoNDfG and https://plus.google.com/+AndroidDevelopers/posts/QhWQArNDfS3

Share:
17,521
TheAnimatrix
Author by

TheAnimatrix

Well i ask a lot of questions , but i love to help others to :D.

Updated on June 04, 2022

Comments

  • TheAnimatrix
    TheAnimatrix almost 2 years

    Is it possible to offset the entire display content / change its position using adb shell?

    As i recently noticed it is possible to change the resolution .

    adb shell wm size <Res>.
    

    So , i was wondering if it's possible to introduce an offset or change the display position.