We're too quick, and when: /* Connect to the device */ if (idevice_new (&dev, uuid) != IDEVICE_E_SUCCESS) { is called, libimobiledevice tells us usbmuxd doesn't know that device yet. Adding a sleep() works-around the problem, but we should be postponing the rest of the function instead.
commit e37fcd1db10c1c1df619a5cb290678687481347e Author: Bastien Nocera <hadess@hadess.net> Date: Tue Feb 3 21:27:32 2015 +0100 linux: Defer getting iDevice info until ready We're a bit too fast for usbmuxd to have noticed the USB device getting plugged in, so defer until either the device is 1) noticed by usbmuxd and 2) paired. https://bugs.freedesktop.org/show_bug.cgi?id=88950
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.