android.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 18 Dec 2020 18:20:15 +0200
changeset 2474 cc7945bce35e
parent 2254 b01b5f568c5a
child 2487 3554b388e7a2
permissions -rw-r--r--
Using self-managed SSL certificates.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1669
12f6f6b95b7c Add standard header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1592
diff changeset
     1
.. -*- coding: utf-8; -*-
1565
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
==========
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
 Android.
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
==========
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
.. contents::
1905
fba288d59662 Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1856
diff changeset
     7
   :local:
1565
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
2192
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
     9
Official docs
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    10
=============
1573
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    11
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    12
http://developer.android.com/sdk/index.html
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    13
  Get the Android SDK
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    14
http://developer.android.com/guide/index.html
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    15
  Introduction to Android
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    16
https://android.googlesource.com/platform/system/core/+/master/init/readme.txt
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    17
  init.rd file syntax.
1573
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    18
2192
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    19
Getting tools
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    20
=============
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    21
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    22
https://developer.android.com/studio/releases/platform-tools.html
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    23
  SDK Platform Tools (includes adb and fastboot) download and rellease
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    24
  changelog.
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    25
https://developer.android.com/studio/index.html
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    26
  Android Studio (official IDE for Android) and sdk-tools (includes ``sdkmanager``).
8aab56aeb0b8 Getting tools.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2190
diff changeset
    27
2193
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    28
Android emulator
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    29
================
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    30
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    31
Intel provided images and hypervisor to run x86 Android port with acceleration:
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    32
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    33
https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    34
  IntelĀ® Hardware Accelerated Execution Manager (IntelĀ® HAXM). It is available from SDK manager
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    35
  also.
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    36
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    37
It starts service. To manage service use::
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    38
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    39
  sc stop intelhaxm
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    40
  sc start intelhaxm
493d19cc34e1 Android emulator.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2192
diff changeset
    41
2121
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    42
Android stats
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    43
=============
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    44
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    45
CPU::
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    46
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    47
  $ cat /proc/cpuinfo
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    48
  $ cat /proc/cpufreq/cpufreq_freq
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    49
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    50
Memory::
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    51
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    52
  $ cat /proc/meminfo
b6f9485fad08 Android stats.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2051
diff changeset
    53
1802
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    54
Android API levels.
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    55
===================
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    56
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    57
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    58
  "Platform Version / API Level" table.
1802
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    59
1695
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    60
Package repositories.
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    61
=====================
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    62
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    63
https://play.google.com/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    64
  Google package repository.
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    65
https://f-droid.org/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    66
  Free software repository.
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    67
http://www.appbrain.com/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    68
  AppBrain, alternative catalog to Google Play. Packages is backed via lisnk
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    69
  to Google Play.
1695
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    70
1856
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    71
Link to package description page::
1743
7e0334761f15 Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1742
diff changeset
    72
7e0334761f15 Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1742
diff changeset
    73
  https://play.google.com/store/apps/details?id=com.google.android.talk
7e0334761f15 Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1742
diff changeset
    74
1856
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    75
See also:
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    76
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    77
http://android.stackexchange.com/questions/216/what-are-the-alternative-android-app-markets/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    78
  What are the alternative Android app markets?
1856
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    79
1575
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    80
Mods.
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    81
=====
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    82
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    83
http://xda-university.com/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    84
  How to mod.
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    85
http://www.cyanogenmod.org/about
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    86
  CyanogenMod
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    87
https://www.clockworkmod.com/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
    88
  ClockworkMod
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    89
2187
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
    90
Connect to Android via USB by adb in Linux
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
    91
==========================================
1696
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    92
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    93
Add ``udev`` rule for fix permission issues::
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    94
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    95
  $ cat /etc/udev/rules.d/90-android.rules
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    96
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    97
  # Standard Google device.
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    98
  SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c03", MODE="0666", GROUP="plugdev"
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    99
  # China N101 II
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   100
  SUBSYSTEM=="usb", ATTR{idVendor}=="2207", ATTR{idProduct}=="0010", MODE="0666", GROUP="plugdev"
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   101
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   102
Reload udev rules and re-plug device via USB::
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   103
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   104
  $ sudo service udev force-reload
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   105
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   106
See:
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   107
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   108
http://developer.android.com/tools/device.html
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   109
  Setting up a Device for Development.
1696
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
   110
2187
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   111
Connect to Android via USB by adb in Windows
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   112
============================================
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   113
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   114
Get latest official Google drivers from:
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   115
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   116
https://developer.android.com/studio/run/win-usb.html
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   117
  Get the Google USB Driver.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   118
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   119
If your device isn't in official list you can try to find driver in `Windows
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   120
update catalog at http://www.catalog.update.microsoft.com`__.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   121
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   122
__ http://www.catalog.update.microsoft.com
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   123
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   124
Use search by vendor or device name, or string ``adb``. Alternatively use
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   125
`hardware id`_.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   126
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   127
BTW older version of official Google drivers are also in `Windows update
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   128
catalog`__.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   129
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   130
__ http://www.catalog.update.microsoft.com/Search.aspx?q=google+adb
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   131
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   132
Most probably you will fail to find drivers for numerous Chinese/noname Android
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   133
devices. We can reuse official Google drivers. To do that:
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   134
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   135
.. _hardware id:
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   136
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   137
* Find your USB's hardware VID and PID. Locate your device in *Device Manager*,
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   138
  open Properties => Details => Hardware Ids and copy (by ``Ctrl+C``) string
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   139
  like::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   140
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   141
    USB\VID_2A45&PID_201D&MI_01
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   142
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   143
* Extract official Google's ADB driver package::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   144
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   145
    unzip latest_usb_driver_windows.zip
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   146
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   147
* Locate and modify driver's ``.inf`` file (in my case it was
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   148
  ``android_winusb.inf``) by adding lines, like::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   149
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   150
    ; Meizu
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   151
    %SingleAdbInterface%        = USB_Install, USB\VID_2A45&PID_201D
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   152
    %CompositeAdbInterface%     = USB_Install, USB\VID_2A45&PID_201D&MI_01
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   153
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   154
  to all sections that has similar lines setting your own `hardware id`_
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   155
  that we've extracted.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   156
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   157
* Temporary disable driver signing enforcement (run from Administrator, ``Win``,
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   158
  type ``cmd``, ``Ctrl+Shift+Enter``)::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   159
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   160
    cmd# bcdedit /set testsigning off
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   161
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   162
  and reboot. You'll see ``Test mode`` sign in right lower corner of desktop.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   163
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   164
* Locate your decive, then follow *Properties => Driver => Update => Browse my computer =>
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   165
  Let me pick => Hard Disk...*. Select *Android Composite ADB interface* driver
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   166
  and ignore security warning about broken file signature.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   167
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   168
* Enable signing checks back::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   169
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   170
    cmd# bcdedit /set testsigning on
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   171
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   172
  and reboot. Hurrah!
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   173
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   174
.. note::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   175
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   176
   As you see Google's adb driver works fine with any Android phone. It's
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   177
   Microsoft policy to forbid class drivers so each vendor is required to
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   178
   provide same driver with different hardware ID and to pay money for Windows
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   179
   LogoĀ® program and signing process.
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   180
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   181
.. tip::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   182
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   183
   ``bcdedit`` can be run with alternative options::
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   184
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   185
     cmd# bcdedit.exe /set nointegritychecks on
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   186
     cmd# bcdedit.exe /set nointegritychecks off
1eedb185a54d Connect to Android via USB by adb in Windows.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2121
diff changeset
   187
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   188
Recovery.
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   189
=========
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   190
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   191
To enter phone to recovery mode press ``VolumeDown``+``Power`` button or::
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   192
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   193
  adb reboot recovery
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   194
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   195
See:
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   196
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   197
http://teamw.in/project/twrp2
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   198
  Custom recovery built.
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   199
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   200
ADB tips.
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   201
=========
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
   202
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   203
List available devices::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   204
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   205
  $ adb devices
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   206
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   207
Install application from ``.apk`` file::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   208
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   209
  $ adb install -r /path/to/application.apk
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   210
1592
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   211
List installed package names (with path to ``.apk`` files!)::
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   212
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   213
  $ adb shell 'pm list packages -f'
2254
b01b5f568c5a adb shell'cmd package list packages
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2228
diff changeset
   214
  $ adb shell 'cmd package list packages -f'
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   215
1740
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   216
Uninstall application by its package name::
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   217
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   218
  $ adb uninstall PACKAGE_NAME
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   219
1740
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   220
Disable/enable application::
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   221
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   222
  $ adb shell pm disable PACKAGE_NAME
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   223
  $ adb shell pm enable PACKAGE_NAME
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   224
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   225
List of disabled packages::
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   226
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   227
  $ adb shell pm list packages -d
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   228
2051
b517b191156b List of application properties (version, permissions, etc).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2046
diff changeset
   229
List of application properties (version, permissions, etc)::
b517b191156b List of application properties (version, permissions, etc).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2046
diff changeset
   230
b517b191156b List of application properties (version, permissions, etc).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2046
diff changeset
   231
  $ adb shell dumpsys package $PKG
b517b191156b List of application properties (version, permissions, etc).
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2046
diff changeset
   232
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   233
List currently run activities::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   234
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   235
  $ adb shell 'dumpsys activity'
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   236
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   237
Find activities from package::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   238
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   239
  $ adb shell 'pm list packages -f'
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   240
  $ adb pull APK_FROM_LIST
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   241
  $ aapt dump badging APK_FILE
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   242
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   243
Start an activity::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   244
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   245
  $ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   246
  $ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   247
1741
5c549e75b296 Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1740
diff changeset
   248
Start an activity with action filter::
5c549e75b296 Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1740
diff changeset
   249
5c549e75b296 Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1740
diff changeset
   250
  android# am start -a com.example.ACTION_NAME -n com.package.name/com.package.name.ActivityName
5c549e75b296 Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1740
diff changeset
   251
1592
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   252
List of running processes::
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   253
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   254
  $ adb shell ps
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   255
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   256
or (supported arguments
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   257
``user,group,comm,args,pid,ppid,pgid,etime,nice,rgroup,ruser,time,tty,vsz,stat,rss``)::
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   258
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   259
  $ adb shell
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   260
  % ps -o pid,user,group,rss,vsz,args
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   261
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   262
To kill process::
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   263
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   264
  $ adb shell ps | grep $REGEX
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   265
  $ adb shell kill $PID
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   266
1742
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   267
To stop application::
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   268
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   269
  $ adb shell am kill com.google.android.contacts
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   270
  $ adb shell am force-stop com.google.android.contacts
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   271
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   272
Take a screenshort::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   273
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   274
  $ adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   275
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   276
Power button::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   277
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   278
  $ adb shell input keyevent 26
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   279
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   280
Unlock screen::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   281
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   282
  $ adb shell input keyevent 82
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   283
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   284
Show system log::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   285
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   286
  $ adb logcat
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   287
  $ adb logcat "*:W"
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   288
1946
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   289
dumpsys
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   290
=======
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   291
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   292
Info from all services::
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   293
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   294
  $ adb shell dumpsys
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   295
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   296
List of available services::
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   297
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   298
  $ adb shell service list
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   299
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   300
Info from concrete service::
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   301
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   302
  $ adb shell dumpsys phone
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   303
  $ adb shell dumpsys diskstats
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   304
  $ adb shell dumpsys usb
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   305
  $ adb shell dumpsys activity
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   306
  $ adb shell dumpsys package
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   307
  $ adb shell dumpsys display
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   308
  $ adb shell dumpsys gfxinfo
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   309
  $ adb shell dumpsys power
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   310
  $ adb shell dumpsys battery
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   311
  $ adb shell dumpsys batteryinfo
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   312
  $ adb shell dumpsys cpuinfo
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   313
  $ adb shell dumpsys dbinfo
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   314
  $ adb shell dumpsys meminfo
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   315
  $ adb shell dumpsys account
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   316
  $ adb shell dumpsys netstats
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   317
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   318
* https://source.android.com/devices/tech/debug/dumpsys.html
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   319
* http://stackoverflow.com/questions/11201659/whats-the-android-adb-shell-dumpsys-tool-and-what-are-its-benefits
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   320
1742
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   321
List partition.
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   322
===============
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   323
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   324
List partitions (with sizes)::
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   325
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   326
  android# cat /proc/partitions
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   327
  android# cat /proc/mtd
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   328
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   329
List mounted file systems::
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   330
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   331
  android# mount
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   332
  android# df
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   333
1946
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   334
Remount /system as RW
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   335
=====================
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   336
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   337
Usually with::
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   338
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   339
  $ adb remount
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   340
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   341
If you have root but above command fail::
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   342
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   343
  $ adb shell
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   344
  android# su
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   345
  android# mount | grep /system
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   346
  ...
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   347
  android# mount -o remount,rw /system
d10215ae7eaa dumpsys
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
   348
2046
ea76b2532bcd Getting package name, version, API requirements and permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1946
diff changeset
   349
Working with apk files
ea76b2532bcd Getting package name, version, API requirements and permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1946
diff changeset
   350
======================
ea76b2532bcd Getting package name, version, API requirements and permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1946
diff changeset
   351
ea76b2532bcd Getting package name, version, API requirements and permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1946
diff changeset
   352
Getting package name, version, API requirements and permissions::
ea76b2532bcd Getting package name, version, API requirements and permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1946
diff changeset
   353
ea76b2532bcd Getting package name, version, API requirements and permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1946
diff changeset
   354
  $ aapt dump badging $FILE.apk
ea76b2532bcd Getting package name, version, API requirements and permissions.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1946
diff changeset
   355
1694
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   356
Controlling Android from PC.
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   357
============================
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   358
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2193
diff changeset
   359
* http://code.google.com/p/androidscreencast/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2193
diff changeset
   360
* http://code.google.com/p/android-screen-monitor/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2193
diff changeset
   361
* http://androidwebkey.com/
1694
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   362
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   363
Show screencast from Android.
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   364
=============================
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   365
2190
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   366
http://droid-at-screen.org/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   367
  Easily show the screen of an Android device on a computer/laptop (PC, Mac,
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   368
  Linux, ...) and then project the desktop using a LCD-projector.
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   369
http://droid-at-screen.ribomation.com/
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   370
  Old DNS name.
f589976b8876 Reindent RST code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2187
diff changeset
   371