In order to reflash a Sony Xperia phone (one that has its bootloader unlocked) to stock, one first has to download and install Sony’s in-house flash tool called Emma; as of this writing it’s only available for Windows, not Mac or any Linux Distro. The conventional app, Xperia Companion won’t work because it’ll complain that the bootloader is unlocked.

Make sure the phone you’re planning to reflash is powered off before connecting a USB cable from it to a PC.

Then hold down the volume down button followed by the power button of the phone in this exact order, and Emma should detect the phone.



Press the view all button in Emma to show all available software.



When selecting a service pair (Software and Firmware Updates), make sure to select a matching pair, since mixing different versions will most likely fail. If a service pair doesn’t work, try another – in the case of my Xperia XZ2 Compact, the only US pair available failed, and I had to use a UK pair.