_adb 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #compdef adb
  2. #autoload
  3. # in order to make this work, you will need to have the android adb tools
  4. # adb zsh completion, based on homebrew completion
  5. local -a _1st_arguments
  6. _1st_arguments=(
  7. 'bugreport:return all information from the device that should be included in a bug report.'
  8. 'connect:connect to a device via TCP/IP Port 5555 is default.'
  9. 'devices:list all connected devices'
  10. 'disconnect:disconnect from a TCP/IP device. Port 5555 is default.'
  11. 'emu:run emulator console command'
  12. 'forward:forward socket connections'
  13. 'help:show the help message'
  14. 'install:push this package file to the device and install it'
  15. 'jdwp:list PIDs of processes hosting a JDWP transport'
  16. 'kill-server:kill the server if it is running'
  17. 'logcat:view device log'
  18. 'pull:copy file/dir from device'
  19. 'push:copy file/dir to device'
  20. 'reboot:reboots the device, optionally into the bootloader or recovery program'
  21. 'reboot-bootloader:reboots the device into the bootloader'
  22. 'remount:remounts the partitions on the device read-write'
  23. 'root:restarts the adbd daemon with root permissions'
  24. 'sideload:push a ZIP to device and install it'
  25. 'shell:run remote shell interactively'
  26. 'sync:copy host->device only if changed (-l means list but dont copy)'
  27. 'start-server:ensure that there is a server running'
  28. 'tcpip:restart host adb in tcpip mode'
  29. 'uninstall:remove this app package from the device'
  30. 'version:show version num'
  31. 'wait-for-device:block until device is online'
  32. )
  33. local expl
  34. local -a pkgs installed_pkgs
  35. _arguments \
  36. '*:: :->subcmds' && return 0
  37. if (( CURRENT == 1 )); then
  38. _describe -t commands "adb subcommand" _1st_arguments
  39. return
  40. fi
  41. _files