API Development

How to resize the Android Emulator

Editor’s note: This blog post is a basic tutorial. The most up-to-date version is available in the wiki.

In this tutorial we’ll cover a couple of ways to resize or scale the Android Emulator.

Method One

  1. In Titanium Studio, run your application once in the emulator that you want to use so that it will create a virtual device.
  2. Close the emulator.
  3. Launch the Android AVD Manager. (It is located in here: ‘$ANDROID_SDK/tools/android’ or you can refer to this tutorial)
  4. Select the emulator that was just created.
  5. Click the ‘Start’ button. It opens the ‘Launch Options’ dialog.
  6. Check the ‘Scale display to real size’ checkbox. It enables the ‘Screen Size’ and ‘Monitor dpi’ options in the middle.
  7. Click the ‘?’ button right to the ‘Monitor dpi’ field. It pops up the ‘Monitor Density’ dialog.
  8. Set your monitor’s screen size and current resolution. Then click ‘OK’ button.
  9. Set the ‘Screen Size (in):’ field to the size you want.
  10. Launch the emulator from the AVD Manager.
  11. Go back to Titanium Studio and ‘Launch’ your app again. It will load into the running emulator.

Monitor Density

Note: You must launch the emulator this way every time. If you launch the emulator from Titanium Studio, it will default to the original settings.

Method Two

Once the emulator is launched, connect to you device using the *telnet* command. You will need the name and port of your emulator. You can get this information using the *adb devices* command.

$ adb devices
List of devices attached
emulator-5560 device

$ telnet localhost 5560
Connected to localhost.
Escape character is '^]'.
Android Console: type 'help' for a list of commands
OK
window scale 0.75
OK

Please note that this change will not be permanent and you will have to do this operation every time you run the emulator.