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

相关推荐
故渊at2 小时前
第二板块:Android 四大组件标准化学理 | 第六篇:四大组件架构总论与 Manifest 规范
android·架构·zygote·manifest·四大组件
Allenliu _Andy2 小时前
2026 最新版|免登录适配国内网络 Claude Code 终端版安装配置教程(Windows)
ide·chatgpt·openai·ai编程·claude code
Jinkxs2 小时前
Python基础 - 文件的写入操作 write与writelines方法
android·服务器·python
jason.zeng@15022073 小时前
(第二讲)Android开发取摄像头流的基础(ImageAnalysis)
android
敲代码的瓦龙4 小时前
操作系统?Android与Linux!!!
android·linux·运维
CTA量化套保4 小时前
Jupyter Notebook 反复运行天勤策略内存涨:close 与内核习惯
ide·人工智能·python·jupyter
愚公搬代码4 小时前
【愚公系列】《移动端AI应用开发》017-Android端应用开发(网络通信与API集成)
android·人工智能
say_fall4 小时前
可编程中断控制器8259A工作方式超详细解析
android·开发语言·学习·硬件架构·硬件工程
甜瓜看代码5 小时前
SystemUI 启动与组成机制
android·源码·源码阅读
黄林晴7 小时前
Kotlin 2.4.0 正式稳定!Android 升级、Compose、KMP 全变化详解
android·kotlin