Android flashing cheat sheet
1. Download and extract the Android SDK platform tools.
To be able to use adb
, fastboot
, etc., you'll need to download the Android SDK platform tools and extract them.
2. Enable and configure the root user (outside of a container or VM).
I've tried running the tools as non-root users and/or from inside containers or VMs, and I've never gotten them to work properly. So, even though this is definitely not a best practice in most contexts, in this case I recommend enabling the root user and using it to run the platform tools.
sudo passwd root
su
PATH="path/to/platform-tools:$PATH"
To make sure your device can be flashed, you'll have to take a couple of preparatory steps in your Android device.
1. Enable developer settings.
2. In the developer settings, enable USB debugging.
3. In the developer settings, enable OEM unlocking.
4. Connect the device to your computer.
5. Unlock the bootloader using the platform tools on your computer.
This is a sort of weird step, and I'm not sure I understand the rationale for it. Nevertheless, here's the context: You'd think that after enabling OEM unlocking in step #3, the bootloader would be unlocked. Unfortunately, you'd be wrong. There's another lock that has to be unlocked, apparently. To unlock that second lock, you'll have to boot the device into its bootloader, and then run the relevant fastboot
unlocking command:
# (as root)
# confirm that the device is connected and accessible:
adb devices -l
# reboot the device into its bootloader:
adb reboot bootloader
# unlock the bootloader:
fastboot flashing unlock
Once that's done, you should be able to follow the other steps below to flash a new image onto your device!
1. Download the stock image.
Download the target stock image zip file from here. (NOTE: You may have to agree to the terms of service at the bottom of the page before the giant list of images will load.) Specifically, click the "Link" link next to an image name, not the "Flash" link.
2. Unzip the zip file and move into the newly-created directory.
The zip file will probably have a name like bluejay-bp1a.250405.007-factory-98ac49c0.zip
. For the sake of simplicity, though, I'll refer to it as stock-image.zip
.
cd ~/Downloads
unzip stock-image.zip -d stock-image
cd stock-image
3. Run the flash-all.sh
script.
chmod +x flash-all.sh
./flash-all.sh
3. Troubleshoot.
If you didn't complete all of the prep steps listed above, then something will almost certainly fail during the execution of the flash-all.sh
script. However, I did encounter one particular error even after doing all of the prep steps! I forget the exact wording, but it was something like "No space left on device". I thought at first that it was referring to storage space on the phone. But some digging revealed that it was neither referring to the phone nor to the computer's hard drive space generally; it was referring to the temporary directory on the computer in which work was being done! When I manually specified a different temp directory, the error went away, and the script was able to run all the way through. Here's how I manually specified the temp directory:
mkdir ./tmp
TMPDIR="./tmp" ./flash-all.sh
To switch to Calyx, just select your device here and follow the instructions. I've never had any problems with Calyx's automated installer script, so I won't bother writing any further instructions here (other than to say that you'll still need to perform the prep steps listed above)!