usb debugging是什么意思呢?怎么才能启用呢? enable usb debugging是什么意思

\u8fd9\u662f\u4ec0\u4e48\u610f\u601d\uff1f\u600e\u4e48\u80fd\u8ba9usb\u542f\u7528\uff1f

\u610f\u601d\u662f\u7cfb\u7edf\u9700\u8981\u66f4\u65b0\uff01
\u542f\u7528usb\u7684\u65b9\u6cd5\uff1a\u7535\u8111\u548c\u5916\u8bbe\u5148\u7528\u7535\u7f06\u8fde\u63a5\u8d77\u6765\uff0c\u7136\u540e\u518d\u5efa\u7acb\u65e0\u7ebf\u8fde\u63a5\u4ee5\u4f9b\u4ee5\u540e\u4f7f\u7528\uff01
USB\uff0c\u662f\u82f1\u6587Universal Serial Bus(\u901a\u7528\u4e32\u884c\u603b\u7ebf)\u7684\u7f29\u5199\uff0c\u662f\u4e00\u4e2a\u5916\u90e8\u603b\u7ebf\u6807\u51c6\uff0c\u7528\u4e8e\u89c4\u8303\u7535\u8111\u4e0e\u5916\u90e8\u8bbe\u5907\u7684\u8fde\u63a5\u548c\u901a\u8baf\u3002\u662f\u5e94\u7528\u5728PC\u9886\u57df\u7684\u63a5\u53e3\u6280\u672f\u3002USB\u63a5\u53e3\u652f\u6301\u8bbe\u5907\u7684\u5373\u63d2\u5373\u7528\u548c\u70ed\u63d2\u62d4\u529f\u80fd\u3002USB\u662f\u57281994\u5e74\u5e95\u7531\u82f1\u7279\u5c14\u3001\u5eb7\u67cf\u3001IBM\u3001Microsoft\u7b49\u591a\u5bb6\u516c\u53f8\u8054\u5408\u63d0\u51fa\u7684\u3002
\u65b0\u7684USB3.0\u5728\u4fdd\u6301\u4e0eUSB2.0\u7684\u517c\u5bb9\u6027\u7684\u540c\u65f6\uff0c\u8fd8\u63d0\u4f9b\u4e86\u4e0b\u9762\u7684\u51e0\u9879\u589e\u5f3a\u529f\u80fd\uff1a
\u6781\u5927\u63d0\u9ad8\u4e86\u5e26\u5bbd\u2014\u2014\u9ad8\u8fbe5Gbps\u5168\u53cc\u5de5\uff08USB2.0\u5219\u4e3a480Mbps\u534a\u53cc\u5de5\uff09
\u5b9e\u73b0\u4e86\u66f4\u597d\u7684\u7535\u6e90\u7ba1\u7406
\u80fd\u591f\u4f7f\u4e3b\u673a\u4e3a\u5668\u4ef6\u63d0\u4f9b\u66f4\u591a\u7684\u529f\u7387\uff0c\u4ece\u800c\u5b9e\u73b0USB\u2014\u2014\u5145\u7535\u7535\u6c60\u3001LED\u7167\u660e\u548c\u8ff7\u4f60\u5e94\u7528\u3002
\u80fd\u591f\u4f7f\u4e3b\u673a\u66f4\u5feb\u5730\u8bc6\u522b\u5668\u4ef6
\u65b0\u7684\u534f\u8bae\u4f7f\u5f97\u6570\u636e\u5904\u7406\u7684\u6548\u7387\u66f4\u9ad8
USB3.0\u53ef\u4ee5\u5728\u5b58\u50a8\u5668\u4ef6\u6240\u9650\u5b9a\u7684\u5b58\u50a8\u901f\u7387\u4e0b\u4f20\u8f93\u5927\u5bb9\u91cf\u6587\u4ef6\uff08\u5982HD\u7535\u5f71\uff09\u3002\u4f8b\u5982\uff0c\u4e00\u4e2a\u91c7\u7528USB3.0\u7684\u95ea\u5b58\u9a71\u52a8\u5668\u53ef\u4ee5\u572815\u79d2\u949f\u5c061GB\u7684\u6570\u636e\u8f6c\u79fb\u5230\u4e00\u4e2a\u4e3b\u673a\uff0c\u800cUSB 2.0\u5219\u9700\u898143\u79d2\u3002

enable usb debugging
\u542f\u7528usb\u8c03\u8bd5
After that you just need to enable USB debugging on the phone, and plug it in. \u4e00\u5207\u90fd\u5b8c\u6210\u4e4b\u540e\uff0c\u4f60\u53ea\u9700\u5c06\u624b\u673a\u7684USB\u53e3\u8c03\u8bd5\u529f\u80fd\u6253\u5f00\uff0c\u7136\u540e\u63d2\u8fdb\u53bb\u5c31\u53ef\u4ee5\u4e86\u3002

usb调试,在settings中,有一个控制是否允许远程调试的选项usb debugging,当这个开关为off的时候,无法使用adb,也不能把手机当作ms-storage来使用。 java中能访问的设定保存在/data/data/com.android.providers.settings/databases/settings.db里面。
字段名字叫做 adb_enabled。用户操作settings来修改设定时,实际上就是改变这个字段。

android进程system server中起了一个线程在一直监视db的这个字段。
根据这个字段的值来修改system propertity,其实也就是修改linux的环境变量
persist.service.adb.enable

代码如下
class ServerThread extends Thread {

private static final String TAG = "SystemServer";

private final static boolean INCLUDE_DEMO = false;

private static final int LOG_BOOT_PROGRESS_SYSTEM_RUN = 3010;

private ContentResolver mContentResolver;

private class AdbSettingsObserver extends ContentObserver {

public AdbSettingsObserver() {

super(null);

}

@Override

public void onChange(boolean selfChange) {

boolean enableAdb = (Settings.Secure.getInt(mContentResolver,

Settings.Secure.ADB_ENABLED, 0) > 0);

// setting this secure property will start or stop adbd

SystemProperties.set("persist.service.adb.enable", enableAdb ? "1" : "0");

}

}
复制代码

在linux的启动配置文件init.rc中有这样的配置。
# adbd is controlled by the persist.service.adb.enable system property

service adbd /sbin/adbd

disabled

# adbd on at boot in emulator

on property:ro.kernel.qemu=1

start adbd

on property:persist.service.adb.enable=1

start adbd

on property:persist.service.adb.enable=0

stop adbd
复制代码

从这里我们可以看出来其实设定adb_enabled与否其实就是在控制是否启动adbd这个daemon。

扩展阅读:legacy boot ... hdd password ... 将usb转换为三孔插头 ... 宿舍usb转换成普通插座 ... 宿舍usb逆变器 ... 保密检查usb插拔记录 ... developer options ... micro接口示意图 ... 宿舍usb插座改220v插座 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网