Skip to content

Commit 9367b41

Browse files
committed
Update README
1 parent 1eb47cb commit 9367b41

File tree

2 files changed

+86
-76
lines changed

2 files changed

+86
-76
lines changed

README.en.md

+38-33
Original file line numberDiff line numberDiff line change
@@ -110,39 +110,7 @@ USB connection normal use adb by the need to ensure that:
110110

111111
Description Connection successful.
112112

113-
#### Wireless connection (Android11+)
114-
115-
[Doc in Android developers](https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+)
116-
117-
Android 11 and higher support deploying and debugging your app wirelessly from your workstation using Android Debug Bridge (adb). For example, you can deploy your debuggable app to multiple remote devices without physically connecting your device via USB. This eliminates the need to deal with common USB connection issues, such as driver installation.
118-
119-
To use wireless debugging, you need to pair your device to your workstation using a pairing code. Your workstation and device must be connected to the same wireless network. To connect to your device, follow these steps:
120-
121-
1. Update to the latest version of the [SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools).
122-
123-
2. Connect Android device to run adb computer connected to the same local area network, such as connected to the same WiFi.
124-
125-
3. Enable the **Wireless debugging** option.
126-
127-
4. On the dialog that asks **Allow wireless debugging on this network?**, click **Allow**.
128-
129-
5. Select **Pair device with pairing code**. Take note of the pairing code, IP address, and port number displayed on the device.
130-
131-
6. On your workstation, open a terminal and navigate to `android_sdk/platform-tools`.
132-
133-
7. Run `adb pair ipaddr:port`. Use the IP address and port number from step 5.
134-
135-
8. When prompted, enter the pairing code that you received in step 5. A message indicates that your device has been successfully paired.
136-
137-
```sh
138-
none
139-
Enter pairing code: xxxxxx
140-
Successfully paired to ...
141-
```
142-
143-
9. (For Linux or Microsoft Windows only) Run `adb connect ipaddr:port`. Use the IP address and port under **Wireless debugging**.
144-
145-
#### Wireless connection (need to use the USB cable)
113+
#### Wireless connection (first time need to use the USB cable)
146114

147115
In addition to the USB connection to the computer to use adb, can also be a wireless connection - although the connection process is also step using USB needs, but after a successful connection to your device can get rid of the limit of the USB cable within a certain range it !
148116

@@ -192,10 +160,47 @@ If you can not connect, verify that Android devices and the computer is connecte
192160

193161
If that does not work, by `adb kill-server` restart the adb and then try it all over again.
194162

163+
<details>
164+
<summary>Hidden</summary>
165+
166+
#### Wireless connection (Android11+)
167+
168+
[Doc in Android developers](https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+)
169+
170+
Android 11 and higher support deploying and debugging your app wirelessly from your workstation using Android Debug Bridge (adb). For example, you can deploy your debuggable app to multiple remote devices without physically connecting your device via USB. This eliminates the need to deal with common USB connection issues, such as driver installation.
171+
172+
To use wireless debugging, you need to pair your device to your workstation using a pairing code. Your workstation and device must be connected to the same wireless network. To connect to your device, follow these steps:
173+
174+
1. Update to the latest version of the [SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools).
175+
176+
2. Connect Android device to run adb computer connected to the same local area network, such as connected to the same WiFi.
177+
178+
3. Enable the **Wireless debugging** option.
179+
180+
4. On the dialog that asks **Allow wireless debugging on this network?**, click **Allow**.
181+
182+
5. Select **Pair device with pairing code**. Take note of the pairing code, IP address, and port number displayed on the device.
183+
184+
6. On your workstation, open a terminal and navigate to `android_sdk/platform-tools`.
185+
186+
7. Run `adb pair ipaddr:port`. Use the IP address and port number from step 5.
187+
188+
8. When prompted, enter the pairing code that you received in step 5. A message indicates that your device has been successfully paired.
189+
190+
```sh
191+
none
192+
Enter pairing code: xxxxxx
193+
Successfully paired to ...
194+
```
195+
196+
9. (For Linux or Microsoft Windows only) Run `adb connect ipaddr:port`. Use the IP address and port under **Wireless debugging**.
197+
195198
#### Wireless connection (without using the USB cable)
196199

197200
**Need root privileges**, not detailed here, see more [click here](https://github.com/mzlogin/awesome-adb/blob/master/README.en.md#wireless-connection-without-using-the-usb-cable)
198201

202+
</details>
203+
199204
### Keep Wake-up Function
200205

201206
Only works when the phone is charging.

README.md

+48-43
Original file line numberDiff line numberDiff line change
@@ -110,37 +110,39 @@ https://cdn.awaw.cc/gh/pdone/FreeControl/releases/latest/download/FreeControl.ex
110110

111111
说明连接成功。
112112

113-
#### 无线连接(Android11 及以上)
114-
115-
Android 11 及更高版本支持使用 Android 调试桥 (adb) 从工作站以无线方式部署和调试应用。例如,您可以将可调试应用部署到多台远程设备,而无需通过 USB 实际连接设备。这样就可以避免常见的 USB 连接问题,例如驱动程序安装方面的问题。
113+
#### 无线连接(首次需要借助 USB 线)
116114

117-
[官方文档](https://developer.android.com/studio/command-line/adb?hl=zh_cn#connect-to-a-device-over-wi-fi-android-11+)
115+
除了可以通过 USB 连接设备与电脑来使用 adb,也可以通过无线连接——虽然连接过程中也有需要使用 USB 的步骤,但是连接成功之后你的设备就可以在一定范围内摆脱 USB 连接线的限制啦!
118116

119117
操作步骤:
120118

121-
1. 更新到最新版本的 [SDK 平台工具](https://developer.android.com/studio/releases/platform-tools?hl=zh_cn)(至少30.0.0)
119+
1. 将 Android 设备与要运行 adb 的电脑连接到同一个局域网,比如连到同一个 WiFi
122120

123-
2. 将 Android 设备与要运行 adb 的电脑连接到同一个局域网,比如连到同一个 WiFi
121+
2. 将设备与电脑通过 USB 线连接
124122

125-
3. 在开发者选项中启用**无线调试**
123+
应确保连接成功(可运行 `adb devices` 看是否能列出该设备)
126124

127-
4. 在询问要允许在此网络上进行无线调试吗?的对话框中,点击允许。
125+
3. 让设备在 5555 端口监听 TCP/IP 连接:
128126

129-
5. 选择使用配对码配对设备,使用弹窗中的 IP 地址和端口号。
127+
```sh
128+
adb tcpip 5555
129+
```
130130

131-
```sh
132-
adb pair ipaddr:port
133-
```
131+
4. 断开 USB 连接。
134132

135-
6. 提示 `Enter pairing code:` 时输入弹窗中的配对码,成功后会显示 `Successfully paired to ...`
133+
5. 找到设备的 IP 地址
136134

137-
7. 使用无线调试下的 **IP 地址和端口**
135+
一般能在「设置」-「关于手机」-「状态信息」-「IP地址」找到
138136

139-
```sh
140-
adb connect ipaddr:port
141-
```
137+
6. 通过 IP 地址连接设备。
142138

143-
8. 确认连接状态。
139+
```sh
140+
adb connect <device-ip-address>
141+
```
142+
143+
这里的 `<device-ip-address>` 就是上一步中找到的设备 IP 地址。
144+
145+
7. 确认连接状态。
144146

145147
```sh
146148
adb devices
@@ -149,44 +151,49 @@ Android 11 及更高版本支持使用 Android 调试桥 (adb) 从工作站以
149151
如果能看到
150152

151153
```sh
152-
ipaddr:port device
154+
<device-ip-address>:5555 device
153155
```
154156

155157
说明连接成功。
156158

157-
#### 无线连接(需要借助 USB 线)
159+
如果连接不了,请确认 Android 设备与电脑是连接到了同一个 WiFi,然后再次执行 `adb connect <device-ip-address>` 那一步;
158160

159-
除了可以通过 USB 连接设备与电脑来使用 adb,也可以通过无线连接——虽然连接过程中也有需要使用 USB 的步骤,但是连接成功之后你的设备就可以在一定范围内摆脱 USB 连接线的限制啦!
161+
如果还是不行的话,通过 `adb kill-server` 重新启动 adb 然后从头再来一次试试。
160162

161-
操作步骤:
163+
<details>
164+
<summary>已隐藏</summary>
162165

163-
1. 将 Android 设备与要运行 adb 的电脑连接到同一个局域网,比如连到同一个 WiFi。
166+
#### 无线连接(Android11 及以上)
164167

165-
2. 将设备与电脑通过 USB 线连接
168+
Android 11 及更高版本支持使用 Android 调试桥 (adb) 从工作站以无线方式部署和调试应用。例如,您可以将可调试应用部署到多台远程设备,而无需通过 USB 实际连接设备。这样就可以避免常见的 USB 连接问题,例如驱动程序安装方面的问题
166169

167-
应确保连接成功(可运行 `adb devices` 看是否能列出该设备)。
170+
[官方文档](https://developer.android.com/studio/command-line/adb?hl=zh_cn#connect-to-a-device-over-wi-fi-android-11+)
168171

169-
3. 让设备在 5555 端口监听 TCP/IP 连接
172+
操作步骤
170173

171-
```sh
172-
adb tcpip 5555
173-
```
174+
1. 更新到最新版本的 [SDK 平台工具](https://developer.android.com/studio/releases/platform-tools?hl=zh_cn)(至少30.0.0)。
174175

175-
4. 断开 USB 连接
176+
2. 将 Android 设备与要运行 adb 的电脑连接到同一个局域网,比如连到同一个 WiFi
176177

177-
5. 找到设备的 IP 地址
178+
3. 在开发者选项中启用**无线调试**
178179

179-
一般能在「设置」-「关于手机」-「状态信息」-「IP地址」找到
180+
4. 在询问要允许在此网络上进行无线调试吗?的对话框中,点击允许
180181

181-
6. 通过 IP 地址连接设备
182+
5. 选择使用配对码配对设备,使用弹窗中的 IP 地址和端口号
182183

183-
```sh
184-
adb connect <device-ip-address>
185-
```
184+
```sh
185+
adb pair ipaddr:port
186+
```
186187

187-
这里的 `<device-ip-address>` 就是上一步中找到的设备 IP 地址
188+
6. 提示 `Enter pairing code:` 时输入弹窗中的配对码,成功后会显示 `Successfully paired to ...`
188189

189-
7. 确认连接状态。
190+
7. 使用无线调试下的 **IP 地址和端口**
191+
192+
```sh
193+
adb connect ipaddr:port
194+
```
195+
196+
8. 确认连接状态。
190197

191198
```sh
192199
adb devices
@@ -195,19 +202,17 @@ Android 11 及更高版本支持使用 Android 调试桥 (adb) 从工作站以
195202
如果能看到
196203

197204
```sh
198-
<device-ip-address>:5555 device
205+
ipaddr:port device
199206
```
200207

201208
说明连接成功。
202209

203-
如果连接不了,请确认 Android 设备与电脑是连接到了同一个 WiFi,然后再次执行 `adb connect <device-ip-address>` 那一步;
204-
205-
如果还是不行的话,通过 `adb kill-server` 重新启动 adb 然后从头再来一次试试。
206-
207210
#### 无线连接(无需借助 USB 线)
208211

209212
**需要 root 权限**,此处不做详细说明,有需要的朋友可[参考此处](https://github.com/mzlogin/awesome-adb#%E6%97%A0%E7%BA%BF%E8%BF%9E%E6%8E%A5%E6%97%A0%E9%9C%80%E5%80%9F%E5%8A%A9-usb-%E7%BA%BF)。
210213

214+
</details>
215+
211216
### 保持唤醒功能
212217

213218
仅在手机充电时有效。

0 commit comments

Comments
 (0)