Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[appium-android-driver] light up device before unlock with password on some device(xiaomi or meizu) is not working for using keyevent 4; I tried using command line, using keyevent 3 works fine on xiaomi & meizu, can we add adb.goToHome() to handle this situation? #10649

Open
jiacy opened this issue May 6, 2018 · 0 comments
Labels
Android related to Android-native driver(s) Enhancement feature

Comments

@jiacy
Copy link

jiacy commented May 6, 2018

The problem

appium-android-driver has added unlocking device with password/pin/pattern etc.
adding unlockType and unlockKey in caps, on nexus and pixel it works fine, but on MeiZu & XiaoMi, it didn't light up the device at all

Environment

  • Appium version: 1.7.2
  • Desktop OS/version used to run Appium: Mac OS 10.12.6
  • Node.js version (unless using Appium.app|exe): 8.6.0
  • Mobile platform/version under test: MIUI 9 7.11.2 (Android 6.0.1) & M3S(Android 5.1)
  • Real device or emulator/simulator: Real device
  • Appium CLI or Appium.app|exe: Appium CLI

Details

I checkout the code in appium-android-driver/lib/unlock-helpers.js, method : helpers.passwordUnlock
while lighting up the device logic is in method: helpers.dismissKeyguard

in method: helpers.dismissKeyguard, use adb.back() to light up device(which is adb shell input keyevent 4), while it doesn't work on my Xiaomi and Meizu.

I thought we could change and use keyevent 26(26 --> "KEYCODE_POWER") to light up device, but find it not workable: if device is lighted, using 26 would dark screen

and I found using keyevent 3 would light up my xiaomi & Meizu, so I add adb.goToHome() and it works on Xiaomi & Meizu. can we do it this way? or it there a better way?
sincerely for your help, thanks so much!

@jiacy jiacy changed the title [appium-android-driver] light up device before unlock with password on some device(xiaomi or meizu) is not working for using keyevent 4; I think maybe we could change it to keyevent 26? [appium-android-driver] light up device before unlock with password on some device(xiaomi or meizu) is not working for using keyevent 4; I tried using command line, using keyevent 3 works fine on xiaomi & meizu, can we add adb.goToHome() to handle this situation May 6, 2018
@mykola-mokhnach mykola-mokhnach added Enhancement feature Android related to Android-native driver(s) labels May 6, 2018
@jiacy jiacy changed the title [appium-android-driver] light up device before unlock with password on some device(xiaomi or meizu) is not working for using keyevent 4; I tried using command line, using keyevent 3 works fine on xiaomi & meizu, can we add adb.goToHome() to handle this situation [appium-android-driver] light up device before unlock with password on some device(xiaomi or meizu) is not working for using keyevent 4; I tried using command line, using keyevent 3 works fine on xiaomi & meizu, can we add adb.goToHome() to handle this situation? May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android related to Android-native driver(s) Enhancement feature
Projects
None yet
Development

No branches or pull requests

2 participants