1. 程式人生 > >[RK3288][Android6.0] 除錯筆記 --- user版本串列埠只有輸出不能輸入

[RK3288][Android6.0] 除錯筆記 --- user版本串列埠只有輸出不能輸入

Platform: ROCKCHIP
OS: Android 6.0
Kernel: 3.10.92

現象:
編譯成user版本之後串列埠只有輸出沒有輸入.

原因:
編譯user版本之後 ro.debuggable=0
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

system/core/rootdir/init.rc
service console /system/bin/sh
    class core
    console
    disabled
    user shell
    group shell log
    seclabel u:r:shell:s0

on property:ro.debuggable=1
    start console

可見console是否啟動受屬性ro.debuggable的控制.

解決方法:
1. 修改 ro.debuggable = 1

2. 直接將disabled移除,預設無條件啟動console.

參考:

http://blog.csdn.net/buaaroid/article/details/32714041