mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 698010 - Make deviceManagerADB.py killProcess method actually work. r=jmaher
This commit is contained in:
parent
ede3bf1dcd
commit
638a5977f9
@ -256,11 +256,11 @@ class DeviceManagerADB(DeviceManager):
|
||||
# failure: None
|
||||
def killProcess(self, appname):
|
||||
procs = self.getProcessList()
|
||||
for proc in procs:
|
||||
if (proc[1] == appname):
|
||||
p = self.runCmd(["shell", "ps"])
|
||||
for (pid, name, user) in procs:
|
||||
if name == appname:
|
||||
p = self.runCmdAs(["shell", "kill", pid])
|
||||
return p.stdout.read()
|
||||
return None
|
||||
return None
|
||||
|
||||
# external function
|
||||
# returns:
|
||||
@ -506,6 +506,12 @@ class DeviceManagerADB(DeviceManager):
|
||||
args.insert(0, "adb")
|
||||
return subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
|
||||
def runCmdAs(self, args):
|
||||
if self.useRunAs:
|
||||
args.insert(1, "run-as")
|
||||
args.insert(2, self.packageName)
|
||||
return self.runCmd(args)
|
||||
|
||||
def checkCmd(self, args):
|
||||
args.insert(0, "adb")
|
||||
return subprocess.check_call(args)
|
||||
|
Loading…
Reference in New Issue
Block a user