Error code

iOS 4013

IOS4013
System Error Code· A POSIX/system errno returned when a system call fails.

What it means

Device disconnected mid-restore — iTunes or Finder lost communication with the iPhone or iPad before the restore completed..

How to fix it

  1. Try a different Apple-certified USB cable.
  2. Plug directly into a USB port on the computer — not a hub.
  3. Try a different USB port on the same computer.
  4. If the error persists on multiple cables and ports the device may have a hardware issue — contact Apple Support.

Not affiliated with iOS. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.