| |
- __builtin__.object
-
- AdbCommands
- Forwarder
class AdbCommands(__builtin__.object) |
|
A thin wrapper around ADB |
|
Methods defined here:
- Adb(self)
- CloseApplication(self, package)
- Attempt to close down the application, using increasing violence.
Args:
package: Name of the process to kill off, e.g.
com.google.android.apps.chrome
- ExtractPid(self, process_name)
- Extracts Process Ids for a given process name from Android Shell.
Args:
process_name: name of the process on the device.
Returns:
List of all the process ids (as strings) that match the given name.
If the name of a process exactly matches the given name, the pid of
that process will be inserted to the front of the pid list.
- FileExistsOnDevice(self, file_name)
- Forward(self, local, remote)
- IsRootEnabled(self)
- KillAll(self, process)
- Android version of killall, connected via adb.
Args:
process: name of the process to kill off
Returns:
the number of processess killed
- Pull(self, remote, local)
- Push(self, local, remote)
- RunShellCommand(self, command, timeout_time=20, log_result=False)
- Send a command to the adb shell and return the result.
Args:
command: String containing the shell command to send. Must not include
the single quotes as we use them to escape the whole command.
timeout_time: Number of seconds to wait for command to respond before
retrying, used by AdbInterface.SendShellCommand.
log_result: Boolean to indicate whether we should log the result of the
shell command.
Returns:
list containing the lines of output received from running the command
- StartActivity(self, package, activity, wait_for_completion=False, action='android.intent.action.VIEW', category=None, data=None, extras=None, trace_file_name=None)
- Starts |package|'s activity on the device.
Args:
package: Name of package to start (e.g. 'com.google.android.apps.chrome').
activity: Name of activity (e.g. '.Main' or
'com.google.android.apps.chrome.Main').
wait_for_completion: wait for the activity to finish launching (-W flag).
action: string (e.g. 'android.intent.action.MAIN'). Default is VIEW.
category: string (e.g. 'android.intent.category.HOME')
data: Data string to pass to activity (e.g. 'http://www.example.com/').
extras: Dict of extras to pass to activity. Values are significant.
trace_file_name: If used, turns on and saves the trace to this file name.
- __init__(self, device)
- device(self)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
|