adbUtils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Auto_Analysis 作者: ztwo 项目源码 文件源码
def get_pid(self, package_name):
        """
        ????pid
        args:
        - packageName -: ????
        usage: getPid("com.android.settings")
        """
        if system is "Windows":
            pidinfo = self.shell(
                "ps | findstr %s$" %
                package_name).stdout.read()
        else:
            pidinfo = self.shell(
                "ps | %s -w %s" %
                (find_util, package_name)).stdout.read()

        if pidinfo == '':
            return "the process doesn't exist."

        pattern = re.compile(r"\d+")
        result = pidinfo.split(" ")
        result.remove(result[0])

        return pattern.findall(" ".join(result))[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号