在Production Build (User版本/生产版本)的安卓设备上,出于安全考虑,普通用户(包括adb shell)没有权限直接访问/cache分区,也无法执行adb root 如何查看日志呢?
adb pull /cache/recovery/last_log . adb: error: failed to stat remote object '/cache/recovery/last_log': Permission denied
adb root adbd cannot run as root in production builds
这是一个非常典型的情况。在 Production Build (User版本/生产版本) 的安卓设备上,出于安全考虑,普通用户(包括 adb shell)没有权限直接访问 /cache 分区,也无法执行 adb root。
但是,你依然有办法获取这些日志。安卓系统提供了一个专门的工具 bugreport,它拥有更高的权限(通过 dumpstate 服务),可以将系统日志打包导出来。