mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-22 17:00:17 +08:00
refactor: move action options to pkg/uixt/options/action
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user