同步资料到 Hugo.
Signed-off-by: lion.chan <cy187lion@sina.com>
This commit is contained in:
parent
a4dcaca249
commit
df3e1ef759
|
@ -4,7 +4,7 @@ title: "Aapt 命令说明"
|
||||||
subtitle: ""
|
subtitle: ""
|
||||||
description: "描述 Aapt 命令的功能和用法。"
|
description: "描述 Aapt 命令的功能和用法。"
|
||||||
excerpt: "Aapt 命令可用于查看 apk 包名、主 activity、版本等。"
|
excerpt: "Aapt 命令可用于查看 apk 包名、主 activity、版本等。"
|
||||||
date: 2020-01-15 17:25:00
|
date: 2022-07-28 12:00:00
|
||||||
author: "Rick Chan"
|
author: "Rick Chan"
|
||||||
tags: ["Applications", "Aapt"]
|
tags: ["Applications", "Aapt"]
|
||||||
categories: ["Software"]
|
categories: ["Software"]
|
||||||
|
@ -15,11 +15,15 @@ aapt 即 Android Asset Packaging Tool,在 SDK 的 build-tools 目录下。该
|
||||||
|
|
||||||
Ubuntu 可通过 apt 命令安装 aapt 工具:
|
Ubuntu 可通过 apt 命令安装 aapt 工具:
|
||||||
|
|
||||||
sudo apt install aapt
|
```bash
|
||||||
|
sudo apt install aapt
|
||||||
|
```
|
||||||
|
|
||||||
可通过 aapt badging 输出 apk 的包名,主 activity、版本等信息
|
可通过 aapt badging 输出 apk 的包名,主 activity、版本等信息
|
||||||
|
|
||||||
aapt dump badging <apkname.apk> > <logfile>
|
```bash
|
||||||
|
aapt dump badging <apkname.apk> > <logfile>
|
||||||
|
```
|
||||||
|
|
||||||
之后在 logfile 中搜索 package,后面的 name 就是包名了,搜 activity,可以获取到 主 activity,搜 launchable-activity 可得到 package 和 activity。
|
之后在 logfile 中搜索 package,后面的 name 就是包名了,搜 activity,可以获取到 主 activity,搜 launchable-activity 可得到 package 和 activity。
|
||||||
|
|
||||||
|
|
|
@ -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 |
|
| CMD | Description |
|
||||||
|--------------------------------------------------------------------|--------------|
|
|--------------------------------------------------------------------|--------------|
|
||||||
|
|
|
@ -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 <serialNumbe> shell
|
命令会显示设备串号 SerialNumbe。
|
||||||
|
|
||||||
即可进入相应设备adb shell。其它指令类推。
|
之后在发起 ADB 连接时增加 -s 参数指定设备串号即可:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
adb -s <serialNumbe> shell
|
||||||
|
```
|
||||||
|
|
|
@ -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线连接手机,输入命令
|
usb线连接手机,输入命令
|
||||||
|
|
||||||
lsusb
|
```bash
|
||||||
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
lsusb
|
||||||
Bus 001 Device 003: ID 0461:4e22 Primax Electronics, Ltd
|
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
|
||||||
Bus 001 Device 002: ID 413c:2107 Dell Computer Corp.
|
Bus 001 Device 003: ID 0461:4e22 Primax Electronics, Ltd
|
||||||
Bus 001 Device 029: ID 2c73:7029
|
Bus 001 Device 002: ID 413c:2107 Dell Computer Corp.
|
||||||
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
Bus 001 Device 029: ID 2c73:7029
|
||||||
|
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
||||||
|
```
|
||||||
|
|
||||||
发现与不接手机时多出一个 ID 为 2c73:7029 的设备。输入命令
|
发现与不接手机时多出一个 ID 为 2c73:7029 的设备。输入命令
|
||||||
|
|
||||||
sudo gedit ~/.android/adb_usb.ini
|
```bash
|
||||||
|
sudo gedit ~/.android/adb_usb.ini
|
||||||
|
```
|
||||||
|
|
||||||
打开编辑器,加入设备 id
|
打开编辑器,加入设备 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
|
||||||
|
```
|
||||||
|
|
||||||
可发现已连接上设备。
|
可发现已连接上设备。
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue