Lines Matching full:self
42 def SetEmulatorTarget(self):
44 self._target_arg = "-e"
46 def SetDeviceTarget(self):
48 self._target_arg = "-d"
50 def SetTargetSerial(self, serial):
52 self._target_arg = "-s %s" % serial
54 def SendCommand(self, command_string, timeout_time=20, retry_count=3):
69 adb_cmd = "adb %s %s" % (self._target_arg, command_string)
74 def SendShellCommand(self, cmd, timeout_time=20, retry_count=3):
90 return self.SendCommand("shell %s" % cmd, timeout_time=timeout_time,
93 def BugReport(self, path):
99 bug_output = self.SendShellCommand("bugreport", timeout_time=60)
104 def Push(self, src, dest):
111 self.SendCommand("push %s %s" % (src, dest), timeout_time=60)
113 def Pull(self, src, dest):
127 if self.DoesFileExist(src):
128 self.SendCommand("pull %s %s" % (src, dest), timeout_time=60)
134 def DoesFileExist(self, src):
144 output = self.SendShellCommand("ls %s" % src)
152 self, package_name, runner_name, timeout_time=60*10,
160 return self.StartInstrumentation(instrumentation_path, timeout_time=timeout_time,
165 self, instrumentation_path, timeout_time=60*10, no_window_animation=False,
203 command_string = self._BuildInstrumentationCommandPath(
210 self.SendShellCommand(command_string, timeout_time=timeout_time,
231 self, package_name, runner_name, no_window_animation=False,
239 adb_command_string = self.PreviewInstrumentationCommand(
246 self, package_name, runner_name, no_window_animation=False,
249 inst_command_string = self._BuildInstrumentationCommand(
252 command_string = "adb %s shell %s" % (self._target_arg, inst_command_string)
256 self, package, runner_name, no_window_animation=False, profile=False,
260 return self._BuildInstrumentationCommandPath(
266 self, instrumentation_path, no_window_animation=False, profile=False,
272 self._CreateTraceDir()
275 (self.DEVICE_TRACE_DIR, instrumentation_path.split(".")[-1]))
284 def _CreateTraceDir(self):
285 ls_response = self.SendShellCommand("ls /data/trace")
287 self.SendShellCommand("create /data/trace", "mkdir /data/trace")
288 self.SendShellCommand("make /data/trace world writeable",
291 def WaitForDevicePm(self, wait_time=120):
302 self.SendCommand("wait-for-device")
311 output = self.SendShellCommand("pm path android", retry_count=1)
321 def WaitForInstrumentation(self, package_name, runner_name, wait_time=120):
341 output = self.SendShellCommand("pm list instrumentation | grep %s"
358 def Sync(self, retry_count=3):
373 output = self.SendCommand("sync", retry_count=retry_count)
380 self.SendCommand("remount")
381 output = self.SendCommand("sync", retry_count=retry_count)
385 self.SendShellCommand("stop", retry_count=retry_count)
386 output = self.SendCommand("sync", retry_count=retry_count)
387 self.SendShellCommand("start", retry_count=retry_count)
392 self.WaitForDevicePm()
395 def GetSerialNumber(self):
397 return self.SendCommand("get-serialno").strip()