changeset 133:606f521f0e6b

Connect to Android via USB by adb in Windows.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Mon, 09 Oct 2017 11:19:07 +0300
parents 9cff18128a16
children 17625980ea3d
files f56b41cb-6e3a-4da9-a52f-21bfab785c90/index.rst
diffstat 1 files changed, 86 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/f56b41cb-6e3a-4da9-a52f-21bfab785c90/index.rst	Mon Oct 09 11:19:07 2017 +0300
@@ -0,0 +1,86 @@
+==============================================
+ Connect to Android via USB by adb in Windows
+==============================================
+:created: 2017-10-09 10:00
+:updated: 2017-10-09
+:tags: windows, android, adb, driver
+
+Besides official Google phones, which have adb drivers, most of the phones don't have one to make
+connection via USB.
+
+Of couse you can connect by adb via network but that's another story.
+
+So if you are lacky and have official Android device 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
+