def connect(self, udid=None):
     mux = usbmux.USBMux()
     mux.process(1.0)
     if not mux.devices:
         print "Waiting for iOS device"
         while not mux.devices:
             mux.process(1.0)
     if not mux.devices:
         print "No device found"
         return
     dev = mux.devices[0]
     print "Connecting to device : " + dev.serial
     try:
         self.s = mux.connect(dev, self.port)
     except:
         raise Exception("Connexion to device port %d failed" % self.port)
Ejemplo n.º 2
0
    def connect(self, udid=None):
        mux = usbmux.USBMux()
        mux.process(1.0)
        dev = None

        while not dev and mux.devices:
            mux.process(1.0)
            if udid:
                for d in mux.devices:
                    if d.serial == udid:
                        dev = d
            else:
                dev = mux.devices[0]
        try:
            self.s = mux.connect(dev, self.port)
        except:
            raise Exception("Connexion to device port %d failed" % self.port)
        return dev.serial
    def connect(self, udid=None):
        mux = usbmux.USBMux()
        mux.process(5.0)
        dev = None

        while not dev and mux.devices:
            if udid:
                for d in mux.devices:
                    if d.serial == udid:
                        dev = d
                        print "Connecting to device: " + dev.serial
            else:
                dev = mux.devices[0]
                print "Connecting to device: " + dev.serial

        try:
            self.socket = mux.connect(dev, self.port)
        except:
            raise Exception("Connection to device port %d failed" % self.port)
        return dev.serial
Ejemplo n.º 4
0
def list_devices():
    mux = usbmux.USBMux()
    mux.process(1)
    return [d.serial for d in mux.devices]