adb shell dumpsys window windows output describing
问题 I'm using appuim for interaction between my Android device and java code. And I faced with problem that on some kind of devices(including emulators) after pressing on Home button, appium return incorrect current activity (it returns previuos activity which is currently must be minimized). I found that appium used dumpsys window windows with grabbing mFocusedApp value for getting current app. I read another answers about getting Android current activities, and mostly it recommend to use: adb