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-- |
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 |
|
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 | 32 |
http://www.appbrain.com/ |
33 |
AppBrain, alternative catalog to Google Play. Packages is backed via lisnk |
|
34 |
to Google Play. |
|
1695
67e3552bd7f6
https://f-droid.org/
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1694
diff
changeset
|
35 |
|
1856 | 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 | 40 |
See also: |
41 |
||
42 |
http://android.stackexchange.com/questions/216/what-are-the-alternative-android-app-markets/ |
|
43 |
What are the alternative Android app markets? |
|
44 |
||
1575 | 45 |
Mods. |
46 |
===== |
|
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 | 50 |
http://www.cyanogenmod.org/about |
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 | 88 |
ADB tips. |
89 |
========= |
|
1578
c97cd8248a24
init.rd file syntax.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1576
diff
changeset
|
90 |
|
1582 | 91 |
List available devices:: |
92 |
||
93 |
$ adb devices |
|
94 |
||
95 |
Install application from ``.apk`` file:: |
|
96 |
||
97 |
$ adb install -r /path/to/application.apk |
|
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 | 100 |
|
101 |
$ adb shell 'pm list packages -f' |
|
102 |
||
1740
0d897830a5d3
Disable/enable application.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
1696
diff
changeset
|
103 |
Uninstall application by its package name:: |
1582 | 104 |
|
105 |
$ adb uninstall PACKAGE_NAME |
|
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 | 116 |
List currently run activities:: |
117 |
||
118 |
$ adb shell 'dumpsys activity' |
|
119 |
||
120 |
Find activities from package:: |
|
121 |
||
122 |
$ adb shell 'pm list packages -f' |
|
123 |
$ adb pull APK_FROM_LIST |
|
124 |
$ aapt dump badging APK_FILE |
|
125 |
||
126 |
Start an activity:: |
|
127 |
||
128 |
$ adb shell am start PACKAGE_NAME/ACTIVITY_IN_PACKAGE |
|
129 |
$ adb shell am start PACKAGE_NAME/FULLY_QUALIFIED_ACTIVITY |
|
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 | 150 |
To stop application:: |
151 |
||
152 |
$ adb shell am kill com.google.android.contacts |
|
153 |
$ adb shell am force-stop com.google.android.contacts |
|
154 |
||
1582 | 155 |
Take a screenshort:: |
156 |
||
157 |
$ adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png |
|
158 |
||
159 |
Power button:: |
|
160 |
||
161 |
$ adb shell input keyevent 26 |
|
162 |
||
163 |
Unlock screen:: |
|
164 |
||
165 |
$ adb shell input keyevent 82 |
|
166 |
||
167 |
Show system log:: |
|
168 |
||
169 |
$ adb logcat |
|
170 |
$ adb logcat "*:W" |
|
171 |
||
1742 | 172 |
List partition. |
173 |
=============== |
|
174 |
||
175 |
List partitions (with sizes):: |
|
176 |
||
177 |
android# cat /proc/partitions |
|
178 |
android# cat /proc/mtd |
|
179 |
||
180 |
List mounted file systems:: |
|
181 |
||
182 |
android# mount |
|
183 |
android# df |
|
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. |