大家好,我想问一下,怎么样可以修改源码,让机器开机时的usb模式为调试模式。我在default.xml文件里查了一下,没有看到这个选项,谢谢
解决方案 »
- google android 源代码的music的问题 音乐播放器问题
- 如何实现下拉列表
- surfaceView 和 gesture 如何使用呢
- 等距排列
- 请教Android在3G网络中调用Http接口问题
- 一个诡异神奇的bug!有坛友遇到过类似的吗?
- android 杀掉进程出现清空掉/data/data下面的TXT文件里面的内容
- 调用 axis2 webservices 问题?
- Unable to instantiate application请大神帮忙
- 安卓应用横竖屏切换的问题
- Android SDK Manager 更新速度极慢
- 求助:关于android 使用websocket遇到的棘手问题(用过websocket-android-phonegap的进)
我们都是修改sys_config1.fex文件的usb控制选项,改下值就行了!现在手边没例子,要不然就给你发过去了!
我不知道你的系统是不是google的
我的是allwinner的
如果和我的一样,那么你直接去内核中
find ./ -name "sys_config1.fex"即可
String value = SystemProperties.get("persist.service.adb.enable", "");
/*Begin DTS2012052206277 modified by b00183757 on 20120623*/
if (value.length() > 0) {
char enable = value.charAt(0);
if (enable == '1') {
setAdbEnabled(true);
} else if (enable == '0') {
setAdbEnabled(false);
}
SystemProperties.set("persist.service.adb.enable", "");
}LZ,USB调试开关打开 是通过系统属性"persist.service.adb.enable"来控制的 在首次烧机的时候默认设置"persist.service.adb.enable"即可
修改DefaultActivity.java
在onCreate里面加入下面这句话即可在user模式默认开启usb调试
Settings.Secure.putInt(getContentResolver(),Settings.Secure.ADB_ENABLED, 1);
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1 persist.service.adb.enable=1
# Target is more debuggable and adbd is on by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
# Include the debugging/testing OTA keys in this build.
INCLUDE_TEST_OTA_KEYS := true
else # !enable_target_debugging
# Target is less debuggable and adbd is off by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
endif # !enable_target_debugging