예제 #1
0
 def forward(self, localport, remoteport):
     localport = str(localport)
     remoteport = str(remoteport)
     cmd = "iproxy " + localport + " " + remoteport
     if self.udid:
         cmd += " " + self.udid
     CmdExecuter.executeWithoutWait(cmd)
     self.forward_list[localport] = remoteport
예제 #2
0
 def __get_wdaport_by_udid(udid):
     outputlines = CmdExecuter.executeAndWait("ps -ef|grep \"iproxy [0-9]\+ 8100 " + udid + "\"")
     for line in outputlines:
         ret = re.search("iproxy ([0-9]+) 8100 " + udid, line.decode("utf-8"))
         if ret:
             return ret.group(1)
     outputlines = CmdExecuter.executeAndWait("ps -ef|grep \"iproxy [0-9]\+ 8100" + "\"")
     for line in outputlines:
         ret = re.search("iproxy ([0-9]+) 8100$", line.decode("utf-8"))
         if ret:
             return ret.group(1)
     logger.warn("No wda port detected for device.. " + udid)
     return None
예제 #3
0
 def removeAllForwards(self):
     for key, value in self.forward_list.items():
         localport = str(key)
         cmd = "iproxy " + localport + " "
         CmdExecuter.executeAndWait("pkill -f \"" + cmd + "\"")
     self.forward_list.clear()
예제 #4
0
 def removeForward(self, localport):
     localport = str(localport)
     cmd = "iproxy " + localport + " "
     CmdExecuter.executeAndWait("pkill -f \"" + cmd + "\"")
     if localport in self.forward_list.keys():
         self.forward_list.pop(localport)
예제 #5
0
 def install(self, ipapath):
     cmd = "ideviceinstaller -i " + ipapath
     if self.udid != None:
         cmd = " -u " + self.udid
     CmdExecuter.executeAndWait(cmd)
예제 #6
0
 def uninstall(self, bundleid):
     cmd = "ideviceinstaller -U " + bundleid
     if self.udid != None:
         cmd = " -u " + self.udid
     CmdExecuter.executeAndWait(cmd)