doc: Update adb.md & homebrew.md and delete repeated mirror items (#304)

* chore: delete duplicate items

* doc: update adb.md and homebrew.md
This commit is contained in:
LufsX 2023-02-20 09:11:28 +08:00 committed by GitHub
parent f31aab4b35
commit de4286cd7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 89 additions and 87 deletions

View File

@ -147,7 +147,6 @@ REF_LABEL=网站首页
- [linzhe.top](https://linzhe.top/)
- [xushanxiang.com](https://xushanxiang.com/ref/)
- [winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)
- [isteed.cc](https://ref.isteed.cc/)
- [hestudio.org](https://quickref.hestudio.org)
- [surcode.cn](https://ref.surcode.cn)
- [cms.im](https://quickref.cms.im/)

View File

@ -473,7 +473,6 @@ Quick Reference
[linzhe.top](https://linzhe.top/)<!--rehype:target=_blank-->
[xushanxiang.com](https://xushanxiang.com/ref/)<!--rehype:target=_blank-->
[winnerzr01.github.io](https://winnerzr01.github.io/Quick-Reference/index.html)<!--rehype:target=_blank&class=contributing&data-info=👆需要梯子-->
[isteed.cc](https://ref.isteed.cc/)<!--rehype:target=_blank-->
[hestudio.org](https://quickref.hestudio.org)<!--rehype:target=_blank&class=contributing&data-info=👆整点自动同步-->
[surcode.cn](https://ref.surcode.cn)<!--rehype:target=_blank-->
[cms.im](https://quickref.cms.im/)<!--rehype:target=_blank-->

View File

@ -1,7 +1,7 @@
Android ADB 备忘清单
Android Debug Bridge 备忘清单
===
[ADB](https://developer.android.com/studio/command-line/adb.html)Android Debug Bridge包含在 Google 的 Android SDK 中,可用于从计算机控制您的 Android 设备。以下是您可以与 [ADB](https://developer.android.com/studio/command-line/adb.html) 一起使用的一些最常见的命令及其用法
[ADB](https://developer.android.com/studio/command-line/adb.html) 既 Android Debug Bridge是 Google 的 Android SDK 中的一个命令行工具,可让您的计算机控制 Android 设备执行各种设备操作。以下是您可以与 [ADB](https://developer.android.com/studio/command-line/adb.html) 一起使用的一些最常见的命令及其用法
入门
----
@ -11,15 +11,18 @@ Android ADB 备忘清单
:-- | --
:-- | --
`adb devices` | 列出连接的设备
`adb devices -l` | 列出连接的设备和种类
`adb devices` | 列出已连接的设备
`adb devices -l` | 列出已连接的设备和种类
`adb connect [IP:PORT]` | 连接到指定 IP 和端口的设备
`adb disconnect [IP:PORT]` | 断开指定 IP 和端口的设备连接,若未指定,则断开所有连接
`adb root` | 以 `root` 权限重新启动 `adbd`
`adb start-server` | 启动 `adb` 服务器
`adb kill-server` | 杀死 `adb` 服务器
`adb start-server` | 启动 `adb` 服务
`adb kill-server` | 停止 `adb` 服务器
`adb remount` | 重新挂载具有读/写访问权限的文件系统
`adb reboot` | 重启设备
`adb reboot bootloader` | 将设备重新启动到快速启动
`adb disable-verity` | 将设备重新启动到快速启动
`adb reboot bootloader` | 将设备重启到 fastboot 模式
`adb reboot recovery` | 将设备重启到恢复模式
`adb disable-verity` | 禁用设备的 dm-verity 安全特性
<!--rehype:className=left-align code-nowrap-->
---
@ -45,12 +48,12 @@ $ adb -s somedevice-1234 root
:-- | --
:-- | --
`adb logcat` | 开始将日志消息打印到标准输出
`adb logcat` | 将日志消息打印到标准输出
`adb logcat -g` | 显示当前日志缓冲区大小
`adb logcat -G <size>` | 设置缓冲区大小K 或 M
`adb logcat -c` | 清除日志缓冲区
`adb logcat *:V` | 启用所有日志消息(详细)
`adb logcat -f <filename>` | 转储到指定文件
`adb logcat -f <filename>` | 将日志转储到指定文件
<!--rehype:className=left-align code-nowrap-->
#### 示例
@ -62,16 +65,16 @@ $ adb logcat *:V > output.log
#### 过滤日志输出
- `V` 详细(最低优先级)
- `D` 调试
- `I` 信息
- `W` 警告
- `E` 错误
- `F` 严重错误
- `V` 详细的信息(最低优先级)
- `D` 调试信息
- `I` 普通信息
- `W` 警告信息
- `E` 错误信息
- `F` 致命错误信息
- `S` 静默(最高优先级)
<!--rehype:className=cols-2 shortcuts style-none-->
过滤器表达式显示了优先级不低于 `警告` 的所有标记的所有日志消息:
例如,要显示优先级不低于 `警告` 的所有标记的所有日志消息,可以使用以下命令
```bash
$ adb logcat *:W
@ -81,8 +84,8 @@ $ adb logcat *:W
:-- | --
:-- | --
`adb push <local> <remote>` | 将本地复制到远程设备
`adb pull <remote> <local>` | 将远程设备从设备复制到本地
`adb push <local> <remote>` | 将本地文件复制到远程设备
`adb pull <remote> <local>` | 将远程设备文件复制到本地
<!--rehype:className=left-align code-nowrap-->
#### 示例
@ -97,22 +100,22 @@ $ adb pull /sdcard/test.txt pulledTest.txt
:-- | --
:-- | --
`adb shell <command>` | 在设备上运行指定的命令(大多数 unix 命令在这里工作)
`adb shell <command>` | 在设备上运行指定的命令(大多数 Unix 命令在这里工作)
`adb shell wm size` | 显示当前屏幕分辨率
`adb shell wm size WxH` | 将分辨率设置为 WxH
`adb shell pm list packages` | 列出所有已安装的包
`adb shell pm list packages -3` | 列出所有已安装的 3rd 方
`adb shell monkey -p app.package.name` | 启动指定包
`adb shell pm list packages` | 列出所有已安装的应用
`adb shell pm list packages -3` | 列出所有已安装的第三方的应用
`adb shell monkey -p app.package.name` | 启动指定包名的应用程序
<!--rehype:className=style-list-arrow-->
### 包安装
:-- | --
:-- | --
`adb shell install <apk>` | 安装应用程序
`adb shell install <path>` | 手机路径安装应用
`adb shell install -r <path>` | 手机路径安装应用
`adb shell uninstall <name>` | 删除应用程序
`adb shell install <apk>` | 安装应用程序
`adb shell install <path>` | 手机路径安装应用
`adb shell install -r <path>` | 手机路径安装应用(允许覆盖安装)
`adb shell uninstall <name>` | 卸载应用程序
<!--rehype:className=left-align code-nowrap-->
### Paths
@ -121,10 +124,10 @@ $ adb pull /sdcard/test.txt pulledTest.txt
:-- | --
:-- | --
`/data/data/<package>/databases` | 应用程序数据库
`/data/data/<package>/shared_prefs/` | 共享偏好
`/data/app` | 用户安装的apk
`/system/app` | 预装的 APK 文件
`/mmt/asec` | 加密的应用程序\|App2SD
`/data/data/<package>/shared_prefs/` | 共享偏好设置
`/data/app` | 用户安装的 APK
`/system/app` | 系统预装的 APK 文件
`/mmt/asec` | 加密的应用程序App2SD
`/mmt/emmc` | 内部 SD 卡
`/mmt/adcard` | 外部/内部 SD 卡
`/mmt/adcard/external_sd` | 外置 SD 卡
@ -145,17 +148,17 @@ $ adb pull /sdcard/test.txt pulledTest.txt
:-- | --
:-- | --
`adb get-statе` | 打印设备状态
`adb get-serialno` | 获取序列号
`adb shell dumpsys iphonesybinfo` | 获取 IMEI
`adb shell netstat` | 列出 TCP 连接
`adb get-serialno` | 获取设备的序列号
`adb shell dumpsys iphonesybinfo` | 获取设备的 IMEI 信息
`adb shell netstat` | 列出设备上的所有 TCP 连接
`adb shell pwd` | 打印当前工作目录
`adb shell dumpsys battery` | 电池状态
`adb shell pm list features` | 列出电话功能
`adb shell service list` | 列出所有服务
`adb shell dumpsys activity <package>/<activity>` | 活动信息
`adb shell ps` | 打印进程状态
`adb shell wm size` | 显示当前屏幕分辨率
`dumpsys window windows` \| `grep -E 'mCurrentFocus\|mFocusedApp'` | 打印当前应用程序的打开活动
`adb shell dumpsys battery` | 获取设备电池状态
`adb shell pm list features` |列出设备支持的所有功能
`adb shell service list` | 列出设备上运行的所有服务
`adb shell dumpsys activity <package>/<activity>` | 获取指定包和活动信息
`adb shell ps` | 打印设备上所有运行的进程状态
`adb shell wm size` | 显示当前设备的屏幕分辨率
`dumpsys window windows` \| `grep -E 'mCurrentFocus\|mFocusedApp'` | 打印当前应用程序的打开活动的信息
<!--rehype:className=style-list-arrow-->
### 包信息
@ -168,8 +171,8 @@ $ adb pull /sdcard/test.txt pulledTest.txt
`adb shell list packages -s` | 仅列出系统包
`adb shell list packages -u` | 列出包名称 + 已卸载
`adb shell dumpsys package packages` | 列出所有应用程序的信息
`adb shell dump <name>` | 列出一个包的信息
`adb shell path <package>` | apk文件的路径
`adb shell dump <name>` | 列出一个包的信息
`adb shell path <package>` | 列出 APK 文件的路径
<!--rehype:className=style-list-arrow-->
### 设备相关命令
@ -177,7 +180,7 @@ $ adb pull /sdcard/test.txt pulledTest.txt
:-- | --
:-- | --
`adb reboot-recovery` | 重启设备进入恢复模式
`adb reboot recovery` | 重启设备进入恢复模式
`adb reboot fastboot` | 重启设备进入恢复模式
`adb shell screencap -p "/path/to/screenshot.png"` | 截图
`adb shell screenrecord "/path/to/record.mp4"` | 录制设备屏幕
@ -193,8 +196,8 @@ $ adb pull /sdcard/test.txt pulledTest.txt
:-- | --
:-- | --
`adb shell permissions groups` | 列出权限组定义
`adb shell list permissions -g -r` | 列出权限详细信息
`adb shell permissions groups` | 列出所有已定义的权限组
`adb shell list permissions -g -r` | 列出了所有权限详细信息
<!--rehype:className=style-list-arrow-->
### Logs
@ -211,7 +214,7 @@ $ adb pull /sdcard/test.txt pulledTest.txt
### 将文件推送到 Android 设备的下载文件夹
```bash
$ adb push example.apk /mnt/Download/
$ adb push example.apk /sdcard/Download/
```
### 列出所有已安装的包并获取完整路径
@ -223,19 +226,19 @@ $ adb shell pm list packages -f
### 从安卓设备中提取文件
```bash
$ adb pull /mnt/Download/example.apk
$ adb pull /sdcard/Download/example.apk
```
### 从主机安装 apk 到 Android 设备
### 从主机安装 APK 到 Android 设备
```bash
$ adb shell install example.apk
```
### 从 Android 设备存储安装 apk
### 从 Android 设备存储安装 APK
```bash
$ adb shell install /mnt/Download/example.apk
$ adb shell install /sdcard/Download/example.apk
```
### 设置网络代理
@ -250,7 +253,7 @@ $ adb shell settings put global http_proxy <address>:<port>
$ adb shell settings put global http_proxy :0
```
### 显示连接的设备并选择一个设备和外壳
### 显示连接的设备并指定一个设备进行 Shell
```bash
$ adb devices
@ -259,16 +262,16 @@ $ adb -s 7f1c864e shell
`7f1c864e` 是设备 `ID`
### 通过 ip 地址无线连接到设备
### 通过 IP 地址连接到设备
```bash
$ adb connect 192.168.56.101:5555
```
### adb 通过 wifi
### 通过 Wi-Fi 连接 ADB
<!--rehype:wrap-class=row-span-5-->
我们可以通过 `wifi` 或专门使用 `tcp` 连接使用 `adb`。 要通过 `wifi` 使用 `adb`,首先通过 `usb` 连接手机并启用 `usb` 调试。然后列出所有设备:
我们可以通过 `Wi-Fi` 或专门使用 `tcp` 连接使用 `adb`。 要通过 `Wi-Fi` 使用 `adb`,首先通过 `USB` 连接手机并启用 `USB` 调试。然后列出所有设备:
```bash
$ adb devices
@ -276,7 +279,7 @@ $ adb devices
# device_id device
```
现在检查 `android` 设备的 `ip`
现在检查 `Android` 设备的 `IP`
```bash
$ adb shell ifconfig
@ -286,7 +289,7 @@ wlan0 Link encap:UNSPEC Driver icnss
inet addr:XXX.XXX.X.XX Bcast:XXX.XXX.X.XXX
```
记下 `inet addr`面的 `ip` 地址。我们稍后会需要它。现在在某个端口重新启动 `tcpip`
记下 `inet addr``IP` 地址。稍后要用。现在在某个端口重新启动 `tcpip`
```bash
$ adb tcpip $port
@ -298,25 +301,25 @@ $ adb tcpip $port
$ adb tcpip 5555
```
您现在可以断开使用。 现在连接到设备只需给出以下命令:
您现在可以断开 USB 线缆使用。 若要连接到设备请键入以下命令:
```bash
$ adb connect $ip:$port
```
like:
例如:
```bash
$ adb connect 192.168.1.4:5555
```
### 从计算机上的 apk 文件安装应用程序
### 将计算机上的 APK 文件安装到设备
```bash
$ adb install /Users/dev/projects/myapp.apk
```
### 查找应用的 apk 路径
### 查找应用的 APK 路径
```bash
$ adb shell pm path com.example.myapp
@ -324,13 +327,13 @@ $ adb shell pm path com.example.myapp
`com.example.myapp` 替换为您自己的应用程序包名称
### 名称查找应用的包名
### 通过名称查找应用的包名
```bash
$ adb shell pm list package | grep app_name
```
### 将 apk 从设备提取到您的计算机
### 从设备提取 APK 到您的计算机
```bash
$ adb pull /data/app/com.example.myapp.apk ./
@ -366,7 +369,7 @@ $ adb shell input keyevent 66
### 发送点击
点击又名点击屏幕:
点击屏幕:
```bash
$ adb shell input tap x y

View File

@ -37,27 +37,28 @@ export HOMEBREW_INSTALL_FROM_API=1
命令 | 说明
:--- :---
`brew install git` | `安装`一个包
`brew reinstall git` | 重新`安装`一个包
`brew install git` | `安装`一个软件
`brew reinstall git` | 重新`安装`一个软件
`brew uninstall git` | `删除`/`卸载`软件包
`brew upgrade git` | 升级包
`brew upgrade git` | 升级一个软件包
`brew upgrade` | 升级所有可升级的包
:--- :---
`brew unlink git` | `取消`链接
`brew link git` | 关联
`brew switch git 2.5.0` | 更改版本
`brew unlink git` | 取消软件包的链接
`brew link git` | 链接已有的软件包
`brew switch git 2.5.0` | 切换软件包的版本
:--- :---
`brew list --versions git` | 看看你有什么版本
`brew list --versions git` | 查看安装的软件包及其版本信息
### 更多包命令
命令 | 说明
:--- :---
`brew info git` | 列出版本、注意事项等
`brew cleanup git` | 删除旧版本
`brew edit git` | 编辑此软件包
`brew cat git` | 打印这个软件包
`brew home git` | 打开主页
`brew search git` | 搜索公式
`brew info git` | 显示软件包的版本、依赖、注意事项等信息
`brew cleanup git` | 删除旧版本的软件包及其依赖
`brew edit git` | 编辑此软件包的安装脚本
`brew cat git` | 打印此软件包的安装脚本
`brew home git` | 打开此软件包的主页
`brew search git` | 搜索软件包公式并显示相关信息
### Brew Cask 命令
@ -66,20 +67,20 @@ export HOMEBREW_INSTALL_FROM_API=1
`brew install --cask firefox` | 安装火狐浏览器
`brew list --cask` | 列出已安装应用
Cask 命令用于与图形应用程序交互
Cask 命令用于与图形界面应用程序交互,可以安装和管理 macOS 上的图形界面应用程序
### 全局命令
<!--rehype:wrap-class=row-span-2-->
命令 | 说明
:--- :---
`brew update` | 更新 `brew` 和 `cask`
`brew upgrade` | 升级所有软件包
`brew list` | 已安装列表
`brew outdated` | 升级需要什么?
`brew doctor` | 诊断 brew 问题
`brew pin <formula>` | 防止指定软件包升级
`brew unpin <formula>` | 允许升级指定软件包
`brew update` | 更新 `Homebrew` 和 `Cask`
`brew upgrade` | 升级所有可升级的软件包
`brew list` | 列出已安装的软件包
`brew outdated` | 列出需要升级的软件包
`brew doctor` | 诊断 Homebrew 是否存在问题
`brew pin <formula>` | 防止指定软件包升级
`brew unpin <formula>` | 允许指定软件包被升级
### Brew 清理