Closed min-qiu closed 6 years ago
May be this is what you want. the method is not exposed in AutomatorServiceImpl
String getCurrentActivityName() This method is deprecated. The results returned should be considered unreliable
if you just want to write black-box testing. why not to inspect the UI element which contained in your activity?
there is a solution to know the name of the current activity on the screen
d.server.adb.cmd("shell dumpsys activity | grep mFocusedActivity").communicate() (' mFocusedActivity: ActivityRecord{12b1619 u0 com.tencent.mm/.ui.LauncherUI t1743}\r\n', '') d.server.adb.cmd("shell dumpsys activity | grep mFocusedActivity").communicate() (' mFocusedActivity: ActivityRecord{9ab2406 u0 com.tencent.mm/.plugin.brandservice.ui.BrandServiceIndexUI t1743}\r\n', '')
@hongbinbao @min-qiu 尝试使用 macaca
https://github.com/macacajs/macaca-android/commit/1a9e77d6e44005827eef4f8ed14ee125e47fd28a
I want to get the activity name ,how should I do?