def get_adb_logcat(self, log_file): """ get recently 10000 adb logcat. :return: """ cmd = "adb -s " + self.serial_number + " logcat -t 10000 >" + log_file execute.Command(cmd).run()
def stop_music(self): cmd = "adb -s " + self.serial_number + " shell input keyevent 86" execute.Command(cmd).run()
def delete_anr(self): cmd = "adb -s " + self.serial_number + " shell rm -rf sdcard/anr*" execute.Command(cmd).run()
def disconnect(self): if self.serial_number.__contains__(":"): cmd = "adb disconnect " + self.serial_number execute.Command(cmd).run()
def reboot(self): cmd = "adb -s " + self.serial_number + " reboot" execute.Command(cmd).run()
def install(self, apk_name): cmd = "adb -s " + self.serial_number + " install -r -g " + apk_name execute.Command(cmd).run(timeout=120)
def uninstall(self): cmd = "adb -s " + self.serial_number + " uninstall " + self.package_name execute.Command(cmd).run()