iPhone XS Boot Loop. Unable to update or restore - Unknown Error 4013 (FIXED)
On the night of June 18th, my iPhone XS was sitting in my car's cup holder and went into a boot loop. I had a navigation app open but was not using the phone when the boot loop started. The looping was in progress when I next picked up the phone.
The phone would continuously restart, with a slight green flash across the screen just before the Apple logo would disappear. The phone would go through this loop for a while until it just turned off. I tried every Restart and Soft Reset button combination with no luck. Luckily, I had my MacBookPro with me and thought I could simply do a software update or restore (though I really didn't want to lose my pictures from the day that hadn't yet backed up to iCloud).
After driving into town to find suitable WiFi, I downloaded the necessary software and firmware updates. I was able to get my iPhone into restore mode, but every time I tried to do an update or restore, I got an an "unknown error (4013)" message. I took the phone to a repair shop to see if they could fix it, but they also had the same issue. I was fully prepared to lose all of the data that hadn't backed up, but we weren't even able to get to that point.
I made one last ditch effort to recover my data and get the phone to boot up. I kept restarting the phone until the battery was completely dead, then I plugged it in. It stayed on the Apple logo for far longer than it had at any time in the past week and a half. I walked away and came back to a black screen. I assumed that the phone had turned itself off again, but to my surprise it booted up. All my data is now backed up to iCloud.
It's unclear whether the phone may still have an underlying hardware or software issue, but I got my pictures, and now I can take my phone in for repair without any worry of what I might lose.
If you have a boot loop problem or an unknown error (4013), try letting the phone battery run all the way down and then plugging it into a charger.
iPhone XS, iOS 13