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

相关推荐
Mr Lee_32 分钟前
attribute android:enableOnBackInvokedCallback not found
android
Jomurphys33 分钟前
Compose - 使用 Reorderable
android
帅得不敢出门40 分钟前
Android Framework在mk中新增类似PRODUCT_MODEL的变量并传递给buildinfo.sh及prop属性中
android·linux·前端
Jackson@ML1 小时前
2026最新版Visual Studio安装使用指南
ide·c#·visual studio
似霰1 小时前
AIDL Hal 开发笔记7----AIDL HAL 的升级
android·framework·hal
黄大包1 小时前
android MQTT封装
android·mqtt·mt
chao_6666664 小时前
Claude Code for vscode 新手入门完整教程
ide·vscode·ai·编辑器·ai编程·claude
Satellite_H4 小时前
Keil + VSCode 优化开发体验
ide·vscode·编辑器
2501_916007475 小时前
跨平台 App 安全,Flutter、RN、Unity、H5 混合应用加固
android·ios·小程序·https·uni-app·iphone·webview
lingzhilab6 小时前
零知IDE—— ESP8266(ESP-12F)MESH 组网实现多设备智能家居控制系统(灯光 / 传感器 / 人体感应)
c++·ide·智能家居