mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-12 16:01:27 +08:00
feat: 新增获取前台应用,oppo输入法切换兼容性适配。新增切换输入法方法
This commit is contained in:
@@ -159,15 +159,8 @@ type AndroidDevice struct {
|
||||
}
|
||||
|
||||
func (dev *AndroidDevice) Init() error {
|
||||
brand, err := dev.d.Brand()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to init android device. brand is null %v", err)
|
||||
}
|
||||
if strings.ToLower(brand) == "oppo" {
|
||||
// 启动一次io.appium.settings。防止oppo设备上切换输入法失败
|
||||
myexec.RunCommand("adb", "-s", dev.SerialNumber, "shell",
|
||||
"monkey", "-p", "io.appium.settings", "-c", "android.intent.category.LAUNCHER", "1")
|
||||
}
|
||||
myexec.RunCommand("adb", "-s", dev.SerialNumber, "shell",
|
||||
"ime", "enable", "io.appium.settings/.UnicodeIME")
|
||||
myexec.RunCommand("adb", "-s", dev.SerialNumber, "shell", "rm", "-r", env.DeviceActionLogFilePath)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user