Closed first932167 closed 2 years ago
def getTopActivityNameAndPid(self): dat = self.shell('dumpsys activity top') lines = dat.splitlines() print('adbClient',1331,lines[1],lines[2],lines[3]) activityRE = re.compile('\s*ACTIVITY ([A-Za-z0-9_.]+)/([A-Za-z0-9_.\$]+) \w+ pid=(\d+)') #print('adbClient',1331,activityRE) m = activityRE.search(lines[1]) if m: return m.group(1), m.group(2), m.group(3) else: m = activityRE.search(lines[2]) if m: return m.group(1), m.group(2), m.group(3) else: warnings.warn("NO MATCH:" + lines[1]) return None
Not sure what you mean. Are you seeing something in the print line you added? Can you provide the output?