dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.63k stars 347 forks source link

takeSnapshot hangs on Nexus 7.1+ when app actively blocks snapshots #225

Closed meirtsvi closed 7 years ago

meirtsvi commented 7 years ago

In order to repro the crash use the following:

  1. Install SAP fiori client ver. 1.6.3 - http://www.apkmonk.com/app/com.sap.fiori.client/ on nexus with android 7.1 (or newer) device.
  2. Open the app 3 Run the script from: https://github.com/dtmilano/AndroidViewClient/files/368494/run.txt

Expected result: a png file should be created Actual result: takeSnapshot never returns

I'm using the latest viewclient package

dtmilano commented 7 years ago

Can you reproduce the issue on emulator or on a different device?

meirtsvi commented 7 years ago

Yes, it also happens on Android Emulator with Nexus 5X API 25 (Android 7.1.1) image.

dtmilano commented 7 years ago

screen shot 2017-06-15 at 01 21 52

The same happens if you try to get the screenshot with Android Studio as the app is not allowing it.

meirtsvi commented 7 years ago

My problem is that viewclient is STUCK on reading from socket. I have no problem putting try/except around takeSnapshot but in this case it is just getting stuck rather than throwing exception.

dtmilano commented 7 years ago

Understood. Will look for a solution.

meirtsvi commented 7 years ago

Thank you

meirtsvi commented 7 years ago

Works like a charm. Thank you!