Merge pull request #176 from rsteube/add-adb

added adb
This commit is contained in:
rsteube 2020-10-17 16:37:03 +02:00 committed by GitHub
commit 055b635fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
61 changed files with 1213 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var bugreportCmd = &cobra.Command{
Use: "bugreport",
Short: "write bugreport go given path",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(bugreportCmd).Standalone()
rootCmd.AddCommand(bugreportCmd)
carapace.Gen(bugreportCmd).PositionalCompletion(
carapace.ActionFiles(""),
)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var connectCmd = &cobra.Command{
Use: "connect",
Short: "connect to a device via TCP/IP",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(connectCmd).Standalone()
rootCmd.AddCommand(connectCmd)
}

View File

@ -0,0 +1,20 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var devicesCmd = &cobra.Command{
Use: "devices",
Short: "list connected devices",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(devicesCmd).Standalone()
devicesCmd.Flags().BoolS("l", "l", false, "long output")
rootCmd.AddCommand(devicesCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var disableVerityCmd = &cobra.Command{
Use: "disable-verity",
Short: "disable dm-verity checking on userdebug builds",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(disableVerityCmd).Standalone()
rootCmd.AddCommand(disableVerityCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var disconnectCmd = &cobra.Command{
Use: "disconnect",
Short: "disconnect from given TCP/IP device or all",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(disconnectCmd).Standalone()
rootCmd.AddCommand(disconnectCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var emuCmd = &cobra.Command{
Use: "emu",
Short: "run emulator console command",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(emuCmd).Standalone()
rootCmd.AddCommand(emuCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var enableVerityCmd = &cobra.Command{
Use: "enable-verity",
Short: "re-enable dm-verity checking on userdebug builds",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(enableVerityCmd).Standalone()
rootCmd.AddCommand(enableVerityCmd)
}

View File

@ -0,0 +1,24 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var forwardCmd = &cobra.Command{
Use: "forward",
Short: "forward socket connection",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(forwardCmd).Standalone()
forwardCmd.Flags().Bool("list", false, "list all forward socket connections")
forwardCmd.Flags().Bool("no-rebind", false, "don't replace existing connection")
forwardCmd.Flags().Bool("remove", false, "remove specific forward socket connections")
forwardCmd.Flags().Bool("remove-all", false, "remove all forward socket connections")
rootCmd.AddCommand(forwardCmd)
// TODO LOCAL/REMOTE positional completion
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var getDevpathCmd = &cobra.Command{
Use: "get-devpath",
Short: "print <device-path>",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(getDevpathCmd).Standalone()
rootCmd.AddCommand(getDevpathCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var getSerialnoCmd = &cobra.Command{
Use: "get-serialno",
Short: "print <serial-number>",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(getSerialnoCmd).Standalone()
rootCmd.AddCommand(getSerialnoCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var getStateCmd = &cobra.Command{
Use: "get-state",
Short: "print offline | bootloader | device",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(getStateCmd).Standalone()
rootCmd.AddCommand(getStateCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var helpCmd = &cobra.Command{
Use: "help",
Short: "show help message",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(helpCmd).Standalone()
rootCmd.AddCommand(helpCmd)
}

View File

@ -0,0 +1,29 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var installCmd = &cobra.Command{
Use: "install",
Short: "push a single package to the device and install it",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(installCmd).Standalone()
installCmd.Flags().BoolS("l", "l", false, "TODO no flag description")
installCmd.Flags().BoolS("s", "s", false, "TODO no flag description")
installCmd.Flags().BoolS("d", "d", false, "TODO no flag description")
installCmd.Flags().BoolS("r", "r", false, "replace existing application")
installCmd.Flags().BoolS("t", "t", false, "allow test packages")
installCmd.Flags().BoolS("g", "g", false, "grant all runtime permissions")
installCmd.Flags().Bool("instant", false, "cause the app to be installed as an ephemeral install app")
rootCmd.AddCommand(installCmd)
carapace.Gen(installCmd).PositionalCompletion(
carapace.ActionFiles(".apk"),
)
}

View File

@ -0,0 +1,41 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var installMultiPackageCmd = &cobra.Command{
Use: "install-multi-package",
Short: "push one or more packages to the device and install them atomically",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(installMultiPackageCmd).Standalone()
installMultiPackageCmd.Flags().BoolS("t", "t", false, "allow test packages")
installMultiPackageCmd.Flags().BoolS("d", "d", false, "allow version code downgrade (debuggable packages only)")
installMultiPackageCmd.Flags().BoolS("p", "p", false, "partial application install (install-multiple only)")
installMultiPackageCmd.Flags().BoolS("g", "g", false, "grant all runtime permissions")
installMultiPackageCmd.Flags().BoolS("r", "r", false, "replace existing application")
installMultiPackageCmd.Flags().String("abi", "", "override platform's default ABI")
installMultiPackageCmd.Flags().Bool("date-check-agent", false, "update deployment agent when local version is newer and using fast deploy")
installMultiPackageCmd.Flags().Bool("fastdeploy", false, "use fast deploy")
installMultiPackageCmd.Flags().Bool("force-agent", false, "force update of deployment agent when using fast deploy")
installMultiPackageCmd.Flags().Bool("instant", false, "cause the app to be installed as an ephemeral install app")
installMultiPackageCmd.Flags().Bool("local-agent", false, "locate agent files from local source build (instead of SDK location)")
installMultiPackageCmd.Flags().Bool("no-fastdeploy", false, "prevent use of fast deploy")
installMultiPackageCmd.Flags().Bool("no-streaming", false, "always push APK to device and invoke Package Manager as separate steps")
installMultiPackageCmd.Flags().Bool("streaming", false, "force streaming APK directly into Package Manager")
installMultiPackageCmd.Flags().Bool("version-check-agent", false, "update deployment agent when local version has different version code and using fast deploy")
rootCmd.AddCommand(installMultiPackageCmd)
carapace.Gen(installMultiPackageCmd).FlagCompletion(carapace.ActionMap{
"abi": carapace.ActionValues("armeabi-v7a", "arm64-v8a", "x86", "x86_64"),
})
carapace.Gen(installMultiPackageCmd).PositionalAnyCompletion(
carapace.ActionFiles(".apk"),
)
}

View File

@ -0,0 +1,29 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var installMultipleCmd = &cobra.Command{
Use: "install-multiple",
Short: "push multiple APKs to the device for a single package and install them",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(installMultipleCmd).Standalone()
installMultipleCmd.Flags().BoolS("l", "l", false, "TODO no flag description")
installMultipleCmd.Flags().BoolS("s", "s", false, "TODO no flag description")
installMultipleCmd.Flags().BoolS("d", "d", false, "TODO no flag description")
installMultipleCmd.Flags().BoolS("r", "r", false, "replace existing application")
installMultipleCmd.Flags().BoolS("t", "t", false, "allow test packages")
installMultipleCmd.Flags().BoolS("g", "g", false, "grant all runtime permissions")
installMultipleCmd.Flags().Bool("instant", false, "cause the app to be installed as an ephemeral install app")
rootCmd.AddCommand(installMultipleCmd)
carapace.Gen(installMultipleCmd).PositionalAnyCompletion(
carapace.ActionFiles(".apk"),
)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var jdwpCmd = &cobra.Command{
Use: "jdwp",
Short: "list pids of processes hosting a JDWP transport",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(jdwpCmd).Standalone()
rootCmd.AddCommand(jdwpCmd)
}

View File

@ -0,0 +1,22 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var keygenCmd = &cobra.Command{
Use: "keygen",
Short: "generate adb public/private key",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(keygenCmd).Standalone()
rootCmd.AddCommand(keygenCmd)
carapace.Gen(keygenCmd).PositionalCompletion(
carapace.ActionFiles(""),
)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var killServerCmd = &cobra.Command{
Use: "kill-server",
Short: "kill the server if it is running",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(killServerCmd).Standalone()
rootCmd.AddCommand(killServerCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var logcatCmd = &cobra.Command{
Use: "logcat",
Short: "show device log",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(logcatCmd).Standalone()
rootCmd.AddCommand(logcatCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var mdnsCmd = &cobra.Command{
Use: "mdns",
Short: "manage mdns",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(mdnsCmd).Standalone()
rootCmd.AddCommand(mdnsCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var mdns_checkCmd = &cobra.Command{
Use: "check",
Short: "check if mdns discovery is available",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(mdns_checkCmd).Standalone()
mdnsCmd.AddCommand(mdns_checkCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var mdns_servicesCmd = &cobra.Command{
Use: "services",
Short: "list all discovered services",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(mdns_servicesCmd).Standalone()
mdnsCmd.AddCommand(mdns_servicesCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var pairCmd = &cobra.Command{
Use: "pair",
Short: "pair with a device for secure TCP/IP communication",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(pairCmd).Standalone()
rootCmd.AddCommand(pairCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var pppCmd = &cobra.Command{
Use: "ppp",
Short: "run PPP over USB",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(pppCmd).Standalone()
rootCmd.AddCommand(pppCmd)
}

View File

@ -0,0 +1,25 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var pullCmd = &cobra.Command{
Use: "pull",
Short: "copy files/dirs from device",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(pullCmd).Standalone()
pullCmd.Flags().BoolS("a", "a", false, "preserve file timestamp and mode")
pullCmd.Flags().StringS("z", "z", "", "enable compression with a specified algorithm (any, none, brotli)")
pullCmd.Flags().BoolS("Z", "Z", false, "disable compression")
rootCmd.AddCommand(pullCmd)
carapace.Gen(pullCmd).FlagCompletion(carapace.ActionMap{
"z": carapace.ActionValues("any", "none", "brotli"),
})
}

View File

@ -0,0 +1,28 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var pushCmd = &cobra.Command{
Use: "push",
Short: "copy local files/directories to device",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(pushCmd).Standalone()
pushCmd.Flags().BoolS("n", "n", false, "dry run: push files to device without storing to the filesystem")
pushCmd.Flags().StringS("z", "z", "", "enable compression with a specified algorithm (any, none, brotli)")
pushCmd.Flags().BoolS("Z", "Z", false, "disable compression")
pushCmd.Flags().Bool("sync", false, "only push files that are newer on the host than the device")
rootCmd.AddCommand(pushCmd)
carapace.Gen(pushCmd).FlagCompletion(carapace.ActionMap{
"z": carapace.ActionValues("any", "none", "brotli"),
})
carapace.Gen(pushCmd).PositionalAnyCompletion(carapace.ActionFiles(""))
}

View File

@ -0,0 +1,22 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var rebootCmd = &cobra.Command{
Use: "reboot",
Short: "reboot the device",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(rebootCmd).Standalone()
rootCmd.AddCommand(rebootCmd)
carapace.Gen(rebootCmd).PositionalCompletion(
carapace.ActionValues("bootloader", "recovery", "sideload", "sideload-auto-reboot"),
)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var reconnectCmd = &cobra.Command{
Use: "reconnect",
Short: "kick connection from host side to force reconnect",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(reconnectCmd).Standalone()
rootCmd.AddCommand(reconnectCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var reconnect_deviceCmd = &cobra.Command{
Use: "device",
Short: "kick connection from device side to force reconnect",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(reconnect_deviceCmd).Standalone()
reconnectCmd.AddCommand(reconnect_deviceCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var reconnect_offlineCmd = &cobra.Command{
Use: "offline",
Short: "reset offline/unauthorized devices to force reconnect",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(reconnect_offlineCmd).Standalone()
reconnectCmd.AddCommand(reconnect_offlineCmd)
}

View File

@ -0,0 +1,20 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var remountCmd = &cobra.Command{
Use: "remount",
Short: "remount partitions read-write",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(remountCmd).Standalone()
remountCmd.Flags().BoolS("R", "R", false, "automatically reboot the device if needed")
rootCmd.AddCommand(remountCmd)
}

View File

@ -0,0 +1,23 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var reverseCmd = &cobra.Command{
Use: "reverse",
Short: "reverse socket connection",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(reverseCmd).Standalone()
reverseCmd.Flags().Bool("list", false, "list all reverse socket connections from device")
reverseCmd.Flags().Bool("no-rebind", false, "don't replace existing connection")
reverseCmd.Flags().Bool("remove", false, "remove specific reverse socket connection")
reverseCmd.Flags().Bool("remove-all", false, "remove all reverse socket connection")
rootCmd.AddCommand(reverseCmd)
}

View File

@ -0,0 +1,28 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "adb",
Short: "",
Run: func(cmd *cobra.Command, args []string) {},
}
func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()
rootCmd.Flags().BoolS("a", "a", false, "listen on all network interfaces, not just localhost")
rootCmd.Flags().BoolS("d", "d", false, "use USB device (error if multiple devices connected)")
rootCmd.Flags().BoolS("e", "e", false, "use TCP/IP device (error if multiple TCP/IP devices available)")
rootCmd.Flags().StringS("s", "s", "", "use device with given serial (overrides $ANDROID_SERIAL)")
rootCmd.Flags().StringS("t", "t", "", "use device with given transport id")
rootCmd.Flags().BoolS("H", "H", false, "name of adb server host [default=localhost]")
rootCmd.Flags().BoolS("P", "P", false, "port of adb server [default=5037]")
rootCmd.Flags().StringS("L", "L", "", "listen on given socket for adb server [default=tcp:localhost:5037]")
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var root_rootCmd = &cobra.Command{
Use: "root",
Short: "restart adbd with root permissions",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(root_rootCmd).Standalone()
rootCmd.AddCommand(root_rootCmd)
}

View File

@ -0,0 +1,23 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var shellCmd = &cobra.Command{
Use: "shell",
Short: "run remote shell command",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(shellCmd).Standalone()
shellCmd.Flags().StringS("e", "e", "", "choose escape character, or \"none\"; default '~'")
shellCmd.Flags().BoolS("n", "n", false, "don't read from stdin")
shellCmd.Flags().BoolS("T", "T", false, "disable pty allocation")
shellCmd.Flags().BoolS("t", "t", false, "allocate a pty if on a tty (-tt: force pty allocation)")
shellCmd.Flags().BoolS("x", "x", false, "disable remote exit codes and stdout/stderr separation")
rootCmd.AddCommand(shellCmd)
}

View File

@ -0,0 +1,22 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var sideloadCmd = &cobra.Command{
Use: "sideload",
Short: "sideload the given full OTA package",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(sideloadCmd).Standalone()
rootCmd.AddCommand(sideloadCmd)
carapace.Gen(sideloadCmd).PositionalCompletion(
carapace.ActionFiles(".zip"),
)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var startServerCmd = &cobra.Command{
Use: "start-server",
Short: "ensure that there is a server running",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(startServerCmd).Standalone()
rootCmd.AddCommand(startServerCmd)
}

View File

@ -0,0 +1,30 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var syncCmd = &cobra.Command{
Use: "sync",
Short: "sync a local build from $ANDROID_PRODUCT_OUT to the device",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(syncCmd).Standalone()
syncCmd.Flags().BoolS("n", "n", false, "dry run: push files to device without storing to the filesystem")
syncCmd.Flags().BoolS("l", "l", false, "list files that would be copied, but don't copy them")
syncCmd.Flags().StringS("z", "z", "", "enable compression with a specified algorithm (any, none, brotli)")
syncCmd.Flags().BoolS("Z", "Z", false, "disable compression")
rootCmd.AddCommand(syncCmd)
carapace.Gen(syncCmd).FlagCompletion(carapace.ActionMap{
"z": carapace.ActionValues("any", "none", "brotli"),
})
carapace.Gen(syncCmd).PositionalCompletion(
carapace.ActionValues("all", "data", "odm", "oem", "product", "system", "system_ext", "vendor"),
)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var tcipCmd = &cobra.Command{
Use: "tcip",
Short: "restart adbd listening on TCP on PORT",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(tcipCmd).Standalone()
rootCmd.AddCommand(tcipCmd)
}

View File

@ -0,0 +1,24 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var uninstallCmd = &cobra.Command{
Use: "uninstall",
Short: "remove this app package from the device",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(uninstallCmd).Standalone()
uninstallCmd.Flags().BoolS("k", "k", false, "keep the data and cache directories")
rootCmd.AddCommand(uninstallCmd)
carapace.Gen(uninstallCmd).PositionalCompletion(
carapace.ActionFiles(".apk"),
)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var unrootCmd = &cobra.Command{
Use: "unroot",
Short: "restart adbd without root permissions",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(unrootCmd).Standalone()
rootCmd.AddCommand(unrootCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var usbCmd = &cobra.Command{
Use: "usb",
Short: "restart adbd listening on USB",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(usbCmd).Standalone()
rootCmd.AddCommand(usbCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "show version number",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(versionCmd).Standalone()
rootCmd.AddCommand(versionCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForBootloaderCmd = &cobra.Command{
Use: "wait-for-bootloader",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForBootloaderCmd).Standalone()
rootCmd.AddCommand(waitForBootloaderCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForDeviceCmd = &cobra.Command{
Use: "wait-for-device",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForDeviceCmd).Standalone()
rootCmd.AddCommand(waitForDeviceCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForDisconnectCmd = &cobra.Command{
Use: "wait-for-disconnect",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForDisconnectCmd).Standalone()
rootCmd.AddCommand(waitForDisconnectCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForLocalBootloaderCmd = &cobra.Command{
Use: "wait-for-local-bootloader",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForLocalBootloaderCmd).Standalone()
rootCmd.AddCommand(waitForLocalBootloaderCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForLocalDeviceCmd = &cobra.Command{
Use: "wait-for-local-device",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForLocalDeviceCmd).Standalone()
rootCmd.AddCommand(waitForLocalDeviceCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForLocalDisconnectCmd = &cobra.Command{
Use: "wait-for-local-disconnect",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForLocalDisconnectCmd).Standalone()
rootCmd.AddCommand(waitForLocalDisconnectCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForLocalRecoveryCmd = &cobra.Command{
Use: "wait-for-local-recovery",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForLocalRecoveryCmd).Standalone()
rootCmd.AddCommand(waitForLocalRecoveryCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForLocalRescueCmd = &cobra.Command{
Use: "wait-for-local-rescue",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForLocalRescueCmd).Standalone()
rootCmd.AddCommand(waitForLocalRescueCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForLocalSideloadCmd = &cobra.Command{
Use: "wait-for-local-sideload",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForLocalSideloadCmd).Standalone()
rootCmd.AddCommand(waitForLocalSideloadCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForRecoveryCmd = &cobra.Command{
Use: "wait-for-recovery",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForRecoveryCmd).Standalone()
rootCmd.AddCommand(waitForRecoveryCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForRescueCmd = &cobra.Command{
Use: "wait-for-rescue",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForRescueCmd).Standalone()
rootCmd.AddCommand(waitForRescueCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForSideloadCmd = &cobra.Command{
Use: "wait-for-sideload",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForSideloadCmd).Standalone()
rootCmd.AddCommand(waitForSideloadCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForUsbBootloaderCmd = &cobra.Command{
Use: "wait-for-usb-bootloader",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForUsbBootloaderCmd).Standalone()
rootCmd.AddCommand(waitForUsbBootloaderCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForUsbDisconnectCmd = &cobra.Command{
Use: "wait-for-usb-disconnect",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForUsbDisconnectCmd).Standalone()
rootCmd.AddCommand(waitForUsbDisconnectCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForUsbRecoveryCmd = &cobra.Command{
Use: "wait-for-usb-recovery",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForUsbRecoveryCmd).Standalone()
rootCmd.AddCommand(waitForUsbRecoveryCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForUsbRescueCmd = &cobra.Command{
Use: "wait-for-usb-rescue",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForUsbRescueCmd).Standalone()
rootCmd.AddCommand(waitForUsbRescueCmd)
}

View File

@ -0,0 +1,18 @@
package cmd
import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)
var waitForUsbSideloadCmd = &cobra.Command{
Use: "wait-for-usb-sideload",
Short: "wait for device to be in given state",
Run: func(cmd *cobra.Command, args []string) {},
}
func init() {
carapace.Gen(waitForUsbSideloadCmd).Standalone()
rootCmd.AddCommand(waitForUsbSideloadCmd)
}

View File

@ -0,0 +1,7 @@
package main
import "github.com/rsteube/carapace-bin/completers/adb_completer/cmd"
func main() {
cmd.Execute()
}