From 4341fb823d6f70d300c6bbd196bd78ec40763623 Mon Sep 17 00:00:00 2001 From: Christian Holler Date: Tue, 28 Feb 2012 11:15:37 -0800 Subject: [PATCH] Bug 728995 - DeviceManagerADB should support TCP/IP r=wlach --- build/mobile/devicemanagerADB.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/mobile/devicemanagerADB.py b/build/mobile/devicemanagerADB.py index 670d58105e07..85f0e9d212a0 100644 --- a/build/mobile/devicemanagerADB.py +++ b/build/mobile/devicemanagerADB.py @@ -25,11 +25,17 @@ class DeviceManagerADB(DeviceManager): packageName = 'org.mozilla.fennec_' self.Init(packageName) + def __del__(self): + if self.host: + self.disconnectRemoteADB() + def Init(self, packageName): # Initialization code that may fail: Catch exceptions here to allow # successful initialization even if, for example, adb is not installed. try: self.verifyADB() + if self.host: + self.connectRemoteADB() self.verifyRunAs(packageName) except: self.useRunAs = False @@ -104,6 +110,12 @@ class DeviceManagerADB(DeviceManager): return None + def connectRemoteADB(self): + self.checkCmd(["connect", self.host + ":" + str(self.port)]) + + def disconnectRemoteADB(self): + self.checkCmd(["disconnect", self.host + ":" + str(self.port)]) + # external function # returns: # success: True