def _ps(self, search='<STR_LIT>'):
if not self.available:<EOL><INDENT>return<EOL><DEDENT>result = []<EOL>ps = self.adb_streaming_shell('<STR_LIT>')<EOL>try:<EOL><INDENT>for bad_line in ps:<EOL><INDENT>for line in bad_line.splitlines():<EOL><INDENT>if search in line:<EOL><INDENT>result.append(line.strip().rsplit('<STR_LIT:U+0020>', <NUM_LIT:1>)[-<NUM_LIT:1>])<EOL><DEDENT><DEDENT><DEDENT>return result<EOL><DEDENT>except InvalidChecksumError as e:<EOL><INDENT>print(e)<EOL>self.connect()<EOL>raise IOError<EOL><DEDENT>
Perform a ps command with optional filtering.

        :param search: Check for this substring.
        :returns: List of matching fields