1

When I try to capture screen on UiAutomator during call, it shows this error

Error obtaining UI hierarchy Reason: Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!

It works perfectly fine when not calling, could someone please explain why it cannot be captured during call? and any solution?

jrbedard
  • 3,662
  • 5
  • 30
  • 34
minjun youn
  • 21
  • 1
  • 7
  • this is not related to code at all. what I did is.. 1. Connect device to PC (adb) 2. Open UiAutomator from sdk folder > tools 3. Capture screen on home screen -> Screenshot captured and show all the information 4. Make a call on device 5. During call, try screen capture from on UiAutomator. --- Result : Error occurs with above error message – minjun youn Jan 16 '17 at 23:14
  • 1
    Is there an animation running at the time of capture? – Kevin Coppock Aug 14 '17 at 20:50

2 Answers2

0

I got this error when I was running a test in debug mode in Android Studio and was using a simulator. It was sitting at a break point and I tried capturing a screenshot using the UI Automator View and got this message. Once I stopped the currently running test, taking the screen capture worked without error.

reutsey
  • 1,743
  • 1
  • 17
  • 36
0

UIautomator seems to be already running on the phone. This is the reason why that error comes up. Make sure that all previous instances of uiautomator are killed. You can run this

sudo kill -9 `ps -ef|grep -i uiauto|awk '{print $2}'`

This will make sure all previous instances of uiautomator are killed.

Thejus Krishna
  • 1,755
  • 1
  • 19
  • 28