client.py 文件源码

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

项目:AutomatorX 作者: xiaoyaojjian 项目源码 文件源码
def devices(self):
        '''get a dict of attached devices. key is the device serial, value is device name.'''
        out = self.run_cmd('devices') #subprocess.check_output([self.adb_path(), 'devices']).decode("utf-8")
        match = "List of devices attached"
        index = out.find(match)
        if index < 0:
            raise EnvironmentError("adb is not working.")
        return dict([s.split("\t") for s in out[index + len(match):].strip().splitlines() 
                if s.strip() and not s.strip().startswith('*')])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号