android.rst
changeset 2187 1eedb185a54d
parent 2121 b6f9485fad08
child 2190 f589976b8876
equal deleted inserted replaced
2186:b3653de0f03e 2187:1eedb185a54d
    62   http://www.cyanogenmod.org/about
    62   http://www.cyanogenmod.org/about
    63     CyanogenMod
    63     CyanogenMod
    64   https://www.clockworkmod.com/
    64   https://www.clockworkmod.com/
    65     ClockworkMod
    65     ClockworkMod
    66 
    66 
    67 Connect to Android via USB by adb.
    67 Connect to Android via USB by adb in Linux
    68 ==================================
    68 ==========================================
    69 
    69 
    70 Add ``udev`` rule for fix permission issues::
    70 Add ``udev`` rule for fix permission issues::
    71 
    71 
    72   $ cat /etc/udev/rules.d/90-android.rules
    72   $ cat /etc/udev/rules.d/90-android.rules
    73 
    73 
    82 
    82 
    83 See:
    83 See:
    84 
    84 
    85   http://developer.android.com/tools/device.html
    85   http://developer.android.com/tools/device.html
    86     Setting up a Device for Development.
    86     Setting up a Device for Development.
       
    87 
       
    88 Connect to Android via USB by adb in Windows
       
    89 ============================================
       
    90 
       
    91 Get latest official Google drivers from:
       
    92 
       
    93 https://developer.android.com/studio/run/win-usb.html
       
    94   Get the Google USB Driver.
       
    95 
       
    96 If your device isn't in official list you can try to find driver in `Windows
       
    97 update catalog at http://www.catalog.update.microsoft.com`__.
       
    98 
       
    99 __ http://www.catalog.update.microsoft.com
       
   100 
       
   101 Use search by vendor or device name, or string ``adb``. Alternatively use
       
   102 `hardware id`_.
       
   103 
       
   104 BTW older version of official Google drivers are also in `Windows update
       
   105 catalog`__.
       
   106 
       
   107 __ http://www.catalog.update.microsoft.com/Search.aspx?q=google+adb
       
   108 
       
   109 Most probably you will fail to find drivers for numerous Chinese/noname Android
       
   110 devices. We can reuse official Google drivers. To do that:
       
   111 
       
   112 .. _hardware id:
       
   113 
       
   114 * Find your USB's hardware VID and PID. Locate your device in *Device Manager*,
       
   115   open Properties => Details => Hardware Ids and copy (by ``Ctrl+C``) string
       
   116   like::
       
   117 
       
   118     USB\VID_2A45&PID_201D&MI_01
       
   119 
       
   120 * Extract official Google's ADB driver package::
       
   121 
       
   122     unzip latest_usb_driver_windows.zip
       
   123 
       
   124 * Locate and modify driver's ``.inf`` file (in my case it was
       
   125   ``android_winusb.inf``) by adding lines, like::
       
   126 
       
   127     ; Meizu
       
   128     %SingleAdbInterface%        = USB_Install, USB\VID_2A45&PID_201D
       
   129     %CompositeAdbInterface%     = USB_Install, USB\VID_2A45&PID_201D&MI_01
       
   130 
       
   131   to all sections that has similar lines setting your own `hardware id`_
       
   132   that we've extracted.
       
   133 
       
   134 * Temporary disable driver signing enforcement (run from Administrator, ``Win``,
       
   135   type ``cmd``, ``Ctrl+Shift+Enter``)::
       
   136 
       
   137     cmd# bcdedit /set testsigning off
       
   138 
       
   139   and reboot. You'll see ``Test mode`` sign in right lower corner of desktop.
       
   140 
       
   141 * Locate your decive, then follow *Properties => Driver => Update => Browse my computer =>
       
   142   Let me pick => Hard Disk...*. Select *Android Composite ADB interface* driver
       
   143   and ignore security warning about broken file signature.
       
   144 
       
   145 * Enable signing checks back::
       
   146 
       
   147     cmd# bcdedit /set testsigning on
       
   148 
       
   149   and reboot. Hurrah!
       
   150 
       
   151 .. note::
       
   152 
       
   153    As you see Google's adb driver works fine with any Android phone. It's
       
   154    Microsoft policy to forbid class drivers so each vendor is required to
       
   155    provide same driver with different hardware ID and to pay money for Windows
       
   156    Logo® program and signing process.
       
   157 
       
   158 .. tip::
       
   159 
       
   160    ``bcdedit`` can be run with alternative options::
       
   161 
       
   162      cmd# bcdedit.exe /set nointegritychecks on
       
   163      cmd# bcdedit.exe /set nointegritychecks off
    87 
   164 
    88 Recovery.
   165 Recovery.
    89 =========
   166 =========
    90 
   167 
    91 To enter phone to recovery mode press ``VolumeDown``+``Power`` button or::
   168 To enter phone to recovery mode press ``VolumeDown``+``Power`` button or::