148

I'm writing my first Android app for a small business that has some Droid phones. I set up an AVD for the phone with the right resolution: 854 pixels high.

I'm working on a MacBook Pro with a max screen resolution 900 pixels high, so when the emulator starts up, the bottom is cut off.

Is there a way to scale the emulator display down to 75% or something so that it fits on my screen? Any other solution (other than running everything on the phone itself)?

nbro
  • 15,395
  • 32
  • 113
  • 196
Scott Saunders
  • 29,840
  • 14
  • 57
  • 64
  • 1
    Here's something that makes the emulator segfault :( http://www.macworld.com/article/142173/2009/08/scaleapps.html – Josh Lee Mar 01 '10 at 23:40

11 Answers11

233

This is actually possible from your project as well, no need to start the emulator through the AVD manager:

  1. Go to Run > Run Configurations... > (Select your application on the left hand side) > (Click the "Target" tab on the right hand side).

  2. At the bottom there, you'll see Emulator launch parameters. In the additional emulator command line options, add '-scale 0.75' (to make the screen 75% of full size)

Next time you start the emulator it will have scaled properly.

nbro
  • 15,395
  • 32
  • 113
  • 196
Walter Heck
  • 2,526
  • 2
  • 14
  • 7
  • 14
    If you can't see the 'Emulator launch parameters' try resizing the Run Configurations window as there may be hidden fields. – Chris Knight Oct 25 '11 at 22:11
  • try starting with 0.5 or something. the -scale parameter allows a number up to 3.0 to be entered. – AndrewPK Jan 09 '12 at 22:37
  • 1
    So.. is there a way to do it in Android Studio? Edit: found it, it's under the emulator tagb under Run/Debug Configurations – bompf May 23 '14 at 16:07
  • 1. In Android Studio: click "Run" -> "Edit Configurations.." 2. On the left side select your current app (its probably selected already) 3. click on the "Emulator" tab 4. check "Additional command line options:" and write "-scale 0.75" (for 75% percent of the original size, use 0.5 for 50%, etc.) 5. Apply your changes, click "ok" and run your emulator – Christian Strang Apr 30 '15 at 18:48
  • Has anyone run into this in Android Studio? invalid command-line parameter: '-scale. NVM, it was because I included the quotes – CACuzcatlan Jun 24 '15 at 21:38
  • Tried, not working on Win10, giving strange results, not scaling but moving the inner window content of emulator outside the emulator borders – albanx Nov 08 '15 at 19:26
  • According to https://developer.android.com/studio/run/emulator-commandline `-scale` option is deprecated – ViliusK Sep 19 '18 at 11:27
107

From within Eclipse:

  1. Go to Window > Android SDK and AVD Manager > Virtual Devices

  2. Select the AVD you want to launch and click Start

  3. Check the Scale display to real size button

  4. Enter how big you want it to appear in inches and press Launch. For this to work, you'll have to also enter a reasonable approximation of your mac's screen resolution. I'm using 7 inches and 113 dpi for my 13" Macbook Pro, but you may be able to get away with 8 or 9 inches.

nbro
  • 15,395
  • 32
  • 113
  • 196
emmby
  • 99,783
  • 65
  • 191
  • 249
  • 11
    This solution is temp. as you need to do so every time you launch eclipse. Walter Heck's solution is better. – Mina Wissa Feb 14 '11 at 08:38
  • 1
    It depends, if you launch the emulator from Eclipse or the AVD Manager. Personnaly, I prefer this one because it explains the scale thing and it's from the AVD Manager – MrBuBBLs Nov 09 '11 at 18:28
  • 3
    @MinaSamy Go to Android SDK `tools` dir, `[root@pc tools]$ emulator your-emulator-name -scale .5`, which `.5` == `0.5`, and it means 50% of the real size. –  May 31 '12 at 01:43
  • According to https://developer.android.com/studio/run/emulator-commandline `-scale` option is deprecated – ViliusK Sep 19 '18 at 11:27
  • 1
    @ViliusK `-scale` is obsolete. Any other option? – Pankaj Jangid Nov 15 '18 at 03:03
53

There is also a way to re size the emulator through a windows command prompt.

  1. From command prompt run: telnet localhost 5554
  2. window scale 0.75
  3. quit

Assuming there is one emulator running with on port 5554.

iwasrobbed
  • 46,496
  • 21
  • 150
  • 195
mDiaz93
  • 531
  • 4
  • 2
  • 1
    That is not the ID the emulator. It's the port you're connecting to. – Geo Aug 13 '11 at 11:10
  • on my Windows 7 machine this command only scales the window horizontally.. i have also tries using 'window scale auto' but no luck. – Shurmajee Sep 21 '14 at 10:04
  • According to https://developer.android.com/studio/run/emulator-commandline `-scale` option is deprecated – ViliusK Sep 19 '18 at 11:27
6

The telnet answer above is great for Android Studio developers. I just wanted to add that the window scale command will take either a scale factor OR the dpi which may be easier for many people (measure once and it should work for you ADV which are 1dp:1 pixel)

telnet localhost PortNumOfAVD
window scale 96dpi
quit

Note telnet is not installed on windows by default anymore.

K5 Studios
  • 101
  • 1
  • 3
5

For Changing the window size of the Android Emulator

Append the parameter -scale ­­<scale factor> to the Emulator launch parameters. In eclipse, put it in the field "Additional Emulator Command Line Options" within the Run Configuration.

Allowed scale factors are those between 0.1 and 3, although the most common will probably be -scale 0.5 .

Ankit
  • 115
  • 2
  • 9
  • According to https://developer.android.com/studio/run/emulator-commandline `-scale` option is deprecated – ViliusK Sep 19 '18 at 11:27
4

If you are working with Eclipse, than here's is what you can do if the size of the emulator is too big for you screen:

  1. Run > Run Configurations
  2. Pick the "Target" tab
  3. Scroll down to "Additional Emulator Command Line Options" and put in: "-scale 0.7" or another number

This will keep the AVD scaled even if it is started automatically by Eclipse.

Enjoy

asiby
  • 3,229
  • 29
  • 32
  • According to https://developer.android.com/studio/run/emulator-commandline `-scale` option is deprecated – ViliusK Sep 19 '18 at 11:27
  • It was in 2011 that I posted that message... 8 years ago. So your answer must set the proper context. – asiby Sep 24 '18 at 15:36
1

If you launch your emulator outside of Eclipse, using the android command, you will be able to scale the screen as part of the launch process. Not sure how to do that in Eclipse, though.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • It's the same way, you have to launch the emulator prior to building, though (instead of having eclipse do it automatically) – synic Mar 01 '10 at 23:59
1

I definitely recommend running the emulator through terminal or command line because it allows you for much better control.

For example, if you want to run emulator in different size, you just need to run it like this.

~/Android/Sdk/tools/emulator -scale 0.35 -avd Nexus_5_API_23

Nexus_5_API_23 corresponds to existing AVD on my host computer. When you create different Android Virtual Devices, you can just replace it with name of your device and it works. So basically you just run emulator from Android SDK's tools directly. You can also add other parameters like netdelay, netspeed etc.

Drag0
  • 8,438
  • 9
  • 40
  • 52
  • According to https://developer.android.com/studio/run/emulator-commandline `-scale` option is deprecated – ViliusK Sep 19 '18 at 11:28
0

The command to open in Command Prompt is given below

  1. emulator -avd [- []] ... [-]. for details see http://developer.android.com/tools/help/emulator.html

To open a desired size emulator window follow the below command

  • emulator -avd "AVD_Name "-scale "Scale_Value"-dpi-device "dpi"

Example:

  • emulator -avd "AVD_Name "-scale auto -dpi-device 160/200. with dpi-device value 200

with dpi-device value 160

So just change the dpi-value according to your need. Hope u enjoy.

Pradyumna Swain
  • 1,128
  • 1
  • 12
  • 21
  • According to https://developer.android.com/studio/run/emulator-commandline `-scale` option is deprecated – ViliusK Sep 19 '18 at 11:27
0

Another option would be to use the GenyMotion emulator, where you can actually resize the emulator window in real time. It is also much faster than the stock emulator.

Pedro Lopes
  • 2,833
  • 1
  • 30
  • 36
0

You can permanently change window size of emulator by changing in config.ini file of avd

For that you need to follow this path

  • First go to your android #home directory
  • Then go to .android folder
  • Then avd folder and go to your avd named folder
  • you will see config.ini file

In config.ini file change the value of skin.name and skin.path to your conveniency. I have set it to 480x600 .

apeksha282
  • 56
  • 6