ideviceinstaller icon indicating copy to clipboard operation
ideviceinstaller copied to clipboard

AFC Write error: 30

Open JasonHXiang opened this issue 9 years ago • 12 comments

hi, something awkward happended. when I run 'ideviceinstaller -u -i wzry.ipa' in my terminal, log shows below:

WARNING: could not locate iTunesMetadata.plist in archive!
WARNING: could not locate Payload/wzry.app/SC_Info/wzry.sinf in archive!
Copying 'wzry.ipa' to device... AFC Write error: 30
Error: wrote only 0 of 1048576

what does AFC error code 30 stand for? how can I solve this? Thanks in advance

JasonHXiang avatar Sep 19 '16 07:09 JasonHXiang

In my experience this might mean either that the device's storage is full, or that there is just some temporary issue which will vanish after several retries. Chances for this error are seemingly bigger when you do something on the device during installation. According to source code, error code 30 might mean AFC_E_MUX_ERROR: http://www.libimobiledevice.org/docs/html/afc_8h.html

MarSoft avatar Dec 06 '18 14:12 MarSoft

MUX Error might also indicate a communication error caused by a bad cable. Can you run idevicesyslog in another terminal while trying to install?

nikias avatar Dec 07 '18 00:12 nikias

If minimum version required by app is say 15 but iPhone had 14

vivek-git-checkout avatar Mar 11 '23 22:03 vivek-git-checkout

Still getting this error. Works on some iphones but fails on some, even with iOS 16.3.1

ideviceinstaller --version ideviceinstaller 1.1.1

vivek-git-checkout avatar Mar 15 '23 02:03 vivek-git-checkout

I had the same error on multiple iPhone models and iOS versions. As @nikias wrote before, in my case the problem was in bad cable and cable position. If the cable is not original (like mine) then you have to play with moving/bending the cable or rotating the plugin 180 degrees. Sounds like voodoo, but works for me. My colleague has the original cable and the same 'ideviceinstaller -i' command passes every time on his setup, I on the other hand have to find the "optimal position" of the cable.

ZasadaTalosa avatar May 09 '23 08:05 ZasadaTalosa

It's not a voodoo, it's just bad quality electric contacts. If they are worse on one side than in another side of the connector then rotating it 180° will work

MarSoft avatar May 09 '23 12:05 MarSoft

Strange problem, just try again a few times then it works

342261733 avatar May 17 '23 02:05 342261733

when I update my mac to macos 13, this error happens

chanchifan avatar Jun 16 '23 12:06 chanchifan

I'm skeptical that the issue is always from a faulty cable or physical connection.

This error occurs somewhat randomly, but trying again in Xcode produces a successful install every time.

If the issue is with the cable, then how is Xcode able to install using the faulty connection?

This reminds me of the original NES cartridges where people thought you had to blow on it to get it to work - when really you just had to take it out / reinsert the cartridge and it didn't matter what you did in between trying again.

Update:

I've now also tried installing using the ios-deploy tool and it works every time. No errors with a sample set of 10 tries.

kraftydevil avatar Jul 11 '23 16:07 kraftydevil

I have the same issue with my app. Also, I can confirm that using ios-deploy there were no errors during the app deploy

menvol3 avatar Aug 02 '23 12:08 menvol3

im using go-ios and i dont see any issue. with ideviceinstaller, yes iam facing issue

krishtoautomate avatar Aug 24 '23 19:08 krishtoautomate

I'm also encountering device connectivity issues (AFC_E_MUX_ERROR when installing apps, timeouts from idevicesyslog, etc.) after updating machines to Ventura.

This is happening consistently across a handful of (x86) Mac Minis and ~70 iPads, iOS versions 15.0 - 16.x. Using both first-party and third-party lightning cables.

These devices / cables / usb-hubs worked without issue on older macOS versions. The only change made to the setup was upgrading to Ventura.

I also confirm what someone above said: for whatever reason, ios-deploy has a higher success rate than ideviceinstaller.

I'll follow up here with debug logs, but nothing has stood out in my investigations thus far (aside from seeing a lot of timeouts):

Call graph:
    845 Thread_18925569   DispatchQueue_1: com.apple.main-thread  (serial)
      845 start  (in dyld) + 1903  [0x7ff81084841f]
        845 main  (in ideviceinstaller) + 5537  [0x10567cef5]
          845 afc_upload_dir  (in ideviceinstaller) + 438  [0x10567e308]
            845 afc_upload_dir  (in ideviceinstaller) + 438  [0x10567e308]
              845 afc_upload_dir  (in ideviceinstaller) + 455  [0x10567e319]
                845 afc_upload_file  (in ideviceinstaller) + 229  [0x10567e614]
                  845 afc_file_write  (in libimobiledevice-1.0.6.dylib) + 175  [0x1056fe5ca]
                    845 afc_receive_data  (in libimobiledevice-1.0.6.dylib) + 84  [0x1056fdaba]
                      845 service_receive_with_timeout  (in libimobiledevice-1.0.6.dylib) + 52  [0x1056facd1]
                        845 idevice_connection_receive_timeout  (in libimobiledevice-1.0.6.dylib) + 229  [0x1056fa5a2]
                          845 usbmuxd_recv_timeout  (in libusbmuxd-2.0.6.dylib) + 21  [0x1056e36d5]
                            845 socket_receive_timeout  (in libusbmuxd-2.0.6.dylib) + 36  [0x1056e5897]
                              845 socket_check_fd  (in libusbmuxd-2.0.6.dylib) + 248  [0x1056e56e2]
                                845 __select  (in libsystem_kernel.dylib) + 10  [0x7ff810b6c292]

EthanArbuckle avatar Nov 07 '23 23:11 EthanArbuckle