2 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
3 <html><head><title>Python: module telemetry.core.chrome.adb_commands
</title>
4 </head><body bgcolor=
"#f0f0f8">
6 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"heading">
8 <td valign=bottom
> <br>
9 <font color=
"#ffffff" face=
"helvetica, arial"> <br><big><big><strong><a href=
"telemetry.html"><font color=
"#ffffff">telemetry
</font></a>.
<a href=
"telemetry.core.html"><font color=
"#ffffff">core
</font></a>.
<a href=
"telemetry.core.chrome.html"><font color=
"#ffffff">chrome
</font></a>.adb_commands
</strong></big></big></font></td
10 ><td align=right valign=bottom
11 ><font color=
"#ffffff" face=
"helvetica, arial"><a href=
".">index
</a><br><a href=
"../telemetry/core/chrome/adb_commands.py">telemetry/core/chrome/adb_commands.py
</a></font></td></tr></table>
12 <p><tt>Brings
in
Chrome
Android's
android_commands
module,
which
itself
is
a
<br>
13 thin(ish)
wrapper
around
adb.
</tt></p>
15 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
16 <tr bgcolor=
"#aa55cc">
17 <td colspan=
3 valign=bottom
> <br>
18 <font color=
"#ffffff" face=
"helvetica, arial"><big><strong>Modules
</strong></big></font></td></tr>
20 <tr><td bgcolor=
"#aa55cc"><tt> </tt></td><td> </td>
21 <td width=
"100%"><table width=
"100%" summary=
"list"><tr><td width=
"25%" valign=top
><a href=
"pylib.android_commands.html">pylib.android_commands
</a><br>
22 <a href=
"pylib.cmd_helper.html">pylib.cmd_helper
</a><br>
23 </td><td width=
"25%" valign=top
><a href=
"pylib.forwarder.html">pylib.forwarder
</a><br>
24 <a href=
"os.html">os
</a><br>
25 </td><td width=
"25%" valign=top
><a href=
"pylib.ports.html">pylib.ports
</a><br>
26 <a href=
"sys.html">sys
</a><br>
27 </td><td width=
"25%" valign=top
><a href=
"pylib.valgrind_tools.html">pylib.valgrind_tools
</a><br>
28 </td></tr></table></td></tr></table><p>
29 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
30 <tr bgcolor=
"#ee77aa">
31 <td colspan=
3 valign=bottom
> <br>
32 <font color=
"#ffffff" face=
"helvetica, arial"><big><strong>Classes
</strong></big></font></td></tr>
34 <tr><td bgcolor=
"#ee77aa"><tt> </tt></td><td> </td>
36 <dt><font face=
"helvetica, arial"><a href=
"__builtin__.html#object">__builtin__.object
</a>
39 <dt><font face=
"helvetica, arial"><a href=
"telemetry.core.chrome.adb_commands.html#AdbCommands">AdbCommands
</a>
40 </font></dt><dt><font face=
"helvetica, arial"><a href=
"telemetry.core.chrome.adb_commands.html#Forwarder">Forwarder
</a>
45 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
46 <tr bgcolor=
"#ffc8d8">
47 <td colspan=
3 valign=bottom
> <br>
48 <font color=
"#000000" face=
"helvetica, arial"><a name=
"AdbCommands">class
<strong>AdbCommands
</strong></a>(
<a href=
"__builtin__.html#object">__builtin__.object
</a>)
</font></td></tr>
50 <tr bgcolor=
"#ffc8d8"><td rowspan=
2><tt> </tt></td>
51 <td colspan=
2><tt>A
thin
wrapper
around
ADB
<br> </tt></td></tr>
53 <td width=
"100%">Methods defined here:
<br>
54 <dl><dt><a name=
"AdbCommands-Adb"><strong>Adb
</strong></a>(self)
</dt></dl>
56 <dl><dt><a name=
"AdbCommands-CloseApplication"><strong>CloseApplication
</strong></a>(self, package)
</dt><dd><tt>Attempt
to
close
down
the
application,
using
increasing
violence.
<br>
59 package:
Name
of
the
process
to
kill
off,
e.g.
<br>
60 com.google.android.apps.chrome
</tt></dd></dl>
62 <dl><dt><a name=
"AdbCommands-ExtractPid"><strong>ExtractPid
</strong></a>(self, process_name)
</dt><dd><tt>Extracts
Process
Ids
for
a
given
process
name
from
Android
Shell.
<br>
65 process_name:
name
of
the
process
on
the
device.
<br>
68 List
of
all
the
process
ids
(as
strings)
that
match
the
given
name.
<br>
69 If
the
name
of
a
process
exactly
matches
the
given
name,
the
pid
of
<br>
70 that
process
will
be
inserted
to
the
front
of
the
pid
list.
</tt></dd></dl>
72 <dl><dt><a name=
"AdbCommands-FileExistsOnDevice"><strong>FileExistsOnDevice
</strong></a>(self, file_name)
</dt></dl>
74 <dl><dt><a name=
"AdbCommands-Forward"><strong>Forward
</strong></a>(self, local, remote)
</dt></dl>
76 <dl><dt><a name=
"AdbCommands-IsRootEnabled"><strong>IsRootEnabled
</strong></a>(self)
</dt></dl>
78 <dl><dt><a name=
"AdbCommands-KillAll"><strong>KillAll
</strong></a>(self, process)
</dt><dd><tt>Android
version
of
killall,
connected
via
adb.
<br>
81 process:
name
of
the
process
to
kill
off
<br>
84 the
number
of
processess
killed
</tt></dd></dl>
86 <dl><dt><a name=
"AdbCommands-Pull"><strong>Pull
</strong></a>(self, remote, local)
</dt></dl>
88 <dl><dt><a name=
"AdbCommands-Push"><strong>Push
</strong></a>(self, local, remote)
</dt></dl>
90 <dl><dt><a name=
"AdbCommands-RunShellCommand"><strong>RunShellCommand
</strong></a>(self, command, timeout_time
<font color=
"#909090">=
20</font>, log_result
<font color=
"#909090">=False
</font>)
</dt><dd><tt>Send
a
command
to
the
adb
shell
and
return
the
result.
<br>
93 command:
String
containing
the
shell
command
to
send.
Must
not
include
<br>
94 the
single
quotes
as
we
use
them
to
escape
the
whole
command.
<br>
95 timeout_time:
Number
of
seconds
to
wait
for
command
to
respond
before
<br>
96 retrying,
used
by
AdbInterface.SendShellCommand.
<br>
97 log_result:
Boolean
to
indicate
whether
we
should
log
the
result
of
the
<br>
98 shell
command.
<br>
101 list
containing
the
lines
of
output
received
from
running
the
command
</tt></dd></dl>
103 <dl><dt><a name=
"AdbCommands-StartActivity"><strong>StartActivity
</strong></a>(self, package, activity, wait_for_completion
<font color=
"#909090">=False
</font>, action
<font color=
"#909090">='android.intent.action.VIEW'
</font>, category
<font color=
"#909090">=None
</font>, data
<font color=
"#909090">=None
</font>, extras
<font color=
"#909090">=None
</font>, trace_file_name
<font color=
"#909090">=None
</font>)
</dt><dd><tt>Starts
|package|'s
activity
on
the
device.
<br>
106 package:
Name
of
package
to
start
(e.g.
'com.google.android.apps.chrome').
<br>
107 activity:
Name
of
activity
(e.g.
'.Main'
or
<br>
108 'com.google.android.apps.chrome.Main').
<br>
109 wait_for_completion:
wait
for
the
activity
to
finish
launching
(-W
flag).
<br>
110 action:
string
(e.g.
'android.intent.action.MAIN').
Default
is
VIEW.
<br>
111 category:
string
(e.g.
'android.intent.category.HOME')
<br>
112 data:
Data
string
to
pass
to
activity
(e.g.
'
<a href=
"http://www.example.com/">http://www.example.com/
</a>').
<br>
113 extras:
Dict
of
extras
to
pass
to
activity.
Values
are
significant.
<br>
114 trace_file_name:
If
used,
turns
on
and
saves
the
trace
to
this
file
name.
</tt></dd></dl>
116 <dl><dt><a name=
"AdbCommands-__init__"><strong>__init__
</strong></a>(self, device)
</dt></dl>
118 <dl><dt><a name=
"AdbCommands-device"><strong>device
</strong></a>(self)
</dt></dl>
121 Data descriptors defined here:
<br>
122 <dl><dt><strong>__dict__
</strong></dt>
123 <dd><tt>dictionary
for
instance
variables
(if
defined)
</tt></dd>
125 <dl><dt><strong>__weakref__
</strong></dt>
126 <dd><tt>list
of
weak
references
to
the
object
(if
defined)
</tt></dd>
128 </td></tr></table> <p>
129 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
130 <tr bgcolor=
"#ffc8d8">
131 <td colspan=
3 valign=bottom
> <br>
132 <font color=
"#000000" face=
"helvetica, arial"><a name=
"Forwarder">class
<strong>Forwarder
</strong></a>(
<a href=
"__builtin__.html#object">__builtin__.object
</a>)
</font></td></tr>
134 <tr><td bgcolor=
"#ffc8d8"><tt> </tt></td><td> </td>
135 <td width=
"100%">Methods defined here:
<br>
136 <dl><dt><a name=
"Forwarder-Close"><strong>Close
</strong></a>(self)
</dt></dl>
138 <dl><dt><a name=
"Forwarder-__init__"><strong>__init__
</strong></a>(self, adb, *port_pairs)
</dt></dl>
141 Static methods defined here:
<br>
142 <dl><dt><a name=
"Forwarder-KillDevice"><strong>KillDevice
</strong></a>(adb)
</dt></dl>
144 <dl><dt><a name=
"Forwarder-KillHost"><strong>KillHost
</strong></a>()
</dt></dl>
147 Data descriptors defined here:
<br>
148 <dl><dt><strong>__dict__
</strong></dt>
149 <dd><tt>dictionary
for
instance
variables
(if
defined)
</tt></dd>
151 <dl><dt><strong>__weakref__
</strong></dt>
152 <dd><tt>list
of
weak
references
to
the
object
(if
defined)
</tt></dd>
154 <dl><dt><strong>url
</strong></dt>
156 </td></tr></table></td></tr></table><p>
157 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
158 <tr bgcolor=
"#eeaa77">
159 <td colspan=
3 valign=bottom
> <br>
160 <font color=
"#ffffff" face=
"helvetica, arial"><big><strong>Functions
</strong></big></font></td></tr>
162 <tr><td bgcolor=
"#eeaa77"><tt> </tt></td><td> </td>
163 <td width=
"100%"><dl><dt><a name=
"-AllocateTestServerPort"><strong>AllocateTestServerPort
</strong></a>()
</dt></dl>
164 <dl><dt><a name=
"-GetAttachedDevices"><strong>GetAttachedDevices
</strong></a>()
</dt><dd><tt>Returns
a
list
of
attached,
online
android
devices.
<br>
166 If
a
preferred
device
has
been
set
with
ANDROID_SERIAL,
it
will
be
first
in
<br>
167 the
returned
list.
</tt></dd></dl>
168 <dl><dt><a name=
"-GetOutDirectory"><strong>GetOutDirectory
</strong></a>()
</dt></dl>
169 <dl><dt><a name=
"-HasForwarder"><strong>HasForwarder
</strong></a>(buildtype
<font color=
"#909090">=None
</font>)
</dt></dl>
170 <dl><dt><a name=
"-IsAndroidSupported"><strong>IsAndroidSupported
</strong></a>()
</dt></dl>
171 <dl><dt><a name=
"-ResetTestServerPortAllocation"><strong>ResetTestServerPortAllocation
</strong></a>()
</dt></dl>