Android Adb Gadget Driver

45 篇文章 0 订阅
18 篇文章 0 订阅

Android Adb Gadget Driver

Marvell PXA310, Linux kernel 2.6.25


1. adb gadget file: drivers/usb/gadget/android_adb.c


2. Configs need enabled:

CONFIG_USB=y
CONFIG_USB_OTG=y
CONFIG_USB_OHCI_HCD=y
CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_SELECTED=y
CONFIG_USB_COMPOSITE=y
CONFIG_USB_GADGET_PXA3XX_U2D=y
CONFIG_USB_PXA3XX_U2D=y
CONFIG_USB_OTG_PXA3xx_U2D=y
CONFIG_USB_OTG_PXA3XX=y
CONFIG_USB_GADGET_DUALSPEED=y
CONFIG_USB_ADB_GADGET=m


3. Make and generate the module: g_android_adb.ko


4. Install adb gadget: insmod /lib/modules/g_android_adb.ko


5. $ lsusb
Bus 004 Device 009: ID 18d1:dddd 


6. In your host Linux PC (I am using Ubuntu), create a file "/etc/udev/rules.d/50-android.rules " with following contents:
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"

In which, the "18d1 " is the USB device's vendor ID which is hard-coded in android_adb.c . you can change it or not, but if you change, remember to change both the 50-android.rules file and android_adb.c file.

After creating the file, execute command:
$chmod a+rx /etc/udev/rules.d/50-android.rules


7. Now connect your device with your host PC with USB cable, go to "out/host/linux-x86/bin " in your Android source tree directory and execute command:
$./adb devices


You will get:
List of devices attached
0123456789ABCDEF        device

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值