Python3 获取安卓设备列表

2023-02-17 15:54:28 浏览数 (1)

代码语言:javascript复制
import re
import os

def get_devices():
    """
    获取设备列表
    :return: 设备列表
    """
    devices_info = os.popen('adb devices')
    devices_info = devices_info.read()
    devices = re.findall(r'(.*?)tdeviceb', devices_info)
    return devices

0 人点赞