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

相关推荐
珹洺22 分钟前
Java-Spring入门指南(二十七)Android Studio 第一个项目搭建与手机页面模拟器运行
java·spring·android studio
消失的旧时光-19431 小时前
ScheduledExecutorService
android·java·开发语言
小糖学代码2 小时前
MySQL:14.mysql connect
android·数据库·mysql·adb
Costrict2 小时前
解锁新阵地!CoStrict 现已支持 JetBrains 系列 IDE
大数据·ide·人工智能·深度学习·自然语言处理·ai编程·visual studio
AlphaFinance3 小时前
Windows下Vscode连接到WSL的方法
ide·vscode·编辑器
怪兽20144 小时前
请谈谈什么是同步屏障?
android·面试
帅锅锅0074 小时前
SeLinux 全面详解
android·linux
只想搞钱的肥仔4 小时前
Android thermal (5)_cooling device(下)
android
某空m5 小时前
【Android】BottomNavigationView实现底部导航栏
android·java
撩得Android一次心动6 小时前
Android 四大组件桥梁 —— Intent (意图) 详解
android