首页 > 解决方案 > Is it possible to listen to device connections via libimobiledevice?

问题描述

I am trying to do something every time my iPhone is connected (via USB or wifi). Current alternative is polling list_devices and wait to see my device listed. Is there something better or polling is the only option? This is platform independent, but I am testing on Windows

标签: libimobiledevice

解决方案


You can subscribe for notifications which are sent by iTunes/usbmuxd whenever a new device is connected. If you're using libimobiledevice, you can use idevice_event_subscribe to register a callback which is invoked whenever a device is added or removed.


推荐阅读