Home | History | Annotate | Download | only in utils

Lines Matching refs:cmd

22     def _run_command(self, cmd, block=True):
29 self._os_if.log('Executing %s' % cmd)
30 process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
36 def run_command(self, cmd, block=True):
45 process = self._run_command(cmd, block)
47 err = ['Failed running: %s' % cmd]
55 (cmd, process.returncode))
57 def run_command_get_status(self, cmd):
62 process = self._run_command(cmd)
65 def run_command_get_output(self, cmd):
71 process = self._run_command(cmd)
103 def _run_command(self, cmd):
115 cmd = "adb shell 'export TMPDIR=/data/local/tmp; %s'" % cmd.replace("'", "\\'")
116 return self._host_shell._run_command(cmd)
118 def run_command(self, cmd):
127 process = self._run_command(cmd)
129 err = ['Failed running: %s' % cmd]
137 (cmd, process.returncode))
139 def run_command_get_status(self, cmd):
145 cmd = '(%s); echo $?' % cmd
146 lines = self.run_command_get_output(cmd)
151 def run_command_get_output(self, cmd):
158 cmd = '(%s) 2>/dev/null' % cmd
159 process = self._run_command(cmd)
165 cmd = 'adb pull %s %s' % (path, f.name)
166 self._host_shell.run_command(cmd)
173 cmd = 'adb push %s %s' % (f.name, path)
174 self._host_shell.run_command(cmd)
179 cmd = 'adb pull %s %s' % (path, f.name)
180 self._host_shell.run_command(cmd)
182 cmd = 'adb push %s %s' % (f.name, path)
183 self._host_shell.run_command(cmd)
187 cmd = 'timeout %s adb wait-for-device' % timeout
188 return self._host_shell.run_command_get_status(cmd) == 0
192 cmd = ('for i in $(seq 0 %d); do adb shell sleep 1 || false; done' %
194 return self._host_shell.run_command_get_status(cmd) != 0