author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 03 Oct 2015 18:29:10 +0300 | |
changeset 1765 | 2132765de2f4 |
parent 1743 | 7e0334761f15 |
child 1802 | a49db2d22443 |
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 |
|
1743
7e0334761f15
Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1742
diff
changeset
|
27 |
Link to package description page: |
7e0334761f15
Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1742
diff
changeset
|
28 |
|
7e0334761f15
Link to package description page.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1742
diff
changeset
|
29 |
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
|
30 |
|
1575 | 31 |
Mods. |
32 |
===== |
|
33 |
||
1576
33d2941a5c73
http://xda-university.com/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1575
diff
changeset
|
34 |
http://xda-university.com/ |
33d2941a5c73
http://xda-university.com/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1575
diff
changeset
|
35 |
How to mod. |
1575 | 36 |
http://www.cyanogenmod.org/about |
37 |
CyanogenMod |
|
1578
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
38 |
https://www.clockworkmod.com/ |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
39 |
ClockworkMod |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
40 |
|
1696
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
41 |
Connect to Android via USB by adb. |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
42 |
================================== |
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 |
Add ``udev`` rule for fix permission issues:: |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
45 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
46 |
$ 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
|
47 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
48 |
# Standard Google device. |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
49 |
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
|
50 |
# China N101 II |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
51 |
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
|
52 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
53 |
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
|
54 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
55 |
$ sudo service udev force-reload |
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 |
See: |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
58 |
|
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
59 |
http://developer.android.com/tools/device.html |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
60 |
Setting up a Device for Development. |
35ab36c1a85e
Connect to Android via USB by adb.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1695
diff
changeset
|
61 |
|
1578
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
62 |
Recovery. |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
63 |
========= |
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 |
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
|
66 |
|
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
67 |
adb reboot recovery |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
68 |
|
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
69 |
See: |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
70 |
|
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
71 |
http://teamw.in/project/twrp2 |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
72 |
Custom recovery built. |
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
73 |
|
1582 | 74 |
ADB tips. |
75 |
========= |
|
1578
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
76 |
|
1582 | 77 |
List available devices:: |
78 |
||
79 |
$ adb devices |
|
80 |
||
81 |
Install application from ``.apk`` file:: |
|
82 |
||
83 |
$ adb install -r /path/to/application.apk |
|
84 |
||
1592
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
85 |
List installed package names (with path to ``.apk`` files!):: |
1582 | 86 |
|
87 |
$ adb shell 'pm list packages -f' |
|
88 |
||
1740
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
89 |
Uninstall application by its package name:: |
1582 | 90 |
|
91 |
$ adb uninstall PACKAGE_NAME |
|
92 |
||
1740
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
93 |
Disable/enable application:: |
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
94 |
|
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
95 |
$ adb shell pm disable PACKAGE_NAME |
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
96 |
$ adb shell pm enable PACKAGE_NAME |
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
97 |
|
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
98 |
List of disabled packages:: |
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
99 |
|
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
100 |
$ adb shell pm list packages -d |
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
101 |
|
1582 | 102 |
List currently run activities:: |
103 |
||
104 |
$ adb shell 'dumpsys activity' |
|
105 |
||
106 |
Find activities from package:: |
|
107 |
||
108 |
$ adb shell 'pm list packages -f' |
|
109 |
$ adb pull APK_FROM_LIST |
|
110 |
$ aapt dump badging APK_FILE |
|
111 |
||
112 |
Start an activity:: |
|
113 |
||
114 |
$ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE |
|
115 |
$ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY |
|
116 |
||
1741
5c549e75b296
Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1740
diff
changeset
|
117 |
Start an activity with action filter:: |
5c549e75b296
Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1740
diff
changeset
|
118 |
|
5c549e75b296
Start an activity with action filter.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1740
diff
changeset
|
119 |
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
|
120 |
|
1592
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
121 |
List of running processes:: |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
122 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
123 |
$ adb shell ps |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
124 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
125 |
or (supported arguments |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
126 |
``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
|
127 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
128 |
$ adb shell |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
129 |
% ps -o pid,user,group,rss,vsz,args |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
130 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
131 |
To kill process:: |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
132 |
|
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
133 |
$ adb shell ps | grep $REGEX |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
134 |
$ adb shell kill $PID |
5ebe526dd687
List of running processes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1582
diff
changeset
|
135 |
|
1742 | 136 |
To stop application:: |
137 |
||
138 |
$ adb shell am kill com.google.android.contacts |
|
139 |
$ adb shell am force-stop com.google.android.contacts |
|
140 |
||
1582 | 141 |
Take a screenshort:: |
142 |
||
143 |
$ adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png |
|
144 |
||
145 |
Power button:: |
|
146 |
||
147 |
$ adb shell input keyevent 26 |
|
148 |
||
149 |
Unlock screen:: |
|
150 |
||
151 |
$ adb shell input keyevent 82 |
|
152 |
||
153 |
Show system log:: |
|
154 |
||
155 |
$ adb logcat |
|
156 |
$ adb logcat "*:W" |
|
157 |
||
1742 | 158 |
List partition. |
159 |
=============== |
|
160 |
||
161 |
List partitions (with sizes):: |
|
162 |
||
163 |
android# cat /proc/partitions |
|
164 |
android# cat /proc/mtd |
|
165 |
||
166 |
List mounted file systems:: |
|
167 |
||
168 |
android# mount |
|
169 |
android# df |
|
170 |
||
1694
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
171 |
Controlling Android from PC. |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
172 |
============================ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
173 |
|
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
174 |
* http://code.google.com/p/androidscreencast/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
175 |
* http://code.google.com/p/android-screen-monitor/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
176 |
* http://androidwebkey.com/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
177 |
|
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
178 |
Show screencast from Android. |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
179 |
============================= |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
180 |
|
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
181 |
http://droid-at-screen.ribomation.com/ |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
182 |
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
|
183 |
(PC, Mac, Linux, ...) and then project the desktop using a |
46dd85e3d6c6
Move important info higher.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1669
diff
changeset
|
184 |
LCD-projector. |