(self)
return ret
List packages on device
List packages on device
List packages on device
def list_packages(self):
        """ List packages on device
        """
        if not self.is_adb_available():
            return None

        packages = self._do_adb_command('shell pm list packages -f')
        if packages:
            packages = packages.split('\n')
        else:
            packages = []
        ret = []
        for package in packages:
            parts = package.split(':')
            if len(parts) < 2:
                continue
            needed = parts[1].split('.apk=')
            _p = AndroidPackage()
            _p.path = needed[0] + '.apk'
            _p.package = needed[1]
            _p.package = _p.package.join(_p.package.split())
            ret.append(_p)
        return ret
def list_packages ( self ) : if not self . is_adb_available ( ) : return None packages = self . _do_adb_command ( 'shell pm list packages -f' ) if packages : packages = packages . split ( '\n' ) else : packages = [ ] ret = [ ] for package in packages : parts = package . split ( ':' ) if len ( parts ) < 2 : continue needed = parts [ 1 ] . split ( '.apk=' ) _p = AndroidPackage ( ) _p . path = needed [ 0 ] + '.apk' _p . package = needed [ 1 ] _p . package = _p . package . join ( _p . package . split ( ) ) ret . append ( _p ) return ret