Package org.robovm.libimobiledevice
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 interfaceIDevice.EventListenerListener which gets called when devices are added and removed. -
Field Summary
Fields Modifier and Type Field Description protected IDeviceRefref -
Constructor Summary
-
Method Summary
Modifier and Type Method Description static voidaddEventListener(IDevice.EventListener listener)Registers a newIDevice.EventListenerwhich will be called when devices are added and removed.protected voidcheckDisposed()voidclose()IDeviceConnectionconnect(int port)Set up a connection to the device.voiddispose()protected IDeviceRefgetRef()java.lang.StringgetUdid()Returns the unique id (UDID) for this device.static java.lang.String[]listUdids()Lists UDIDs of currently available devices.static voidmain(java.lang.String[] args)static voidremoveEventListener(IDevice.EventListener listener)Removes a previously addedIDevice.EventListener.static voidsetDebugLevel(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
-
ref
-
-
Constructor Details
-
IDevice
public IDevice(java.lang.String udid)Creates a newIDevicefor the device with the UDID specified byudid, if the device is available.- Parameters:
udid- the UDID.- See Also:
listUdids()
-
-
Method Details
-
getRef
-
getUdid
public java.lang.String getUdid()Returns the unique id (UDID) for this device.- Returns:
- the UDID.
-
connect
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:
closein interfacejava.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
Registers a newIDevice.EventListenerwhich will be called when devices are added and removed.- Parameters:
listener- the listener to add.
-
removeEventListener
Removes a previously addedIDevice.EventListener.- Parameters:
listener- the listener to remove.
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-