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

The appium-android-driver cannot unlock the screen on some devices #146

Closed
nghiadhd opened this issue May 19, 2016 · 4 comments
Closed

The appium-android-driver cannot unlock the screen on some devices #146

nghiadhd opened this issue May 19, 2016 · 4 comments

Comments

@nghiadhd
Copy link

nghiadhd commented May 19, 2016

[email protected]
Issue devices:

  1. Galaxy Note 3: Model: SM-N9005, version: 4.4.2
  2. Galaxy S4: Model: GT-I9500, version: 4.4.2
  3. HTC one: Model: HTC6525LVW, version: 5.0.1

Other devices still work well

Note: In the past, the Galaxy S4 still works well, but after upgrade to newer OS version, it doesn't work any more

Issue: "Encountered internal error running command: Error: Screen did not unlock successfully"
Expectation: The screen should be unlocked


After do some investigating, found that the adb command to start the unlock doesn't work
adb with args: ["-P",5037,"-s","xxxxxxxxxx","shell","am","start","-n","io.appium.unlock/.Unlock","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]

I can reproduce the issue by adb command

adb -s shell am start -n 'io.appium.unlock/.Unlock' -S -a 'android.intent.action.MAIN' -c 'android.intent.category.LAUNCHER' -f '0x10200000'

Some addresses

The '-S' option doesn't work (should be remove from command)
If the unlock is on foreground, the command doesn't make effect

My solution, use 'adb shell am force-stop' to kill 'unlock' and 'adb shell am start' to restart 'unlock' app. I tested on issue devices and confirm it works well

adb -s <UDID>  shell am force-stop 'io.appium.unlock
adb -s <UDID>  shell am start -n 'io.appium.unlock/.Unlock' -a 'android.intent.action.MAIN' -c 'android.intent.category.LAUNCHER' -f '0x10200000'
adb -s <UDID>  shell am start -n 'io.appium.unlock/.Unlock' -a 'android.intent.action.MAIN' -c 'android.intent.category.LAUNCHER' -f '0x10200000'

Weird that after force-stop, we should call 'am start' 2 times to invoke the 'unlock' app. That's should be the reason why '-S' option doesn't work

@imurchie
Copy link
Contributor

Interesting! Thank you for the detailed update. I'll take a look at this!

@nghiadhd
Copy link
Author

Thank @imurchie

That's seem a critical issue. The test script always failed if the screen cannot unlocked

@rkavalap
Copy link

rkavalap commented Aug 1, 2016

+1

@rkavalap
Copy link

rkavalap commented Dec 6, 2016

Issue moved to appium/appium #7401 via ZenHub

@rkavalap rkavalap closed this as completed Dec 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants