星期五, 三月 26, 2010

another way to make offline adb devices to online

is to disable USB debugging of the connected X10 mini first, and then re-enable it by unchecking and checking the USB debugging checkbox on X10 mini settings...

搞定索爱Sony Ericsson XPERIA X10 mini连接Windows Vista进行开发和调试的usb driver问题

折腾了一周,终于对索爱XPERIA X10 mini的这款原型机连接PC进行开发和调试的问题有了一个初步的结论。记于此。 /After more than a week, I finally get the usb driver of Sony Ericsson XPERIA X10 mini prototype work with connected to laptop PC to develop or debug using adb, etc.
 
环境:/Environment:
1. windows vista
2. Sony Ericsson XPERIA X10 mini (prototype)
 
现象:/Phenomenon:
1. 开启X10 miniUSB debugging /Turn on USB debugging of X10 mini
2. micro USB连接线连接到PC /Connect it to PC with micro USB wireline
3. PCwindows vista提示无法安装驱动 /Windows vista will prompt a dialog to say no driver for it
4. 手工选择驱动目录到android SDKusb_driver目录 /Manually choose usb_driver directory of android SDK to install driver
5. 仍然无法搜索到合适的驱动 /Cannot find proper driver either
 
工具:/Tools:
1. android SDK
2. usbdeview
 
尝试失败的解决方法:/Failed approach ever tried:
1. 从某帖子提供的链接下载X10.zip,这个驱动也无法安装 /Download X10.zip from somewhere and it still doesn't work.
 
解决:/Solution:
1. 连接X10 mini /Connect X10 mini to PC
2. usbdeview (以管理员身份运行),查看其VendorIDProductID。例如0fced137 /Open usbdeview as administrator to note the VendorID and ProductID of X10 mini
3. 修改android SDKusb_driver目录中的android_winusb.inf /Modify file android_winusb.inf in usb_driver directory of android SDK
在[Google.NTx86]段和[Google.NTamd64]段都加入: /Add the following lines to both section [Google.NTx86] and [Google.NTamd64]:
; Sony Ericsson Xperia X10 mini
%SingleAdbInterface%        = USB_Install, USB\VID_0FCE&PID_D137
%CompositeAdbInterface%     = USB_Install, USB\VID_0FCE&PID_D137&MI_01
4. 拔下micro USB。重新插入 /Unplug micro USB. Replug it.
5. 手工选择驱动目录到android SDKusb_driver目录 /Manually choose usb_driver directory of android SDK to install driver
6. windows vista搜索到驱动。安装之。(如果还是找不到,那么把上面的MI_01改成MI_00再重试一下)/Windows vista will find the driver and install. (If it wouldn't, change MI_01 to MI_00 in android_winusb.inf and try again)
7. 可以了。用Android SDK提供的adb工具查看 /Get it! Use adb to check it
> tools\adb.exe devices
List of devices attached
CB511G4ANE      devices
 
遗留问题:/Remaining problems:
1. 连接后不久就会自行offline(时间不固定)。不知道是不是因为驱动不够稳定/兼容。/Sometimes after the connection, it will go offline. I'm not sure if it's because of the not so good compatible driver.
临时性的解决方案就是重插USB线。还不行就拔线后用usbdeview删除驱动然后再重插。/The temporary solution is to replug the micro USB wireline. If it doesn't work, unplug, uninstall drivers using usbdeview, and replug.
2. USB Mass storage不正常。插入的microSD卡不能被exportPC的磁盘来访问。 /USB Mass storage cannot be used. microSD card of X10 mini cannot be exported to PC disk for accessing.
 
Tip: 关于inf文件 / About inf file
最关键的文件就是安装到 C:\Windows\inf\oemNNN.inf的这个文件。NNN=数字。/The key file is C:\Windows\inf\oemNNN.inf , where NNN is a number.
在安装驱动之后还可以修改这个文件。不重启机器而使修改生效的方法是: /After driver installation, we can modify this file. The way to modify it and make it take effect without rebooting windows is as follows:
1. 拷贝一个备份。修改备份。/Copy the inf file to your desktop
2. 把修改后的备份拷贝回inf目录,覆盖原来的文件。/Modify. Copy the modified inf back to the inf dir, and replace the old one.
3. 拔下micro USB线 /Unplug micro USB wireline.
4. usbdeview删除所有VendorID=0fce的条目(使用uninstall driver)。/Open usbdeview. Uninstall all drivers with VendorID=0fce for example.
5. 重新插入micro USB线。 /Replug micro USB.
6. windows vista会根据新inf安装驱动。/Windows vista will reinstall the drivers based on the modified inf file.
 
Enjoy!