From df3e1ef759914bc6e783a5ab997875213b9ac242 Mon Sep 17 00:00:00 2001 From: "lion.chan" Date: Thu, 28 Jul 2022 15:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E8=B5=84=E6=96=99=E5=88=B0?= =?UTF-8?q?=20Hugo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lion.chan --- Software/Applications/AAPT/Aapt_命令说明.md | 10 ++-- Software/Applications/ADB/Adb_常用指令.md | 13 ++++- Software/Applications/ADB/Adb_操控多个设备.md | 29 +++++++++--- .../ADB/解决 _Linux_下_ADB_无法检测到设备.md | 47 ++++++++++++++----- 4 files changed, 77 insertions(+), 22 deletions(-) diff --git a/Software/Applications/AAPT/Aapt_命令说明.md b/Software/Applications/AAPT/Aapt_命令说明.md index 1b10b97..4eb6fb8 100644 --- a/Software/Applications/AAPT/Aapt_命令说明.md +++ b/Software/Applications/AAPT/Aapt_命令说明.md @@ -4,7 +4,7 @@ title: "Aapt 命令说明" subtitle: "" description: "描述 Aapt 命令的功能和用法。" excerpt: "Aapt 命令可用于查看 apk 包名、主 activity、版本等。" -date: 2020-01-15 17:25:00 +date: 2022-07-28 12:00:00 author: "Rick Chan" tags: ["Applications", "Aapt"] categories: ["Software"] @@ -15,11 +15,15 @@ aapt 即 Android Asset Packaging Tool,在 SDK 的 build-tools 目录下。该 Ubuntu 可通过 apt 命令安装 aapt 工具: - sudo apt install aapt +```bash +sudo apt install aapt +``` 可通过 aapt badging 输出 apk 的包名,主 activity、版本等信息 - aapt dump badging > +```bash +aapt dump badging > +``` 之后在 logfile 中搜索 package,后面的 name 就是包名了,搜 activity,可以获取到 主 activity,搜 launchable-activity 可得到 package 和 activity。 diff --git a/Software/Applications/ADB/Adb_常用指令.md b/Software/Applications/ADB/Adb_常用指令.md index 130c5f5..bf4ddf3 100644 --- a/Software/Applications/ADB/Adb_常用指令.md +++ b/Software/Applications/ADB/Adb_常用指令.md @@ -1,4 +1,15 @@ -# Adb 常用指令 +--- +layout: post +title: "ADB 常用指令" +subtitle: "" +description: "提供常用的 ADB 指令参数。" +excerpt: "提供常用的 ADB 指令参数。" +date: 2022-07-28 12:08:00 +author: "Rick Chan" +tags: ["Applications", "ADB"] +categories: ["Software"] +published: true +--- | CMD | Description | |--------------------------------------------------------------------|--------------| diff --git a/Software/Applications/ADB/Adb_操控多个设备.md b/Software/Applications/ADB/Adb_操控多个设备.md index b8248b7..a43f8dc 100644 --- a/Software/Applications/ADB/Adb_操控多个设备.md +++ b/Software/Applications/ADB/Adb_操控多个设备.md @@ -1,11 +1,28 @@ -# Adb 操控多个设备 +--- +layout: post +title: "ADB 操控多个设备" +subtitle: "" +description: "解决 ADB 连接多个 Android 设备时如何指定具体设备的问题。" +excerpt: "存在多个 Android 设备与主机连接时,需要指定设备串号才能正确连接 ADB 服务。" +date: 2022-07-28 12:06:00 +author: "Rick Chan" +tags: ["Applications", "ADB"] +categories: ["Software"] +published: true +--- -同时连接多个 android 设备后,需要指定设备才能执行命令。 +同时连接多个 Android 设备后,需要指定设备串号才能正确连接对应设备的 ADB 服务。 - adb devices +执行: -后会显示设备串号 serialNumbe。对其发起指令在adb后加-s参数跟相应设备串号: +```bash +adb devices +``` - adb -s shell +命令会显示设备串号 SerialNumbe。 -即可进入相应设备adb shell。其它指令类推。 +之后在发起 ADB 连接时增加 -s 参数指定设备串号即可: + +```bash +adb -s shell +``` diff --git a/Software/Applications/ADB/解决 _Linux_下_ADB_无法检测到设备.md b/Software/Applications/ADB/解决 _Linux_下_ADB_无法检测到设备.md index 0d2e94c..e159db4 100644 --- a/Software/Applications/ADB/解决 _Linux_下_ADB_无法检测到设备.md +++ b/Software/Applications/ADB/解决 _Linux_下_ADB_无法检测到设备.md @@ -1,35 +1,58 @@ -# 解决 Linux 下 ADB 无法检测到设备 +--- +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 +--- ## 解决方案 usb线连接手机,输入命令 - 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 +```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 +``` 发现与不接手机时多出一个 ID 为 2c73:7029 的设备。输入命令 - sudo gedit ~/.android/adb_usb.ini +```bash +sudo gedit ~/.android/adb_usb.ini +``` 打开编辑器,加入设备 id - 0x2c73 +```bash +0x2c73 +``` 输入命令 - chmod 777 ~/.android/adb_usb.ini +```bash +chmod 777 ~/.android/adb_usb.ini +``` 输入 - adb kill-server +```bash +adb kill-server +``` 再次 - adb devices +```bash +adb devices +``` 可发现已连接上设备。