android.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1856 07eb6c32d9ea
child 1905 fba288d59662
permissions -rw-r--r--
Decrease intent to increase space usage on mobile.
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; -*-
12f6f6b95b7c Add standard header.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1592
diff changeset
     2
.. include:: HEADER.rst
1565
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
==========
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
 Android.
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
==========
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
.. contents::
e59b35de5f28 Controlling Android from PC.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
1573
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
     9
Official docs.
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    10
==============
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    11
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    12
  http://developer.android.com/sdk/index.html
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    13
    Get the Android SDK
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    14
  http://developer.android.com/guide/index.html
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    15
    Introduction to Android
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    16
  https://android.googlesource.com/platform/system/core/+/master/init/readme.txt
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    17
    init.rd file syntax.
1573
e38409881775 Official docs.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1565
diff changeset
    18
1802
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    19
Android API levels.
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    20
===================
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    21
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    22
  http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    23
    "Platform Version / API Level" table.
a49db2d22443 Android API levels.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1743
diff changeset
    24
1695
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    25
Package repositories.
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    26
=====================
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    27
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    28
  https://play.google.com/
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    29
    Google package repository.
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    30
  https://f-droid.org/
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    31
    Free software repository.
1856
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    32
  http://www.appbrain.com/
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    33
    AppBrain, alternative catalog to Google Play. Packages is backed via lisnk
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    34
    to Google Play.
1695
67e3552bd7f6 https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1694
diff changeset
    35
1856
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    36
Link to package description page::
1743
7e0334761f15 Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1742
diff changeset
    37
7e0334761f15 Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1742
diff changeset
    38
  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
    39
1856
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    40
See also:
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    41
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    42
  http://android.stackexchange.com/questions/216/what-are-the-alternative-android-app-markets/
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    43
    What are the alternative Android app markets?
07eb6c32d9ea AppBrain
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1802
diff changeset
    44
1575
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    45
Mods.
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    46
=====
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    47
1576
33d2941a5c73 http://xda-university.com/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1575
diff changeset
    48
  http://xda-university.com/
33d2941a5c73 http://xda-university.com/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1575
diff changeset
    49
    How to mod.
1575
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    50
  http://www.cyanogenmod.org/about
440521afe31e CyanogenMod
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1573
diff changeset
    51
    CyanogenMod
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    52
  https://www.clockworkmod.com/
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    53
    ClockworkMod
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    54
1696
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    55
Connect to Android via USB by adb.
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    56
==================================
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    57
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    58
Add ``udev`` rule for fix permission issues::
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    59
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    60
  $ 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
    61
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    62
  # Standard Google device.
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    63
  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
    64
  # China N101 II
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    65
  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
    66
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    67
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
    68
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    69
  $ sudo service udev force-reload
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    70
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    71
See:
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    72
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    73
  http://developer.android.com/tools/device.html
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    74
    Setting up a Device for Development.
35ab36c1a85e Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1695
diff changeset
    75
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    76
Recovery.
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    77
=========
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    78
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    79
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
    80
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    81
  adb reboot recovery
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    82
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    83
See:
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    84
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    85
  http://teamw.in/project/twrp2
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    86
    Custom recovery built.
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    87
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    88
ADB tips.
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    89
=========
1578
c97cd8248a24 init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1576
diff changeset
    90
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    91
List available devices::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    92
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    93
  $ adb devices
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    94
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    95
Install application from ``.apk`` file::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    96
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    97
  $ adb install -r /path/to/application.apk
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
    98
1592
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
    99
List installed package names (with path to ``.apk`` files!)::
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   100
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   101
  $ adb shell 'pm list packages -f'
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   102
1740
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   103
Uninstall application by its package name::
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   104
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   105
  $ adb uninstall PACKAGE_NAME
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   106
1740
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   107
Disable/enable application::
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   108
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   109
  $ adb shell pm disable PACKAGE_NAME
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   110
  $ adb shell pm enable PACKAGE_NAME
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   111
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   112
List of disabled packages::
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   113
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   114
  $ adb shell pm list packages -d
0d897830a5d3 Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1696
diff changeset
   115
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   116
List currently run activities::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   117
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   118
  $ adb shell 'dumpsys activity'
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   119
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   120
Find activities from package::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   121
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   122
  $ adb shell 'pm list packages -f'
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   123
  $ adb pull APK_FROM_LIST
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   124
  $ aapt dump badging APK_FILE
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   125
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   126
Start an activity::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   127
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   128
  $ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   129
  $ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   130
1741
5c549e75b296 Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1740
diff changeset
   131
Start an activity with action filter::
5c549e75b296 Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1740
diff changeset
   132
5c549e75b296 Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1740
diff changeset
   133
  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
   134
1592
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   135
List of running processes::
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   136
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   137
  $ adb shell ps
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   138
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   139
or (supported arguments
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   140
``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
   141
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   142
  $ adb shell
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   143
  % ps -o pid,user,group,rss,vsz,args
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   144
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   145
To kill process::
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   146
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   147
  $ adb shell ps | grep $REGEX
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   148
  $ adb shell kill $PID
5ebe526dd687 List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1582
diff changeset
   149
1742
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   150
To stop application::
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   151
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   152
  $ adb shell am kill com.google.android.contacts
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   153
  $ adb shell am force-stop com.google.android.contacts
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   154
1582
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   155
Take a screenshort::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   156
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   157
  $ 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
   158
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   159
Power button::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   160
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   161
  $ adb shell input keyevent 26
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   162
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   163
Unlock screen::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   164
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   165
  $ adb shell input keyevent 82
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   166
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   167
Show system log::
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   168
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   169
  $ adb logcat
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   170
  $ adb logcat "*:W"
1551e7edcfa0 ADB tips.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1578
diff changeset
   171
1742
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   172
List partition.
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   173
===============
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   174
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   175
List partitions (with sizes)::
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   176
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   177
  android# cat /proc/partitions
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   178
  android# cat /proc/mtd
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   179
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   180
List mounted file systems::
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   181
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   182
  android# mount
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   183
  android# df
ca6335f9471f List partition.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1741
diff changeset
   184
1694
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   185
Controlling Android from PC.
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   186
============================
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   187
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   188
 * http://code.google.com/p/androidscreencast/
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   189
 * http://code.google.com/p/android-screen-monitor/
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   190
 * http://androidwebkey.com/
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   191
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   192
Show screencast from Android.
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   193
=============================
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   194
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   195
  http://droid-at-screen.ribomation.com/
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   196
                Easily show the screen of an Android device on a computer/laptop
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   197
                (PC, Mac, Linux, ...) and then project the desktop using a
46dd85e3d6c6 Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1669
diff changeset
   198
                LCD-projector.