mac下连接夜神模拟器

连接夜神模拟器

1.adb连接单个模拟器
夜神模拟器,x86架构
# adb connect 127.0.0.1:62001
 
 2.断开模拟器
# adb disconnect 127.0.0.1:62001

代码设置设备连接,连接时会自动为设备推送apk包,atx。

import time
import uiautomator2 as u2


# d = u2.connect_wifi('10.0.64.254')
d = u2.connect_usb('127.0.0.1:62001') # connect to device
print(d.info)
print(d.device_info)

log信息输出,

[I 200606 21:25:50 init:155] uiautomator2 version: 2.9.2
[I 200606 21:25:50 init:352] Install minicap, minitouch
[I 200606 21:25:51 init:356] abi:x86 seems to be android emulator, skip install minicap
[I 200606 21:25:51 init:367] Install com.github.uiautomator, com.github.uiautomator.test 2.3.1
[I 200606 21:25:57 init:332] - app-uiautomator.apk installed
[I 200606 21:25:58 init:332] - app-uiautomator-test.apk installed
[I 200606 21:25:58 init:340] Install atx-agent 0.9.4
[I 200606 21:26:02 init:377] Check atx-agent version
Successfully init AdbDevice(serial=127.0.0.1:62001)
[D 200606 21:26:04 __init__:585] kill process(ps): uiautomator
[D 200606 21:26:06 __init__:604] uiautomator-v2 is starting ... left: 40.0s
[D 200606 21:26:07 __init__:604] uiautomator-v2 is starting ... left: 39.0s
[D 200606 21:26:08 __init__:604] uiautomator-v2 is starting ... left: 38.0s
[D 200606 21:26:09 __init__:604] uiautomator-v2 is starting ... left: 37.0s
[D 200606 21:26:10 __init__:604] uiautomator-v2 is starting ... left: 35.9s
[D 200606 21:26:11 __init__:604] uiautomator-v2 is starting ... left: 34.9s
[D 200606 21:26:12 __init__:604] uiautomator-v2 is starting ... left: 33.9s
[I 200606 21:26:12 __init__:568] uiautomator back to normal
{'currentPackageName': 'com.ss.android.article.lite', 'displayHeight': 1920, 'displayRotation': 0, 'displaySizeDpX': 540, 'displaySizeDpY': 960, 'displayWidth': 1080, 'productName': 'dream2qltezh', 'screenOn': True, 'sdkInt': 25, 'naturalOrientation': True}
{'udid': '988913415958415431-08:00:27:16:74:4e-SM-G9550', 'version': '7.1.2', 'serial': '988913415958415431', 'brand': 'samsung', 'model': 'SM-G9550', 'hwaddr': '08:00:27:16:74:4e', 'port': 7912, 'sdk': 25, 'agentVersion': '0.9.4', 'display': {'width': 1080, 'height': 1920}, 'battery': {'acPowered': False, 'usbPowered': False, 'wirelessPowered': False, 'status': 3, 'health': 2, 'present': True, 'level': 79, 'scale': 100, 'voltage': 10000, 'temperature': 379, 'technology': 'Li-ion'}, 'memory': {'total': 3110972, 'around': '3 GB'}, 'arch': '', 'owner': None, 'presenceChangedAt': '0001-01-01T00:00:00Z', 'usingBeganAt': '0001-01-01T00:00:00Z', 'product': None, 'provider': None}

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风雨「83」

你的鼓励将是我创作最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值