def install_package(self, pkgpath): """install a package on android device: push package and install with shell command """ cmd = APK_INSTALL % (self.deviceid, pkgpath) exit_code, ret = shell_command(cmd) return ret
def _get_device_ids(): """get android deivce list of ids""" result = [] exit_code, ret = shell_command("adb devices") for line in ret: if str.find(line, "\tdevice") != -1: result.append(line.split("\t")[0]) return result
def shell_cmd(self, cmd="", timeout=15): cmdline = "adb -s %s shell %s" % (self.deviceid, cmd) return shell_command(cmdline, timeout)