5

Currently I've been managing AVDs via the Android Studio UI at Tools > AVD Manager. This works for creating an AVD with a specific hardware profile (that I have in an XML file), but I find that frequently an AVD is breaking somehow. Next to the AVD is a "Repair" option in the UI, and the hardware profile I've added gets removed, causing me to enter it all in again. This is painful and frequent so I'd like to automate it via the command line.

I can create an AVD using a command like avdmanager create avd -n test1 -k "system-images;android-29;google_apis;x86", but it prompts for custom hardware, and if I choose a custom hardware profile it prompts me to enter in each individual property. This is more time-consuming than using the UI.

This source claims "the android tool lets you set hardware emulation options for virtual device", and provides a nice list of properties than can be modified, but no explanation of how these can be set via a command.

Is there some way to set the hardware profile for an AVD from the command line without manually answering prompts?

Luke
  • 18,811
  • 16
  • 99
  • 115
  • Can you not put all your command and other inputs in a batch file and run it instead, rather than putting the command directly on the cmd prompt? – muasif80 Nov 09 '20 at 16:14
  • @muasif80 - a batch file would be an acceptable solution, but it relies on underlying commands or params to create the AVD -- which are currently unknown to me. – Luke Nov 09 '20 at 18:38

1 Answers1

0

Could you please try modifying the AVD configuration file config.ini for the required AVD that needs to be modified. Copy an existing AVD, make necessaryy changes to hardware profile and use it as base

Ref:

https://developer.android.com/studio/run/managing-avds#copyavd

https://stuff.mit.edu/afs/sipb/project/android/docs/tools/devices/managing-avds-cmdline.html#hardwareopts

https://developer.android.com/studio/run/managing-avds#hardware-profile

NIPHIN
  • 1,071
  • 1
  • 8
  • 16