I had some issues trying to troubleshoot unlock of my Xperia 5 IV using Windows 10, and finally got it to work, adding some brief notes here for anyone else running into the issue.
running:
.\fastboot.exe oem unlock 0xXXXXXXXXXXXXXXXX
I got
FAILED (remote: 'Command not supported in default implementation')
A few things here, first I tried this using 'fastbootd' (gotten there by powerbutton + volume down, and browsing to fastboot) This is differen't than the fastboot you get to via holding Volume Up while plugging into the PC, but it's confusing since fastboot devices
works even with default drivers. You know you are in the correct fastboot because the screen remains black, and the LED lights up as and stays 'blue'.
Next, in the correct fastboot, it often appears to not work without the correct drivers installed, I downloaded the newest Google USB driver from: https://developer.android.com/studio/run/win-usb, and extracted the file usb_driver_r13-windows.zip, however the driver in there doesn't attach to the correct device. so, inside of android_winusb.inf, you need to add the lines
; SonyEricsson
%SingleAdbInterface% = USB_Install, USB\VID_0FCE&PID_0DDE
%CompositeAdbInterface% = USB_Install, USB\VID_0FCE&PID_0DDE&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0FCE&PID_0DDE
under both the [Google.NTx86]
and [Google.NTamd64]
sections.
Now, trying to install the driver I got an error dialog saying
Windows encountered a problem installing the driver software for your device.
Windows found driver software for your device but encoutered an error while attempting to install it.
The hash for the file is not present in the specified catalog file. The file is likely corrupt or the victim of tampering.
The problem was window driver signing was causing the errors, so I followed the process
Hold SHIFT while rebooting windows. Select 'Troubleshoot', then 'Advanced Options', 'Startup Options' then 'Restart' In the reboot menu there should be an option accessed via '7' on the keyboard: 'Disable driver signing enforcement'
Lastly, I was getting:
FAILED (remote: 'Command not allowed')
It appears that during troubleshooting OEM Unlocking got disabled again, so I just booted the device, went back under the development menu, and enabled it again, at which point, rebooting in fastboot, and running:
.\fastboot.exe oem unlock 0xXXXXXXXXXXXXXXXX
worked without issue:
OKAY [ 20.469s]
Finished. Total time: 20.471s
I tried this on my Xperia XQ-AS62 and still get the "FAILED (remote: 'Unrecognized command flashing unlock') fastboot: error: Command failed" message.
I tried adding the code from the Xperia 5 ii driver to the Google USB driver too and still got the error.
Is there something I might be missing?
I have my phone connected using a 10G USB-C to USB-C data cable and I'm running the commands from an admin terminal with PowerShell 7 in the current directory with the platform tools.