Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
pdone committed Jun 18, 2024
1 parent 1eb47cb commit 9367b41
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 76 deletions.
71 changes: 38 additions & 33 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,39 +110,7 @@ USB connection normal use adb by the need to ensure that:

Description Connection successful.

#### Wireless connection (Android11+)

[Doc in Android developers](https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+)

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.

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:

1. Update to the latest version of the [SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools).

2. Connect Android device to run adb computer connected to the same local area network, such as connected to the same WiFi.

3. Enable the **Wireless debugging** option.

4. On the dialog that asks **Allow wireless debugging on this network?**, click **Allow**.

5. Select **Pair device with pairing code**. Take note of the pairing code, IP address, and port number displayed on the device.

6. On your workstation, open a terminal and navigate to `android_sdk/platform-tools`.

7. Run `adb pair ipaddr:port`. Use the IP address and port number from step 5.

8. When prompted, enter the pairing code that you received in step 5. A message indicates that your device has been successfully paired.

```sh
none
Enter pairing code: xxxxxx
Successfully paired to ...
```

9. (For Linux or Microsoft Windows only) Run `adb connect ipaddr:port`. Use the IP address and port under **Wireless debugging**.

#### Wireless connection (need to use the USB cable)
#### Wireless connection (first time need to use the USB cable)

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 !

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

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

<details>
<summary>Hidden</summary>

#### Wireless connection (Android11+)

[Doc in Android developers](https://developer.android.com/studio/command-line/adb#connect-to-a-device-over-wi-fi-android-11+)

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.

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:

1. Update to the latest version of the [SDK Platform-Tools](https://developer.android.com/studio/releases/platform-tools).

2. Connect Android device to run adb computer connected to the same local area network, such as connected to the same WiFi.

3. Enable the **Wireless debugging** option.

4. On the dialog that asks **Allow wireless debugging on this network?**, click **Allow**.

5. Select **Pair device with pairing code**. Take note of the pairing code, IP address, and port number displayed on the device.

6. On your workstation, open a terminal and navigate to `android_sdk/platform-tools`.

7. Run `adb pair ipaddr:port`. Use the IP address and port number from step 5.

8. When prompted, enter the pairing code that you received in step 5. A message indicates that your device has been successfully paired.

```sh
none
Enter pairing code: xxxxxx
Successfully paired to ...
```

9. (For Linux or Microsoft Windows only) Run `adb connect ipaddr:port`. Use the IP address and port under **Wireless debugging**.

#### Wireless connection (without using the USB cable)

**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)

</details>

### Keep Wake-up Function

Only works when the phone is charging.
Expand Down
91 changes: 48 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,37 +110,39 @@ https://cdn.awaw.cc/gh/pdone/FreeControl/releases/latest/download/FreeControl.ex

说明连接成功。

#### 无线连接(Android11 及以上)

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

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

操作步骤:

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

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

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

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

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

```sh
adb pair ipaddr:port
```
4. 断开 USB 连接。

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

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

```sh
adb connect ipaddr:port
```
6. 通过 IP 地址连接设备。

8. 确认连接状态。
```sh
adb connect <device-ip-address>
```

这里的 `<device-ip-address>` 就是上一步中找到的设备 IP 地址。

7. 确认连接状态。

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

```sh
ipaddr:port device
<device-ip-address>:5555 device
```

说明连接成功。

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

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

操作步骤:
<details>
<summary>已隐藏</summary>

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

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

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

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

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

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

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

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

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

```sh
adb connect <device-ip-address>
```
```sh
adb pair ipaddr:port
```

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

7. 确认连接状态。
7. 使用无线调试下的 **IP 地址和端口**

```sh
adb connect ipaddr:port
```

8. 确认连接状态。

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

```sh
<device-ip-address>:5555 device
ipaddr:port device
```

说明连接成功。

如果连接不了,请确认 Android 设备与电脑是连接到了同一个 WiFi,然后再次执行 `adb connect <device-ip-address>` 那一步;

如果还是不行的话,通过 `adb kill-server` 重新启动 adb 然后从头再来一次试试。

#### 无线连接(无需借助 USB 线)

**需要 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)。

</details>

### 保持唤醒功能

仅在手机充电时有效。
Expand Down

0 comments on commit 9367b41

Please sign in to comment.