Android 11 usb调试默认打开
一. 修改ro.debuggable 默认值
build\make\core\main.mk
ifeq (true,$(strip $(enable_target_debugging)))
# Target is more debuggable and adbd is on by default
#ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
# Enable Dalvik lock contention logging.
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
else # !enable_target_debugging
# Target is less debuggable and adbd is off by default
# ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
endif # !enable_target_debugging
## eng ##
二. 修改授权框(默认不弹出, 设置允许)
system\core\adb\daemon\main.cpp
int adbd_main(int server_port)
//根据宏控制配置是否默认允许
if (android::base::GetBoolProperty("xxx.xxx.usb_def_debuger", true)) {
auth_required = false;
}
三. 解决 打开"开发者选项" 崩溃
avc: denied { read } for
name="u:object_r:logpersistd_logging_prop:s0"
dev="tmpfs"
ino=7775
scontext=u:r:system_app:s0
tcontext=u:object_r:logpersistd_logging_prop:s0
tclass=file
permissive=0
修改权限
system\sepolicy\prebuilts\api\30.0\private\system_app.te
set_prop(system_app, log_tag_prop)
# add fix bug Settings development fatal
set_prop(system_app, logpersistd_logging_prop)
userdebug_or_eng(`set_prop(system_app, logpersistd_logging_prop)')
system\sepolicy\private\system_app.te
set_prop(system_app, log_tag_prop)
# add fix bug Settings development fatal
set_prop(system_app, logpersistd_logging_prop)
userdebug_or_eng(`set_prop(system_app, logpersistd_logging_prop)')
本文地址:https://blog.csdn.net/whatareyou123/article/details/110233866
推荐阅读
-
android Studio调试出现USB device not found怎么办?
-
android如何默认打开小区广播具体实现
-
Android键盘输入语言设置默认打开myanmar缅甸语的步骤
-
Android调用默认浏览器打开指定Url的方法实例
-
android Studio调试出现USB device not found怎么办?
-
android如何默认打开小区广播具体实现
-
小米平板usb调试在哪怎么打开?
-
Android键盘输入语言设置默认打开myanmar缅甸语的步骤
-
如何在无数据线USB连接, 只有wifi情况下使用android studio build app到手机进行调试?
-
Android 开发中如何不用USB数据线进行调试