shaka-packager/tools/telemetry/docs/telemetry.core.chrome.adb_c...

173 lines
11 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.core.chrome.adb_commands</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<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
><td align=right valign=bottom
><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>
<p><tt>Brings&nbsp;in&nbsp;Chrome&nbsp;Android's&nbsp;android_commands&nbsp;module,&nbsp;which&nbsp;itself&nbsp;is&nbsp;a<br>
thin(ish)&nbsp;wrapper&nbsp;around&nbsp;adb.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<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>
<a href="pylib.cmd_helper.html">pylib.cmd_helper</a><br>
</td><td width="25%" valign=top><a href="pylib.forwarder.html">pylib.forwarder</a><br>
<a href="os.html">os</a><br>
</td><td width="25%" valign=top><a href="pylib.ports.html">pylib.ports</a><br>
<a href="sys.html">sys</a><br>
</td><td width="25%" valign=top><a href="pylib.valgrind_tools.html">pylib.valgrind_tools</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.core.chrome.adb_commands.html#AdbCommands">AdbCommands</a>
</font></dt><dt><font face="helvetica, arial"><a href="telemetry.core.chrome.adb_commands.html#Forwarder">Forwarder</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<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>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>A&nbsp;thin&nbsp;wrapper&nbsp;around&nbsp;ADB<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AdbCommands-Adb"><strong>Adb</strong></a>(self)</dt></dl>
<dl><dt><a name="AdbCommands-CloseApplication"><strong>CloseApplication</strong></a>(self, package)</dt><dd><tt>Attempt&nbsp;to&nbsp;close&nbsp;down&nbsp;the&nbsp;application,&nbsp;using&nbsp;increasing&nbsp;violence.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;package:&nbsp;Name&nbsp;of&nbsp;the&nbsp;process&nbsp;to&nbsp;kill&nbsp;off,&nbsp;e.g.<br>
&nbsp;&nbsp;com.google.android.apps.chrome</tt></dd></dl>
<dl><dt><a name="AdbCommands-ExtractPid"><strong>ExtractPid</strong></a>(self, process_name)</dt><dd><tt>Extracts&nbsp;Process&nbsp;Ids&nbsp;for&nbsp;a&nbsp;given&nbsp;process&nbsp;name&nbsp;from&nbsp;Android&nbsp;Shell.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;process_name:&nbsp;name&nbsp;of&nbsp;the&nbsp;process&nbsp;on&nbsp;the&nbsp;device.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;List&nbsp;of&nbsp;all&nbsp;the&nbsp;process&nbsp;ids&nbsp;(as&nbsp;strings)&nbsp;that&nbsp;match&nbsp;the&nbsp;given&nbsp;name.<br>
&nbsp;&nbsp;If&nbsp;the&nbsp;name&nbsp;of&nbsp;a&nbsp;process&nbsp;exactly&nbsp;matches&nbsp;the&nbsp;given&nbsp;name,&nbsp;the&nbsp;pid&nbsp;of<br>
&nbsp;&nbsp;that&nbsp;process&nbsp;will&nbsp;be&nbsp;inserted&nbsp;to&nbsp;the&nbsp;front&nbsp;of&nbsp;the&nbsp;pid&nbsp;list.</tt></dd></dl>
<dl><dt><a name="AdbCommands-FileExistsOnDevice"><strong>FileExistsOnDevice</strong></a>(self, file_name)</dt></dl>
<dl><dt><a name="AdbCommands-Forward"><strong>Forward</strong></a>(self, local, remote)</dt></dl>
<dl><dt><a name="AdbCommands-IsRootEnabled"><strong>IsRootEnabled</strong></a>(self)</dt></dl>
<dl><dt><a name="AdbCommands-KillAll"><strong>KillAll</strong></a>(self, process)</dt><dd><tt>Android&nbsp;version&nbsp;of&nbsp;killall,&nbsp;connected&nbsp;via&nbsp;adb.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;process:&nbsp;name&nbsp;of&nbsp;the&nbsp;process&nbsp;to&nbsp;kill&nbsp;off<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;the&nbsp;number&nbsp;of&nbsp;processess&nbsp;killed</tt></dd></dl>
<dl><dt><a name="AdbCommands-Pull"><strong>Pull</strong></a>(self, remote, local)</dt></dl>
<dl><dt><a name="AdbCommands-Push"><strong>Push</strong></a>(self, local, remote)</dt></dl>
<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&nbsp;a&nbsp;command&nbsp;to&nbsp;the&nbsp;adb&nbsp;shell&nbsp;and&nbsp;return&nbsp;the&nbsp;result.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;command:&nbsp;String&nbsp;containing&nbsp;the&nbsp;shell&nbsp;command&nbsp;to&nbsp;send.&nbsp;Must&nbsp;not&nbsp;include<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;single&nbsp;quotes&nbsp;as&nbsp;we&nbsp;use&nbsp;them&nbsp;to&nbsp;escape&nbsp;the&nbsp;whole&nbsp;command.<br>
&nbsp;&nbsp;timeout_time:&nbsp;Number&nbsp;of&nbsp;seconds&nbsp;to&nbsp;wait&nbsp;for&nbsp;command&nbsp;to&nbsp;respond&nbsp;before<br>
&nbsp;&nbsp;&nbsp;&nbsp;retrying,&nbsp;used&nbsp;by&nbsp;AdbInterface.SendShellCommand.<br>
&nbsp;&nbsp;log_result:&nbsp;Boolean&nbsp;to&nbsp;indicate&nbsp;whether&nbsp;we&nbsp;should&nbsp;log&nbsp;the&nbsp;result&nbsp;of&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shell&nbsp;command.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;list&nbsp;containing&nbsp;the&nbsp;lines&nbsp;of&nbsp;output&nbsp;received&nbsp;from&nbsp;running&nbsp;the&nbsp;command</tt></dd></dl>
<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&nbsp;|package|'s&nbsp;activity&nbsp;on&nbsp;the&nbsp;device.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;package:&nbsp;Name&nbsp;of&nbsp;package&nbsp;to&nbsp;start&nbsp;(e.g.&nbsp;'com.google.android.apps.chrome').<br>
&nbsp;&nbsp;activity:&nbsp;Name&nbsp;of&nbsp;activity&nbsp;(e.g.&nbsp;'.Main'&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;'com.google.android.apps.chrome.Main').<br>
&nbsp;&nbsp;wait_for_completion:&nbsp;wait&nbsp;for&nbsp;the&nbsp;activity&nbsp;to&nbsp;finish&nbsp;launching&nbsp;(-W&nbsp;flag).<br>
&nbsp;&nbsp;action:&nbsp;string&nbsp;(e.g.&nbsp;'android.intent.action.MAIN').&nbsp;Default&nbsp;is&nbsp;VIEW.<br>
&nbsp;&nbsp;category:&nbsp;string&nbsp;(e.g.&nbsp;'android.intent.category.HOME')<br>
&nbsp;&nbsp;data:&nbsp;Data&nbsp;string&nbsp;to&nbsp;pass&nbsp;to&nbsp;activity&nbsp;(e.g.&nbsp;'<a href="http://www.example.com/">http://www.example.com/</a>').<br>
&nbsp;&nbsp;extras:&nbsp;Dict&nbsp;of&nbsp;extras&nbsp;to&nbsp;pass&nbsp;to&nbsp;activity.&nbsp;Values&nbsp;are&nbsp;significant.<br>
&nbsp;&nbsp;trace_file_name:&nbsp;If&nbsp;used,&nbsp;turns&nbsp;on&nbsp;and&nbsp;saves&nbsp;the&nbsp;trace&nbsp;to&nbsp;this&nbsp;file&nbsp;name.</tt></dd></dl>
<dl><dt><a name="AdbCommands-__init__"><strong>__init__</strong></a>(self, device)</dt></dl>
<dl><dt><a name="AdbCommands-device"><strong>device</strong></a>(self)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<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>
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Forwarder-Close"><strong>Close</strong></a>(self)</dt></dl>
<dl><dt><a name="Forwarder-__init__"><strong>__init__</strong></a>(self, adb, *port_pairs)</dt></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="Forwarder-KillDevice"><strong>KillDevice</strong></a>(adb)</dt></dl>
<dl><dt><a name="Forwarder-KillHost"><strong>KillHost</strong></a>()</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>url</strong></dt>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-AllocateTestServerPort"><strong>AllocateTestServerPort</strong></a>()</dt></dl>
<dl><dt><a name="-GetAttachedDevices"><strong>GetAttachedDevices</strong></a>()</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;attached,&nbsp;online&nbsp;android&nbsp;devices.<br>
&nbsp;<br>
If&nbsp;a&nbsp;preferred&nbsp;device&nbsp;has&nbsp;been&nbsp;set&nbsp;with&nbsp;ANDROID_SERIAL,&nbsp;it&nbsp;will&nbsp;be&nbsp;first&nbsp;in<br>
the&nbsp;returned&nbsp;list.</tt></dd></dl>
<dl><dt><a name="-GetOutDirectory"><strong>GetOutDirectory</strong></a>()</dt></dl>
<dl><dt><a name="-HasForwarder"><strong>HasForwarder</strong></a>(buildtype<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="-IsAndroidSupported"><strong>IsAndroidSupported</strong></a>()</dt></dl>
<dl><dt><a name="-ResetTestServerPortAllocation"><strong>ResetTestServerPortAllocation</strong></a>()</dt></dl>
</td></tr></table>
</body></html>