tksn.adb.call module

Implementation of subprocess invocation

copyright:
  1. 2016 by tksn
license:

MIT

exception tksn.adb.call.CallError[source]

Call error

Thrown when error occurs upon invocation of external commands.

tksn.adb.call.call_async(command, out=None, err=None)[source]

Call given command as subprocess, and returns immediately.

Parameters:
  • command (sequence) – list of command strings
  • out (file) – file object used as stdout of the subprocess.
  • err (file) – file object used as stderr of the subprocess.
Returns:

Popen object

Return type:

subprocess.Popen

tksn.adb.call.call_sync(command)[source]

Call given command as subprocess, and wait until it finishes

Parameters:command (sequence) – sequence of command strings
Returns:(stdout, stderr) of the subprocess
Return type:tuple
Raises:CallError – if command invocation failed
tksn.adb.call.get_adb_executable()[source]

Get path to ADB executable

Returns:Path to adb.exe under ANDROID_HOME if ANDROID_HOME exists in environment variables. otherwise ‘adb’.
Return type:str