how to create android emulator in command line with options?

前端 未结 5 635
青春惊慌失措
青春惊慌失措 2020-12-17 11:17

I want to create emulator in command line with some options, like hw.mainKeys = false. I need it to be an shell script so can run on automation test,however her

5条回答
  •  清歌不尽
    2020-12-17 11:45

    The non-deprecated command has fewer commandline options, but they are:

    $ $ANDROID_HOME/tools/bin/avdmanager --help create 
    
    Usage:
          avdmanager [global options] create [action options]
          Global options:
      -s --silent     : Silent mode, shows errors only.
      -v --verbose    : Verbose mode, shows errors, warnings and all messages.
         --clear-cache: Clear the SDK Manager repository manifest cache.
      -h --help       : Help on a specific command.
    
    Valid actions are composed of a verb and an optional direct object:
    - create avd          : Creates a new Android Virtual Device.
    
    Action "create avd":
      Creates a new Android Virtual Device.
    Options:
      -a --snapshot: Place a snapshots file in the AVD, to enable persistence.
      -c --sdcard  : Path to a shared SD card image, or size of a new sdcard for
                     the new AVD.
      -g --tag     : The sys-img tag to use for the AVD. The default is to
                     auto-select if the platform has only one tag for its system
                     images.
      -p --path    : Directory where the new AVD will be created.
      -k --package : Package path of the system image for this AVD (e.g.
                     'system-images;android-19;google_apis;x86'). [required]
      -n --name    : Name of the new AVD. [required]
      -f --force   : Forces creation (overwrites an existing AVD)
      -b --abi     : The ABI to use for the AVD. The default is to auto-select the
                     ABI if the platform has only one ABI for its system images.
      -d --device  : The optional device definition to use. Can be a device index
                     or id.
    

提交回复
热议问题