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

相关推荐
Android技术之家11 分钟前
安卓对外发布工程源码:如何实现仅暴露 UI 层
android·ui
阿阿阿阿里郎16 分钟前
Vscode+STM32CubeMX+Cmake联合开发教
ide·vscode·编辑器
Digitally19 分钟前
如何快速将iPhone上的图片发送到安卓手机(6种方法)
android·智能手机·iphone
w***741726 分钟前
MySQL压缩版安装详细图解
android·mysql·adb
vortex51 小时前
为什么我把VSCode换成了Code-Server
ide·vscode·编辑器
童话的守望者2 小时前
DC5通关及溯源分析
android
lichong9512 小时前
harmonyos 大屏设备怎么弹出 u 盘
前端·macos·华为·typescript·android studio·harmonyos·大前端
青莲8432 小时前
Android Lifecycle 完全指南:从设计原理到生产实践
android·前端
打工人1112 小时前
安卓Android 获取mac地址及sn
android·macos
0和1的舞者2 小时前
《Maven 核心功能与仓库体系详解》
ide·maven·项目管理·仓库·依赖