mirror of
https://github.com/taigrr/adb.git
synced 2026-04-02 02:58:42 -07:00
Adds placeholders for home, back, and other input events
This commit is contained in:
30
shell.go
30
shell.go
@@ -2,6 +2,7 @@ package adb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Shell allows you to run an arbitrary shell command against a device.
|
||||
@@ -13,3 +14,32 @@ import (
|
||||
func (d Device) Shell(ctx context.Context, command string) (stdout string, stderr string, ErrCode int, err error) {
|
||||
return "", "", 1, nil
|
||||
}
|
||||
|
||||
func (d Device) Tap(ctx context.Context, X, Y int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d Device) Swipe(ctx context.Context, X1, Y1, X2, Y2 int, duration time.Duration) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Equivalent to pressing the home button
|
||||
//
|
||||
// Calls `input keyevent KEYCODE_HOME` under the hood
|
||||
func (d Device) GoHome(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//Equivalent to pressing the back button
|
||||
//
|
||||
// Calls `input keyevent KEYCODE_BACK` under the hood
|
||||
func (d Device) GoBack(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Equivalent to pushing the app switcher. You probably want to call this twice.
|
||||
//
|
||||
// Calls `input keyevent KEYCODE_APP_SWITCH` under the hood
|
||||
func (d Device) SwitchApp(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user