Bug 728995 - DeviceManagerADB should support TCP/IP r=wlach

This commit is contained in:
Christian Holler 2012-02-28 11:15:37 -08:00
Родитель 3d2cb480a8
Коммит 0d5609bd1e
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -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