Build Android emulator (avd) with custom screen size and resolution from command line

I need to create android emulator from command line on windows with below specs,

screen size --> 4.7 inch
screen resolution --> 540x960 pixels
android version --> 4.4.2

      

I am trying to create this emualtor from java.

I tried with

android -create avd -n <device_name> -t <apilevel> -c 300M -f

      

but does it create an emulator with screen size? which option and how can we create avd with custom screen size?

+3


source to share


1 answer


Android White Paper: Adjust Device Resolution or Density

Use the create avd command to create a new AVD, specifying the --skin parameter with a value that refers to either the default skin name (for example, WVGA800) or a custom screen resolution (for example, 240x432). Here's an example:



  • android create avd -n <name> -t <targetID> --skin WVGA800

    OR
  • android create avd -n <name> -t <targetID> --skin 540x960

UPDATED
  This tool is no longer supported. Use Android Studio to create the AVD instead

+2


source







All Articles