author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Wed, 11 Mar 2015 22:09:00 +0200 | |
changeset 1697 | f41d35f4af39 |
parent 1696 | 35ab36c1a85e |
child 1740 | 0d897830a5d3 |
permissions | -rw-r--r-- |
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 | 9 |
Official docs. |
10 |
============== |
|
11 |
||
12 |
http://developer.android.com/sdk/index.html |
|
13 |
Get the Android SDK |
|
14 |
http://developer.android.com/guide/index.html |
|
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 | 18 |
|
1695
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
19 |
Package repositories. |
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
20 |
===================== |
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
21 |
|
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
22 |
https://play.google.com/ |
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
23 |
Google package repository. |
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
24 |
https://f-droid.org/ |
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
25 |
Free software repository. |
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
26 |
|
1575 | 27 |
Mods. |
28 |
===== |
|
29 |
||
1576
33d2941a5c73
http://xda-university.com/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1575
diff
changeset
|
30 |
http://xda-university.com/ |
33d2941a5c73
http://xda-university.com/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1575
diff
changeset
|
31 |
How to mod. |
1575 | 32 |
http://www.cyanogenmod.org/about |
33 |
CyanogenMod |
|
1578
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
34 |
https://www.clockworkmod.com/ |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
35 |
ClockworkMod |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
36 |
|
1696
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
37 |
Connect to Android via USB by adb. |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
38 |
================================== |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
39 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
40 |
Add ``udev`` rule for fix permission issues:: |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
41 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
42 |
$ 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
|
43 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
44 |
# Standard Google device. |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
45 |
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
|
46 |
# China N101 II |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
47 |
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
|
48 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
49 |
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
|
50 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
51 |
$ sudo service udev force-reload |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
52 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
53 |
See: |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
54 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
55 |
http://developer.android.com/tools/device.html |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
56 |
Setting up a Device for Development. |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
57 |
|
1578
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
58 |
Recovery. |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
59 |
========= |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
60 |
|
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
61 |
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
|
62 |
|
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
63 |
adb reboot recovery |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
64 |
|
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
65 |
See: |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
66 |
|
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
67 |
http://teamw.in/project/twrp2 |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
68 |
Custom recovery built. |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
69 |
|
1582 | 70 |
ADB tips. |
71 |
========= |
|
1578
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
72 |
|
1582 | 73 |
List available devices:: |
74 |
||
75 |
$ adb devices |
|
76 |
||
77 |
Install application from ``.apk`` file:: |
|
78 |
||
79 |
$ adb install -r /path/to/application.apk |
|
80 |
||
1592
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
81 |
List installed package names (with path to ``.apk`` files!):: |
1582 | 82 |
|
83 |
$ adb shell 'pm list packages -f' |
|
84 |
||
85 |
Uninstall application by it name:: |
|
86 |
||
87 |
$ adb uninstall PACKAGE_NAME |
|
88 |
||
89 |
List currently run activities:: |
|
90 |
||
91 |
$ adb shell 'dumpsys activity' |
|
92 |
||
93 |
Find activities from package:: |
|
94 |
||
95 |
$ adb shell 'pm list packages -f' |
|
96 |
$ adb pull APK_FROM_LIST |
|
97 |
$ aapt dump badging APK_FILE |
|
98 |
||
99 |
Start an activity:: |
|
100 |
||
101 |
$ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE |
|
102 |
$ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY |
|
103 |
||
1592
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
104 |
List of running processes:: |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
105 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
106 |
$ adb shell ps |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
107 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
108 |
or (supported arguments |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
109 |
``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
|
110 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
111 |
$ adb shell |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
112 |
% ps -o pid,user,group,rss,vsz,args |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
113 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
114 |
To kill process:: |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
115 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
116 |
$ adb shell ps | grep $REGEX |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
117 |
$ adb shell kill $PID |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
118 |
|
1582 | 119 |
Take a screenshort:: |
120 |
||
121 |
$ adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png |
|
122 |
||
123 |
Power button:: |
|
124 |
||
125 |
$ adb shell input keyevent 26 |
|
126 |
||
127 |
Unlock screen:: |
|
128 |
||
129 |
$ adb shell input keyevent 82 |
|
130 |
||
131 |
Show system log:: |
|
132 |
||
133 |
$ adb logcat |
|
134 |
$ adb logcat "*:W" |
|
135 |
||
1694
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
136 |
Controlling Android from PC. |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
137 |
============================ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
138 |
|
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
139 |
* http://code.google.com/p/androidscreencast/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
140 |
* http://code.google.com/p/android-screen-monitor/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
141 |
* http://androidwebkey.com/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
142 |
|
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
143 |
Show screencast from Android. |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
144 |
============================= |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
145 |
|
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
146 |
http://droid-at-screen.ribomation.com/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
147 |
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
|
148 |
(PC, Mac, Linux, ...) and then project the desktop using a |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
149 |
LCD-projector. |