[Xperia SP Android Development] :
This is the way I do it with flashtool, my ROM comes with the kernel/boot image inside it and installs as you install the rom but I prefer to extract the image and flash that first

That way you have a better building block to install the ROM from a fresh

(Extract the image file from my rom to your computer, then copy the whole rom image file to the SDCard of the mobile for use later)

1. Reboot into recovery and Wipe/Factory reset (clear all partition and dalvik caches)

2. Launch flashtool, prepare kernel / boot image file for flashing then do the following;

to enter fastboot mode:

Switch off the phone

Press the Volume up button and hold it

(While holding) Plug in the USB cable

If successful, the LED should turn BLUE

now flash your kernel / boot image file

3. Reboot into recovery and Wipe/Factory reset again (clear all partition and dalvik caches)

4. Flash my ROM with CWM

5. Reboot and enjoy

6. ONLY install google apps after the first reboot

good luck

To enter CWM recovery tapping of either the vol up or down before the sony logo will get you in

If you have errors with flashtool check you have debug mode set to on

Enable developer options: Go to your phone’s Settings » select About phone » Scroll to the bottom and tap on “Build number” seven times to enable developer options

Enable USB Debugging: Open phone’s Settings » select Developer options » Tick the “USB debugging” checkbox (under Debugging section)

----------------------------------------------------------------------------------------------

To recovery you mobile after a bad flash

Open up PC companion and click on support zone (do not connect your phone yet)

Click on the Phone Software Update

It will says could not find phone because you havent connect it yet! so, dont connect it and click on the repair phone like this picture ---->

Fastboot mode with the mobile off press and hold the up volume key while plugging in the usb cable

the notifiaction light should now display blue. for flashing kernels

Flashmode with the mobile off press and hold the down volume key while plugging in the usb cable

the notifiaction light should now display green. for flashing firmware/kernel

bootlopp sony logo

using the OFF button under de back cover. press it + volume up connected to computer (a blue led should appear).

now reFlash kernel with flashtool

enter CWm with volume up key and factory reset clear cache and recover backup

Extracting the ftf file

change the .ftf to .zip,extract,then you will get something like .sin file,kernel.sin,system.sin,userdata.sin,change to .img,flash using fastboot

Use Flashtool to extract system.sin to give you system.ext4

Then use a PC and EXT2Explore tools to extract the image (mac software is limited)

fastboot flash boot kernel.img

fastboot flash system system.img

fastboot flash userdata userdata.img

restore or repair sony software

use flashmode (green led) to flash ftf stock

then relock bootloader

run su sony pc companion to update/repair mobile software

Power Menu features:

Reboot in SAVE MODE by LongPress "Power off" button

Submenu with two options - "Reboot" & "Shutdown" by Press "Power off" button