Android 查看 Logcat (可纯手机方式 无需电脑)

安装 Logcat Reader
Github Google Play

如果有电脑 使用其ADB方式可执行如下命令 后续无需安装Termux

复制代码
# 使用 ADB 授予 android.permission.READ_LOGS 权限给 Logcat Reader
adb shell "pm grant com.dp.logcatapp android.permission.READ_LOGS && am force-stop com.dp.logcatapp"

没有电脑的情况且手机支持无线调试(Android11+) 可继续走下方步骤

安装 Termux
Github Google Play

  1. 打开 Termux 执行如下命令

    安装 android-tools

    pkg install android-tools

  2. 在「开发者选项」中开启「USB 调试」与「无线调试」

  3. 回到 Termux 执行如下命令

    adb 配对 (无线调试 - 使用配对码配对) 注意: 配对码界面不要关闭 切入后台即可,否则可能配对码和端口可能会变化的

    adb pair localhost:PORT

    adb 连接 此处的端口为无线调试界面显示的端口 (非配对的端口)

    adb connect localhost:PORT

    使用 ADB 授予 android.permission.READ_LOGS 权限给 Logcat Reader

    adb shell "pm grant com.dp.logcatapp android.permission.READ_LOGS && am force-stop com.dp.logcatapp"

相关推荐
恋猫de小郭10 小时前
Android 禁止侧载将正式实施,需要等待 24 小时冷静期
android·flutter·harmonyos
idealzouhu10 小时前
【Kotlin】 数据流完全指南:冷流、热流与 Android 实战
android·开发语言·kotlin
有位神秘人10 小时前
Android中Mvvm+Retrofit的常用网络架构记录
android·网络·retrofit
常利兵10 小时前
Android 字体字重设置:从XML到Kotlin的奇妙之旅
android·xml·kotlin
hnlgzb10 小时前
kotlin安卓app中,当一个类继承ViewModel类的时候,这个类是想干什么?
android·开发语言·kotlin
zh_xuan10 小时前
Android compose测试数据双向绑定
android·compose
hnlgzb10 小时前
kotlin类 继承android.app.Activity 和androidx.activity.ComponentActivity 有什么区别?
android·kotlin·androidx
lizhenjun11413 小时前
android修改线程名字长度
android
用户693717500138417 小时前
Google 正在“收紧侧加载”:陌生 APK 安装或需等待 24 小时
android·前端
用户693717500138417 小时前
Room 3.0:这次不是升级,是重来
android·前端·google