adbOptions.py 文件源码

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

项目:Zeuz_Python_Node 作者: AutomationSolutionz 项目源码 文件源码
def is_android_connected(serial=''):
    ''' Return True/False if at least one device is connected '''

    sModuleInfo = inspect.stack()[0][3] + " : " + inspect.getmoduleinfo(__file__).name

    devices = get_devices()

    if devices != []:
        if serial == '': return True  # No device specified, and we have at least one
        for device in devices:
            if serial.lower() == device.lower().split(' ')[0]:
                CommonUtil.ExecLog(sModuleInfo, "Android connected", 0)
                return True
        CommonUtil.ExecLog(sModuleInfo,
                           "Android connected, but either not authorized or provided serial number not found in list. Ensure USB debugging is enabled in developer options, and that you authorized this computer to connect to it.",
                           2)
        return False
    else:
        CommonUtil.ExecLog(sModuleInfo, "No Android connected", 0)
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号