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的项目里没有这段逻辑

相关推荐
九鼎创展科技2 分钟前
九鼎创展发布X3588SCV4核心板,集成LPDDR5内存,提升RK3588S平台性能边界
android·人工智能·嵌入式硬件·硬件工程
BLOB_10100115 分钟前
关于懒人复制idea项目的坑
java·ide·intellij-idea
与籍同行1 小时前
安卓10.0 分屏相关
android
BD_Marathon2 小时前
Eclipse 代码自动补全设置
android·java·eclipse
YuforiaCode2 小时前
2025版最详细WebStorm下载安装教程(详细图解)
ide·webstorm
w***74402 小时前
SQL Server 数据库迁移到 MySQL 的完整指南
android·数据库·mysql
不剪发的Tony老师3 小时前
PyScripter:一款免费开源、功能强大的Python开发工具
ide·python
zgyhc205011 小时前
【Android Audio】dumpsys media.metrics分析
android
nono牛11 小时前
Android Binder 详解与实践指南
android·binder
小镇学者11 小时前
【PHP】PHP WebShell(网页木马)分析
android·开发语言·php