2022-07-28 15:01:41 +08:00
|
|
|
|
---
|
|
|
|
|
layout: post
|
|
|
|
|
title: "解决 Linux 下 ADB 无法检测到设备"
|
|
|
|
|
subtitle: ""
|
|
|
|
|
description: "解决开发 Android 设备时无法识别 ADB 设备的问题。"
|
|
|
|
|
excerpt: "自行开发 Android 设备时,其设备 ID 不标准导致无法识别为标准 ADB 设备。"
|
|
|
|
|
date: 2022-07-28 12:03:00
|
|
|
|
|
author: "Rick Chan"
|
|
|
|
|
tags: ["Applications", "ADB"]
|
|
|
|
|
categories: ["Software"]
|
|
|
|
|
published: true
|
|
|
|
|
---
|
2019-07-21 22:48:36 +08:00
|
|
|
|
|
|
|
|
|
## 解决方案
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2019-03-06 23:53:20 +08:00
|
|
|
|
usb线连接手机,输入命令
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2022-07-28 15:01:41 +08:00
|
|
|
|
```bash
|
|
|
|
|
lsusb
|
|
|
|
|
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
|
|
|
|
Bus 001 Device 003: ID 0461:4e22 Primax Electronics, Ltd
|
|
|
|
|
Bus 001 Device 002: ID 413c:2107 Dell Computer Corp.
|
|
|
|
|
Bus 001 Device 029: ID 2c73:7029
|
|
|
|
|
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
|
|
|
|
```
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2019-07-21 22:48:36 +08:00
|
|
|
|
发现与不接手机时多出一个 ID 为 2c73:7029 的设备。输入命令
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2022-07-28 15:01:41 +08:00
|
|
|
|
```bash
|
|
|
|
|
sudo gedit ~/.android/adb_usb.ini
|
|
|
|
|
```
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2019-03-06 23:50:35 +08:00
|
|
|
|
打开编辑器,加入设备 id
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2022-07-28 15:01:41 +08:00
|
|
|
|
```bash
|
|
|
|
|
0x2c73
|
|
|
|
|
```
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2019-03-06 23:53:20 +08:00
|
|
|
|
输入命令
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2022-07-28 15:01:41 +08:00
|
|
|
|
```bash
|
|
|
|
|
chmod 777 ~/.android/adb_usb.ini
|
|
|
|
|
```
|
2019-03-06 23:48:55 +08:00
|
|
|
|
|
2019-03-06 23:53:20 +08:00
|
|
|
|
输入
|
2019-03-06 23:50:35 +08:00
|
|
|
|
|
2022-07-28 15:01:41 +08:00
|
|
|
|
```bash
|
|
|
|
|
adb kill-server
|
|
|
|
|
```
|
2019-03-06 23:50:35 +08:00
|
|
|
|
|
|
|
|
|
再次
|
|
|
|
|
|
2022-07-28 15:01:41 +08:00
|
|
|
|
```bash
|
|
|
|
|
adb devices
|
|
|
|
|
```
|
2019-03-06 23:50:35 +08:00
|
|
|
|
|
2019-07-21 22:48:36 +08:00
|
|
|
|
可发现已连接上设备。
|
|
|
|
|
|
2020-08-14 11:33:10 +08:00
|
|
|
|
## 外部参考资料
|
2019-07-21 22:48:36 +08:00
|
|
|
|
|
2020-08-14 11:33:10 +08:00
|
|
|
|
1. [ubuntu usb 连接手机无法识别设备解决方法](https://blog.csdn.net/qq_30185811/article/details/78960780)
|