ideviceinstaller icon indicating copy to clipboard operation
ideviceinstaller copied to clipboard

ideviceinstaller hangs (stop working), again start working when remove device and reconnect back

Open umesh9690 opened this issue 9 years ago • 19 comments

ideviceinstaller hangs (stop working) very offen, and again start working when removed device(iOS device) and reconnect back to machine(mac).

i installed ideviceinstaller using following commands: $ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $brew install --HEAD ideviceinstaller

any help highly appreciated...

umesh9690 avatar Apr 15 '15 13:04 umesh9690

We have seen the same issue and if there is a automated way of replugging the connected device to mac , please help, like mount/unmount the device itself ???

any thoughts to this is appreciated.

srikanthsadhu avatar Apr 17 '15 10:04 srikanthsadhu

Any progress on this ? its limiting our Automated process!!!!! we are feeling we had to switch to another utility to install apps .

srikanthsadhu avatar Apr 22 '15 16:04 srikanthsadhu

Can we mark this as CRITICAL issue with IOS8.2 devices on yosemite , please.

srikanthsadhu avatar Apr 22 '15 16:04 srikanthsadhu

this seemed to be a known issue with libusbmuxd and they are hoping to release in 1.4.0 , till then work around would be , with in itunes turnoff Synch ipad through wifi in iTunes and restart the ipad. this should be resolved temporarily till new relaease comes out OR fix the code and rebuild the libs.

srikanthsadhu avatar May 13 '15 07:05 srikanthsadhu

@srikanthsadhu , could you be more specific about the workaround? On my environment, the Sync with iPhone over Wi-Fi is tuned off, but the issue still reproducible with the phone. Thanks.

Here is some statistics: ideviceinstaller hangs with devices: iPhone 6+, iPad Air 2 ideviceinstaller does NOT hang with devices: iPhone 5, iPad Mini 2, iPod Touch

al007 avatar Jun 25 '15 14:06 al007

It seems this problem has never been addressed, and it is very inconvenient for all automation purposes.

The version you can install from Homebrew does not have this issue, but unfortunately that version is very old and it's not compatible with iOS 10.2

Any clues ??

ericcastro avatar Feb 10 '17 12:02 ericcastro

@ericcastro does this happen with large .ipa files/dev app folders or is this a general problem?

nikias avatar Feb 10 '17 17:02 nikias

I haven't been able to find a reliable way to reproduce the issue, but it happens quite often.

For example, doing ideviceinstaller -l works right after connecting the device, then leave the device connected for a while (work on some other stuff), come back, rerun ideviceinstaller -l, it hangs. Physically disconnecting and reconnecting the USB cable seems to be the only workaround, which, will defeat any automation purpose.

ericcastro avatar Feb 10 '17 17:02 ericcastro

Oh, it's about that. Huh, weird. While there is no obvious reason for it to hang it actually just happened with one of my device that has been connected for weeks. This is really strange...

nikias avatar Feb 10 '17 18:02 nikias

It hung after doing this:

19:07:39 notification_proxy.c:48 np_lock(): Locked
19:07:39 property_list_service.c:132 internal_plist_send(): sent 320 bytes
19:07:39 property_list_service.c:133 internal_plist_send(): printing 320 bytes plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Command</key>
        <string>ObserveNotification</string>
        <key>Name</key>
        <string>com.apple.mobile.application_installed</string>
</dict>
</plist>
19:07:39 notification_proxy.c:59 np_unlock(): Unlocked
19:07:39 notification_proxy.c:48 np_lock(): Locked

At this point it would normally send another ObserveNotification with 'com.apple.mobile.application_uninstalled' but it does nothing. I'll see what I can find out...

nikias avatar Feb 10 '17 18:02 nikias

Thanks, hope is nothing too difficult. Note that current available version in Homebrew (v1.1.0) does not have this problem.

ericcastro avatar Feb 13 '17 14:02 ericcastro

Nikias, I have noticed as someone mentioned in another issue (#62) that this problem is happening for a device that is being listed twice by idevice_id

➜  ideviceinstaller git:(master) ✗ idevice_id -l
7e7d61f48484abc3cbXXXXXXXXXXXXXXXXXXX
7e7d61f48484abc3cbXXXXXXXXXXXXXXXXXXX
0a47f5856f0bc16b54XXXXXXXXXXXXXXXXXXX
77cea2d5147ad8cc19XXXXXXXXXXXXXXXXXXX
1acf6165509b1b16fa7XXXXXXXXXXXXXXXXXXX

I have 4 devices connected, but the first one shows up twice. If I run ideviceinstaller -l -u 7e7d61f48484abc3cbXXXXXXXXXXXXXXXXXXX it hangs, but if I run it with any of the other UDIDs, it works.

Maybe this can give you a clue about what is causing this?

ericcastro avatar Feb 13 '17 17:02 ericcastro

Ahhhhh right this is a problem indeed. I need to figure out if we can distinguish between wifi and non-wifi sync devices. In fact when I tested, it picked my wifi sync device, trying to list all the apps while I thought it would operate on the device connected via USB.

nikias avatar Feb 13 '17 18:02 nikias

Now, I'm not sure why I get duplicate entries from idevice_id knowing that I do not have wifi sync enabled on any of my devices.

ericcastro avatar Feb 14 '17 14:02 ericcastro

Can't really tell you that but usbmuxd is apparently listing them. They can be differentiated with ConnectionType USB|Network, but neither libusbmuxd nor libimobiledevice are handling that at all (connection type is ignored). This requires some refactoring and additional functionality, and will probably not be finished in the next release (which is total overdue) but in a later one. I also don't have wifi sync enabled, but I had it enabled in the past, so maybe it's cached. Or maybe Apple's usbmuxd doesn't care if it's enabled or not :)

nikias avatar Feb 14 '17 17:02 nikias

@nikias Even i have been facing the same issue. Get 2 udid's on running idevice_id -l. Using iPhone 5S on OS version: 9.3.5

When can we expect a fix or is there a workaround for it?

mayureshshirodkar avatar Feb 26 '17 11:02 mayureshshirodkar

I am working around this issue by connecting my phone and machine to different Wifi connections or using Mobile data. Doing that doesn't create multiple UDIDs for idevice_id -l.

mayureshshirodkar avatar Feb 27 '17 05:02 mayureshshirodkar

@mayureshshirodkar if you don't need any sort of USB-through-Wi-Fi functionality in your project, you can use the fork that I created of libusbmuxd that addresses this problem by entirely ignoring any devices on WiFi, leaving only those connected via USB.

meaning you will no longer see duplicate UDIDs and ideviceinstaller and other tools depending on libusbmuxd will not freeze anymore.

make sure to remove all possible instances of libusbmuxd in your system before.

ericcastro avatar Mar 01 '17 16:03 ericcastro

Hey guys, I had this same issue this week and solved by disabling the wifi service in the MAC.

In your MAC, use the command below to list your network services networksetup -listallnetworkservices

Write down the service name similar to iPhone USB and run: networksetup -setnetworkserviceenabled SERVICE_NAME off

After that, restart your mobile and it should work, but I agree that should be a flag to ignore Wi-Fi connections, similar to "ios-deploy --no-wifi" flag.

felyppers avatar Sep 11 '18 19:09 felyppers