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

相关推荐
用户20187928316741 分钟前
🌟 一场失败的加密舞会:SSL握手失败的奇幻冒险
android
tangweiguo030519872 小时前
面向对象编程三剑客:Dart、Java 和 Kotlin 的核心区别
android·flutter·kotlin
幼稚园的山代王2 小时前
Kotlin数据类型
android·开发语言·kotlin
xixixin_3 小时前
【H5】禁止IOS、安卓端长按的一些默认操作
android·css·ios·h5
zhangphil3 小时前
Android实现Glide/Coil样式图/视频加载框架,Kotlin
android·kotlin
cxylay3 小时前
LaTeX(排版系统)Texlive(环境)Vscode(编辑器)环境配置与安装
ide·vscode·编辑器·latex·texlive
用户2018792831673 小时前
“记忆邮局” (LiveData)
android
叽哥3 小时前
flutter学习第 17 节:项目实战:综合应用开发(下)
android·flutter·ios
小林up3 小时前
HiSmartPerf使用WIFI方式连接Android机显示当前设备0.0.0.0无法ping通!设备和电脑连接同一网络,将设备保持亮屏重新尝试
android·网络·电脑
用户2018792831675 小时前
Dialog不消失之谜——Android窗口系统的"平行宇宙"
android