Android studio “Layout Inspector“工具在Android14 userdebug设备无法正常使用

背景描述

做rom开发的都知道,"Layout Inspector"和"Attach Debugger to Android Process"是studio里很好用的工具,可以用来查看布局、调试系统进程(比如setting、launcher、systemui)。

问题描述

最进刚开始一个Android 14的项目,刷userdebug版本后,发现"Layout Inspector"和"Attach Debugger to Android Process"都无法正常使用,它像user版本一样看不到系统的进程。

拿出前半年做的Android 13 userdebug设备发现可以正常使用。

于是创建了1个Google case,请求帮助。

解决方案

在经过几轮log和截图后,google同事给出了反馈:

Thanks for the extra details.

From Android 14 if you need to debug a Java process which isn't a debuggable app , and are using an userdebug build, you also need to enable JDWP by running the following commands

java 复制代码
adb shell setprop persist.debug.dalvik.vm.jdwp.enabled 1
adb reboot

This change was made by the platform (Android), not by Layout Inspector.

Let me know if this fixes your problem.

验证之后是有效的,Android 14 userdebug版本的设备可以使用"Layout Inspector"和"Attach Debugger to Android Process"工具了,又可以快乐的调试系统进程了。

问题原因

在源码搜索persist.debug.dalvik.vm.jdwp.enabled 发现是Google新加的代码。

在之前Android 13的项目里没有这段逻辑

相关推荐
Xzaveir5 小时前
不要用一个状态表示“号码已认证”:企业号码身份的四域模型
android·人工智能
zhangjin11207 小时前
AOSP下载
android
Mico188 小时前
MySQL 8.0.35 GTID 主从复制搭建-基于GITD
android·mysql·adb
YXL1111YXL10 小时前
LeakCanary 源码解析检测泄露工作机制(一)
android·leakcanary
且随疾风前行.12 小时前
Android Binder 驱动 - 内核驱动层源码初探
android·网络·binder
额恩6612 小时前
AI 智能体从零搭建实战教程——扣子
android·rxjava·coze
hunterandroid12 小时前
前台服务适配与线上排查:通知权限、启动限制和任务保活
android·前端
帅次12 小时前
Android 高级工程师面试:Flutter 渲染与性能 近1年高频追问 20 题
android·flutter·面试·渲染·性能
信鸽爱好者12 小时前
VSCode配置python虚拟环境路径
ide·vscode·python
爱吃提升13 小时前
2026最新VSCode 详细下载安装教程+汉化教程(含快捷键与使用趋势)
ide·vscode·编辑器