refactor: move action options to pkg/uixt/options/action

This commit is contained in:
lilong.129
2025-02-06 16:42:16 +08:00
parent f1ef161377
commit 0accec04a9
43 changed files with 982 additions and 911 deletions

View File

@@ -301,20 +301,20 @@ func (dev *AndroidDevice) Uninstall(packageName string) error {
return err
}
func (dev *AndroidDevice) Install(apkPath string, options ...InstallOption) error {
opts := NewInstallOptions(options...)
func (dev *AndroidDevice) Install(apkPath string, opts ...InstallOption) error {
installOpts := NewInstallOptions(opts...)
brand, err := dev.d.Brand()
if err != nil {
return err
}
args := []string{}
if opts.Reinstall {
if installOpts.Reinstall {
args = append(args, "-r")
}
if opts.GrantPermission {
if installOpts.GrantPermission {
args = append(args, "-g")
}
if opts.Downgrade {
if installOpts.Downgrade {
args = append(args, "-d")
}
switch strings.ToLower(brand) {