[Description]如何默认打开user debug 选项 [Keyword]user debug root [Solution]1 在android 40 之前,这个设置是在frameworks/base/service//SystemServerjava 里面设置会根据system property 的persistserviceadbenable 来设置。您可以看到类似如代码: // make sure the ADB_ENABLED setting value matches the secure property value SettingsSecureputInt(mContentResolver, SettingsSecureADB_ENABLED, "1"equals(SystemPropertiesget("persistserviceadbenable")) 1 : 0); // register observer to listen for settings changes mContentResolverregisterContentObserver(SettingsSecuregetUriFor(SettingsSecureADB_ENABLED), false, new AdbSettingsObserver()); 而这个persistserviceadbenable 默认是放在在defaultprop 中,在编译的时候在build/core/mainmk 中确认, ifeq (true,$(strip $(enable_target_debugging))) # Target is more debuggable and adbd is on by default ADDITIONAL_DEFAULT_PROPERTIES += rodebuggable=1 persistserviceadbenable=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 += rodebuggable=0 persistserviceadbenable=0 endif # !enable_target_debugging 您需要将: ADDITIONAL_DEFAULT_PROPERTIES += rodebuggable=0 persistserviceadbenable=0 改成 ADDITIONAL_DEFAULT_PROPERTIES += rodebuggable=1 persistserviceadbenable=1 2 在android 40 之后,因为adb 的控制,统一使用了persistsysusbconfig 来控制,于是对应的设置点也改到了frameworks/base/service//usb/UsbDeviceManagerjava 中,您也可以看到类似的代码如:public UsbHandler(Looper looper) { // persistsysusbconfig should never be unset But if it is, set it to "adb" // so we have a chance of debugging what happened mDefaultFunctions = SystemPropertiesget("persistsysusbconfig", "adb"); // sanity check the sysusbconfig system property // this may be necessary if we crashed while switching USB configurations String config = SystemPropertiesget("sysusbconfig", "none"); if (!configequals(mDefaultFunctions)) { Slogw(TAG, "resetting config to persistent property: " + mDefaultFunctions); SystemPropertiesset("sysusbconfig", mDefaultFunctions); } mCurrentFunctions = mDefaultFunctions; String state = FileUtilsreadTextFile(new File(STATE_PATH), 0, null)trim(); updateState(state); mAdbEnabled = containsFunction(mCurrentFunctions, UsbManagerUSB_FUNCTION_ADB);public void systemReady() { // make sure the ADB_ENABLED setting value matches the current state SettingsSecureputInt(mContentResolver, SettingsSecureADB_ENABLED, mAdbEnabled 1 : 0); 而这个persistsysusbconfig 中adb 的配置是在alps/build/tools/post_process_propspy 中根据rodebuggable = 1 or 0 来设置,1 就是开启adb, 0 即关闭adb debug 而这个rodebuggable 也是在alps/build/core/mainmk 中设置,和23 修改类似不过您这样打开之后,对于user 版本adb shell 开启的还是shell 权限,而不是root 权限,如果您需要root 权限,需要再改一下system/core/adb/adbc 里面的should_drop_privileges() 这个函数,在#ifndef ALLOW_ADBD_ROOT 时return 0; 而不是return 1; 即可。
先配置config中的db,程序中调用Yii::app()->db
执行查询 $result=Yii::app()->db->createCommand('select from table')->queryAll();
加入的页面如果是视图的话
控制器action中 $this->render('indexphp', array('result'=>$result));
请采纳。
仅在里边定义连接字串,在使用的时候在创建对象,使用完对象就关闭
Configasp:
Quote
<%
Dim Def_Sample
Def_Path=serverMapPath("datamdb")
Def_Sample="DBQ="+Def_Path+";DefaultDir=;DRIVER={Microsoft Access Driver (mdb)};" '连接字串
%>
以上就是关于如何开启YII系统默认的DEBUG全部的内容,包括:如何开启YII系统默认的DEBUG、php中yii框架怎么加入自己的功能、yii criteria join 查询的数据怎么获取等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)