19

I'm thinking of investing in a Google Nexus 10 as my tablet of choice for testing my apps on - I just wondered is it possible to emulate other devices screen resolutions? As the nexus 10 has such a high res and DPI, I would like to be able to run my app on it in say, an 800 x 480 screen etc...

I would like to do this if possible because it would be faster than using the emulator and would support multi-touch. It seems like a no-brainer, but is it actually possible?

Wesley Wiser
  • 9,491
  • 4
  • 50
  • 69
Zippy
  • 3,826
  • 5
  • 43
  • 96

3 Answers3

25

There is a way - a post of G+ from Adam Powell (one of the Android devs) explains it nicely:

https://plus.google.com/u/0/107708120842840792570/posts/cz5TxuoNDfG

Basically there are some ADB commands you can use to change the resolution a device displays:

adb shell am display-size

and

adb shell am display-density

For devices 4.3+, the command is slightly different:

adb shell wm display-density
adb shell wm dislay-size
Booger
  • 18,579
  • 7
  • 55
  • 72
  • 1
    It's a pretty awesome tip - you are clever to actually ask the right question (I had never even thought this possible before I saw this tip on G+). – Booger Jan 14 '13 at 21:50
  • 5
    running the second command I get Unknown command: display-density, using android 4.03 – pt123 Feb 11 '13 at 19:53
  • Adam Powell updated the G+ post at the bottom - tl;dr, in Android 4.3+ the commands are now in 'adb shell wm' and changed names slightly: 'adb shell wm size' and 'adb shell wm density' – Mark Jul 05 '16 at 01:05
14

An update to this answer for Jelly Bean 4.3 from Android dev Adam Powell on Google+ (link found via this SO answer):

In Android 4.3 these options moved from the "am" command (ActivityManager) to the "wm" command (WindowManager). Type "adb shell wm" for details.

So you can now run on 4.3 devices:

adb shell wm size 1280x800 or whatever size or reset

and

adb shell wm density 480 or whatever density or reset

Just make sure the screen is not currently displaying at the moment you run the command.

Community
  • 1
  • 1
matt---
  • 2,470
  • 2
  • 20
  • 20
0

Another option is emulate a Tablet using Virtual Machine. I did a detailed tutorial based in other tutoriais, this is the link:

http://edwindh.blogspot.com/2014/07/emular-uma-tablet-ou-smartphone-com.html

edwindh
  • 99
  • 1
  • 4