Esempio n. 1
0
def init_wireless(device_id: str = None, *args):
    """ 局域网使用 wifi 连接 iOS version < 14.0
        com.apple.instruments.server.services.wireless 在 iOS 14 以上版本没有了
    :param device_id:
    :return:
    """
    rpc = InstrumentServer(udid=device_id)
    if not args:
        addresses, port, psk = rpc.start_wireless()
    else:
        addresses, port, psk = args
    print('start wireless', addresses, port, psk)
    rpc_channel = rpc.init_wireless(addresses, port, psk)
    return rpc_channel
Esempio n. 2
0
                'vmFreeCount', 'vmIntPageCount', 'vmPurgeableCount',
                'netPacketsIn', 'vmWireCount', 'netBytesIn', 'netPacketsOut',
                'diskReadOps', 'vmUsedCount', '__vmSwapUsage', 'netBytesOut'
            ],  # 系统信息字段
            'cpuUsage':
            True,
            'sampleInterval':
            1000000000
        })
    rpc.register_channel_callback(
        "com.apple.instruments.server.services.sysmontap",
        on_sysmontap_message)
    var = rpc.call("com.apple.instruments.server.services.sysmontap",
                   "start").parsed
    print(f"start {var}")
    time.sleep(1000)
    var = rpc.call("com.apple.instruments.server.services.sysmontap",
                   "stop").parsed
    print(f"stop {var}")
    rpc.stop()


if __name__ == '__main__':
    rpc = InstrumentServer()
    addresses, port, psk = rpc.start_wireless()
    print('start wireless', addresses, port, psk)
    rpc = rpc.init_wireless(addresses, port, psk)
    # rpc = InstrumentServer().init()
    sysmontap(rpc)
    rpc.stop()