# HG changeset patch # User Oleksandr Gavenko # Date 1507533277 -10800 # Node ID 1eedb185a54d8936ebcdcba4005a30294d1ef8e3 # Parent b3653de0f03e2bf4ab98bf2c052f7c35c6245a8a Connect to Android via USB by adb in Windows. diff -r b3653de0f03e -r 1eedb185a54d android.rst --- a/android.rst Sun Oct 08 00:19:47 2017 +0300 +++ b/android.rst Mon Oct 09 10:14:37 2017 +0300 @@ -64,8 +64,8 @@ https://www.clockworkmod.com/ ClockworkMod -Connect to Android via USB by adb. -================================== +Connect to Android via USB by adb in Linux +========================================== Add ``udev`` rule for fix permission issues:: @@ -85,6 +85,83 @@ http://developer.android.com/tools/device.html Setting up a Device for Development. +Connect to Android via USB by adb in Windows +============================================ + +Get latest official Google drivers from: + +https://developer.android.com/studio/run/win-usb.html + Get the Google USB Driver. + +If your device isn't in official list you can try to find driver in `Windows +update catalog at http://www.catalog.update.microsoft.com`__. + +__ http://www.catalog.update.microsoft.com + +Use search by vendor or device name, or string ``adb``. Alternatively use +`hardware id`_. + +BTW older version of official Google drivers are also in `Windows update +catalog`__. + +__ http://www.catalog.update.microsoft.com/Search.aspx?q=google+adb + +Most probably you will fail to find drivers for numerous Chinese/noname Android +devices. We can reuse official Google drivers. To do that: + +.. _hardware id: + +* Find your USB's hardware VID and PID. Locate your device in *Device Manager*, + open Properties => Details => Hardware Ids and copy (by ``Ctrl+C``) string + like:: + + USB\VID_2A45&PID_201D&MI_01 + +* Extract official Google's ADB driver package:: + + unzip latest_usb_driver_windows.zip + +* Locate and modify driver's ``.inf`` file (in my case it was + ``android_winusb.inf``) by adding lines, like:: + + ; Meizu + %SingleAdbInterface% = USB_Install, USB\VID_2A45&PID_201D + %CompositeAdbInterface% = USB_Install, USB\VID_2A45&PID_201D&MI_01 + + to all sections that has similar lines setting your own `hardware id`_ + that we've extracted. + +* Temporary disable driver signing enforcement (run from Administrator, ``Win``, + type ``cmd``, ``Ctrl+Shift+Enter``):: + + cmd# bcdedit /set testsigning off + + and reboot. You'll see ``Test mode`` sign in right lower corner of desktop. + +* Locate your decive, then follow *Properties => Driver => Update => Browse my computer => + Let me pick => Hard Disk...*. Select *Android Composite ADB interface* driver + and ignore security warning about broken file signature. + +* Enable signing checks back:: + + cmd# bcdedit /set testsigning on + + and reboot. Hurrah! + +.. note:: + + As you see Google's adb driver works fine with any Android phone. It's + Microsoft policy to forbid class drivers so each vendor is required to + provide same driver with different hardware ID and to pay money for Windows + Logo® program and signing process. + +.. tip:: + + ``bcdedit`` can be run with alternative options:: + + cmd# bcdedit.exe /set nointegritychecks on + cmd# bcdedit.exe /set nointegritychecks off + Recovery. =========