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

相关推荐
Fate_I_C18 小时前
Android Navigation Fragment 导航实战
android·kotlin·navigation
Fate_I_C18 小时前
Adroid Data Binding数据绑定对比(findViewXX、ButterKnife)
android·kotlin·databinding
黑心的奥利奥19 小时前
WeeX跨平台框架,自定义安卓平台MarkDown文本渲染组件高度跟随内容自适应实现思路探索
android
KIHU快狐19 小时前
快狐KIHU|110寸壁挂触控一体机G+G电容屏安卓系统汽车展厅查询展示
android·python·汽车
sz49723859919 小时前
vscode多种编译环境共存的方法
ide·vscode·stm32·编辑器·esp32
Fate_I_C20 小时前
Android DataBinding数据绑定表达式、双向绑定
android·kotlin·databinding
csj5020 小时前
安卓基础之《(29)—消息机制与异步任务》
android
张风捷特烈20 小时前
状态管理大乱斗#02 | Bloc 源码全面评析
android·前端·flutter
untE EADO21 小时前
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
android·sql·mysql
诸神黄昏EX21 小时前
Android Google EDLA
android