aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/_emulator371
1 files changed, 263 insertions, 108 deletions
diff --git a/src/_emulator b/src/_emulator
index 18ad13b..591ab09 100644
--- a/src/_emulator
+++ b/src/_emulator
@@ -3,7 +3,7 @@
# Description
# -----------
#
-# Completion script for emulator (Android Emulator) 12.0
+# Completion script for emulator (Android Emulator) 35.3.11.0
# (https://developer.android.com/studio/run/emulator-command).
#
# ------------------------------------------------------------------------------
@@ -14,119 +14,274 @@
#
# ------------------------------------------------------------------------------
+_emulator() {
+ typeset -A opt_args
+ local context state line curcontext="$curcontext"
+ local ret=1
-typeset -A opt_args
-local context state line curcontext="$curcontext"
+ local -a option_names=(
+ list-avds sysdir system vendor writable-system delay-adb datadir
+ kernel ramdisk image initdata data encryption-key logcat-output
+ partition-size cache cache-size no-cache nocache sdcard
+ quit-after-boot qemu-top-dir monitor-adb snapstorage
+ no-snapstorage snapshot no-snapshot no-snapshot-save
+ no-snapshot-load force-snapshot-load qcow2-for-userdata
+ snapshot-list no-snapshot-update-time wipe-data avd avd-arch
+ skindir skin no-skin noskin memory ui-only id cores accel no-accel
+ ranchu engine netspeed netdelay netfast code-profile show-kernel
+ shell no-jni nojni dalvik-vm-checkjni logcat log-nofilter
+ log-detailed no-audio noaudio audio radio port ports
+ modem-simulator-port onion onion-alpha onion-rotation dpi-device
+ scale wifi-client-port wifi-server-port http-proxy timezone
+ change-language change-country change-locale dns-server net-tap
+ net-socket net-tap-script-up net-tap-script-down cpu-delay
+ no-boot-anim no-window qt-hide-window no-sim lowram version
+ no-passive-gps gnss-file-path gnss-grpc-port virtio-console
+ read-only is-restart report-console gps shell-serial tcpdump
+ bootchart charmap studio-params prop shared-net-id nand-limits gpu
+ use-host-vulkan vsync-rate camera-back camera-front webcam-list
+ virtualscene-poster screen selinux unix-pipe fixed-scale
+ wait-for-debugger skip-adb-auth metrics-to-console
+ metrics-collection metrics-to-file no-metrics detect-image-hang
+ feature icc-profile sim-access-rules-file phone-number acpi-config
+ fuchsia window-size allow-host-audio restart-when-stalled
+ perf-stat share-vid grpc grpc-tls-key grpc-tls-cer grpc-tls-ca
+ grpc-use-token grpc-use-jwt grpc-allowlist idle-grpc-timeout
+ waterfall grpc-ui packet-streamer-endpoint netsim-args
+ multidisplay google-maps-key no-location-ui use-keycode-forwarding
+ record-session legacy-fake-camera camera-hq-edge no-direct-adb
+ check-snapshot-loadable no-hidpi-scaling no-mouse-reposition
+ guest-angle usb-passthrough append-userspace-opt save-path
+ no-nested-warnings wifi-tap wifi-tap-script-up
+ wifi-tap-script-down wifi-socket vmnet-bridged vmnet-shared
+ vmnet-start-address ting mnet_end_address vmnet-end-address
+ vmnet-subnet-mask vmnet-isolated wifi-user-mode-options
+ network-user-mode-options adb-path hotplug-multi-display xts
+ wifi-mac-address no-ethernet android-serialno
+ )
-_list_avds() {
+ local -a help_flags=()
+ for name in $option_names[@]
+ do
+ help_flags+=("(- *)-help-${name}[print -${name} help message]")
+ done
+
+ # TODO All image options are contextual to -sysdir value
+ # TODO All skin options are contextual to -skindir value
+ # TODO snapshot options are mutually exclusive
+ # TODO Use '-snapshot-list' output for snapshot names
+ # TODO -logcat: use completer from _adb
+ # TODO Complete options with device values
+ # TODO Complete -prop
+ _arguments -C \
+ '-list-avds[list available AVDs]' \
+ '-sysdir[search for system disk images in the directory]: :_files -/' \
+ '-vendor[read initial vendor image]: :_files' \
+ "-writable-system[make system image writable after 'adb remount']" \
+ '-delay-adb[delay adb communication till boot completes]' \
+ '-datadir[write user data into the directory]: :_files -/' \
+ '-kernel[use specific emulated kernel]: :_files' \
+ '(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \
+ '-ramdisk[ramdisk image (default <system>/ramdisk.img]: :_files -g "*.img"' \
+ "-initdata[same as '-init-data <file>']: :_files" \
+ '-data[data image (default <datadir>/userdata-qemu.img]: :_files -g "*.img"' \
+ '-encryption-key[read initial encryption key image]: :_files' \
+ '-logcat-output[output file of logcat]: :_files' \
+ '-partition-size[system/data partition size]:size (in MBs)' \
+ '(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \
+ '(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \
+ '-sdcard[SD card image (default <system>/sdcard.img]: :_files -g "*.img"' \
+ '-quit-after-boot[quit emulator after guest boots completely]' \
+ '-qemu-top-dir[use the emulator in the specified dir]: :_files -/' \
+ '-monitor-adb[monitor the adb messages between guest and host]:verbose_level' \
+ '(-no-snapstorage)-snapstorage[file that contains all state snapshots]: :_files -g "*.img"' \
+ '(-snapstorage)-no-snapstorage[do not mount a snapshot storage file]' \
+ "-snapshot[name of snapshot within storage file for auto-start and auto-save]:snapshot name" \
+ '-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \
+ '-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \
+ '-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \
+ '-force-snapshot-load[force starting from snapshot]' \
+ '-qcow2-for-userdata[use qcow2 for userdata]' \