zoukankan      html  css  js  c++  java
  • user版本串口不能输入

    os:android7.1

    描述:编译为userdebug版本时调试时,调试串口是可以正常输入输出的,编译为user版本时,串口就只能输出不能输入了。

    原因:

     out/target/product/rk3288/recovery/root/init.rc  
    
      # Always start adbd on userdebug and eng builds
        on property:ro.debuggable=1
        write /sys/class/android_usb/android0/enable 1
        start adbd
        start console

    可见,console的启用受ro.debuggable的控制,即是ro.debuggable=1时,才启动console。

    可以通过指令getprop ro.debuggable查看该属性的值:

    改属性在build/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
      # 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=0
    endif # !enable_target_debugging

    解决:在main.mk中修改ro.debuggable=1

  • 相关阅读:
    第七课 GDB调试 (下)
    设计模式之原型模式
    设计模式之再读重构
    设计模式之代理模式
    设计模式之建造者模式
    设计模式之模板方法模式
    设计模式之抽象工厂模式
    设计模式之工厂模式
    设计模式之单例模式
    设计模式之6大原则
  • 原文地址:https://www.cnblogs.com/wmc245376374/p/13088483.html
Copyright © 2011-2022 走看看