
To fix iTunes error 4013, you must put your iDevice into DFU mode using the following instructions:
Step 1
Connect your iDevice to your PC or Mac via USB cable and launch iTunes.
Step 2
Hold down the Home+Power button for 10 seconds.
Step 3
After 10 seconds, release the Power button but keep holding the Home button until iTunes detect your iPhone in recovery mode.
Step 4
Once your iDevice is in DFU mode, you should see nothing on its screen. It should be completely blank.
Step 5
To see full instruction click here
iTunes Recovery Mode Fix iTunes Error 4013 During Custom IPSW Restore [How To Guide]
Even if your iDevice is in DFU mode, iTunes will detect it as a recovery mode device and will display a message as shown in the above screenshot. As soon as you see the above message, restore custom IPSW and hopefully this time you will not get iTunes Error 4013.