[GH-ISSUE #153] UIAutomator2 - Does it auto connect to Wi-fi? USB disconnected, fallback to WiFi, ATX_AGENT_URL #122

Open
opened 2026-03-02 23:38:10 +03:00 by kerem · 0 comments
Owner

Originally created by @gvmturl on GitHub (Oct 25, 2020).
Original GitHub issue: https://github.com/alexal1/Insomniac/issues/153

Hello guys, after start script then disconnect cable from computer it seems to auto connect to Wifi and start to
message

[I 201025 00:17:02 init:259] USB disconnected, fallback to WiFi, ATX_AGENT_URL=http://192.168.2.59:7912

https://prnt.sc/v69ia1

Is there anyway to handle this system and messages? It seems to be more stable than using adb connect ip:port

As i could check there are two ways to connect with ui2

Connect to a device

There are two ways to connect to the device.

1 - Through WiFi

Suppose device IP is 10.0.0.1 and your PC is in the same network.

import uiautomator2 as u2

d = u2.connect('10.0.0.1') # alias for u2.connect_wifi('10.0.0.1')
print(d.info)

2 - Through USB

Suppose the device serial is 123456f (seen from adb devices)

import uiautomator2 as u2

d = u2.connect('123456f') # alias for u2.connect_usb('123456f')
print(d.info)

3 - Through ADB WiFi

import uiautomator2 as u2

d = u2.connect_adb_wifi("10.0.0.1:5555")

Equals to

  • Shell: adb connect 10.0.0.1:5555
  • Python: u2.connect_usb("10.0.0.1:5555")

Thank you

Originally created by @gvmturl on GitHub (Oct 25, 2020). Original GitHub issue: https://github.com/alexal1/Insomniac/issues/153 Hello guys, after start script then disconnect cable from computer it seems to auto connect to Wifi and start to message [I 201025 00:17:02 __init__:259] USB disconnected, fallback to WiFi, ATX_AGENT_URL=http://192.168.2.59:7912 https://prnt.sc/v69ia1 Is there anyway to handle this system and messages? It seems to be more stable than using adb connect ip:port As i could check there are two ways to connect with ui2 Connect to a device There are two ways to connect to the device. **1 - Through WiFi** Suppose device IP is 10.0.0.1 and your PC is in the same network. ``` import uiautomator2 as u2 d = u2.connect('10.0.0.1') # alias for u2.connect_wifi('10.0.0.1') print(d.info) ``` **2 - Through USB** Suppose the device serial is 123456f (seen from adb devices) ``` import uiautomator2 as u2 d = u2.connect('123456f') # alias for u2.connect_usb('123456f') print(d.info) ``` **3 - Through ADB WiFi** ``` import uiautomator2 as u2 d = u2.connect_adb_wifi("10.0.0.1:5555") ``` Equals to + Shell: adb connect 10.0.0.1:5555 + Python: u2.connect_usb("10.0.0.1:5555") Thank you
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Insomniac#122
No description provided.