Class IDevice

java.lang.Object
org.robovm.libimobiledevice.IDevice
All Implemented Interfaces:
java.lang.AutoCloseable

public class IDevice
extends java.lang.Object
implements java.lang.AutoCloseable
Handles device connection communication.
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static interface  IDevice.EventListener
    Listener which gets called when devices are added and removed.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected IDeviceRef ref  
  • Constructor Summary

    Constructors
    Constructor Description
    IDevice​(java.lang.String udid)
    Creates a new IDevice for the device with the UDID specified by udid, if the device is available.
  • Method Summary

    Modifier and Type Method Description
    static void addEventListener​(IDevice.EventListener listener)
    Registers a new IDevice.EventListener which will be called when devices are added and removed.
    protected void checkDisposed()  
    void close()  
    IDeviceConnection connect​(int port)
    Set up a connection to the device.
    void dispose()  
    protected IDeviceRef getRef()  
    java.lang.String getUdid()
    Returns the unique id (UDID) for this device.
    static java.lang.String[] listUdids()
    Lists UDIDs of currently available devices.
    static void main​(java.lang.String[] args)  
    static void removeEventListener​(IDevice.EventListener listener)
    Removes a previously added IDevice.EventListener.
    static void setDebugLevel​(int level)
    Sets the level of debugging.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • IDevice

      public IDevice​(java.lang.String udid)
      Creates a new IDevice for the device with the UDID specified by udid, if the device is available.
      Parameters:
      udid - the UDID.
      See Also:
      listUdids()
  • Method Details

    • getRef

      protected IDeviceRef getRef()
    • getUdid

      public java.lang.String getUdid()
      Returns the unique id (UDID) for this device.
      Returns:
      the UDID.
    • connect

      public IDeviceConnection connect​(int port)
      Set up a connection to the device.
      Parameters:
      port - the destination port to connect to.
      Returns:
      the connection.
    • checkDisposed

      protected final void checkDisposed()
    • dispose

      public void dispose()
    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
    • setDebugLevel

      public static void setDebugLevel​(int level)
      Sets the level of debugging. 0 turns it off.
      Parameters:
      level - the debug level.
    • listUdids

      public static java.lang.String[] listUdids()
      Lists UDIDs of currently available devices.
      Returns:
      the UDIDs of the currently available devices.
    • addEventListener

      public static void addEventListener​(IDevice.EventListener listener)
      Registers a new IDevice.EventListener which will be called when devices are added and removed.
      Parameters:
      listener - the listener to add.
    • removeEventListener

      public static void removeEventListener​(IDevice.EventListener listener)
      Removes a previously added IDevice.EventListener.
      Parameters:
      listener - the listener to remove.
    • main

      public static void main​(java.lang.String[] args) throws java.lang.Exception
      Throws:
      java.lang.Exception