mirror of
https://github.com/taigrr/adb.git
synced 2026-04-02 02:58:42 -07:00
Add stub for shell
This commit is contained in:
@@ -77,11 +77,11 @@ func main() {
|
|||||||
log.Fatalf("unable to connect to device %s: %v", opts.Address, err)
|
log.Fatalf("unable to connect to device %s: %v", opts.Address, err)
|
||||||
}
|
}
|
||||||
defer dev.Disconnect()
|
defer dev.Disconnect()
|
||||||
stdout, stderr, err := dev.Shell("ls")
|
stdout, stderr, errCode, err := dev.Shell("ls")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("unable to shell into device %s: %v", opts.Address, err)
|
log.Fatalf("unable to shell into device %s: %v", opts.Address, err)
|
||||||
}
|
}
|
||||||
log.Printf("Stdout: %s\nStderr: %s\n", stdout, stderr)
|
log.Printf("Stdout: %s\nStderr: %s\n, ErrCode: %d", stdout, stderr, errCode)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
15
shell.go
Normal file
15
shell.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package adb
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Shell allows you to run an arbitrary shell command against a device.
|
||||||
|
//
|
||||||
|
// This function is useful if you need to run an obscure shell command or if
|
||||||
|
// you require functionality not provided by the exposed functions here.
|
||||||
|
// Instead of using Shell, please consider submitting a PR with the functionality
|
||||||
|
// you require.
|
||||||
|
func (d Device) Shell(ctx context.Context, command string) (stdout string, stderr string, ErrCode int, err error) {
|
||||||
|
return "", "", 1, nil
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user