# Flashing the OUYA with i12bretro Image

## Things You Will Need

- A USB flash drive, at least 4 GB of free space https://amzn.to/3wkR5ju
- A USB hub, preferably with external power https://amzn.to/3KTviDw
- A USB keyboard https://amzn.to/3qgUQTe | https://amzn.to/3uchJs

## Prerequisites and Downloads

1. Download i12bretro_OUYA_commands.zip Download
2. Download i12bretro_OUYA_image.zip Download
3. Format the USB flash drive to FAT32
   1. Right Click Start > File Explorer
   2. Right Click the USB flash drive > Format...
   3. Select FAT32 from the File System dropdown
   4. Make sure Quick Format is checked
   5. Click Start

4. Extract the downloaded i12bretro_OUYA_image.zip file to the root of the USB flash drive
5. Extract the downloaded i12bretro_OUYA_commands.zip
6. Copy the last official Ouya update (files\zip\RC-OUYA-1.2.1427-r1_ota.zip) to the root of the USB flash drive
7. Safely remove the flash drive and set aside for later

## Installing Ouya USB Drivers

1. Right click Start > Command Prompt (Admin)
2. Paste the following commands to disable driving signing checks temporarily
   bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS
   bcdedit -set TESTSIGNING ON
   shutdown /r
3. Your PC will reboot
4. Connect a USB cable from the micro USB port on the back of the Ouya to your PC
5. Make sure the Ouya is connected to a display via HDMI
6. Power on the Ouya
7. After a few seconds you should hear Windows chime that a new device has been detected
8. Right click Start > Device Manager
9. Expand Other Devices and you should see OUYA listed
10. Right click OUYA > Update Driver
11. Select Browse my computer for driver software
12. Click the Browse... button
13. Navigate to the extracted i12bretro_OUYA_commands\files\driver
14. Click OK
15. Make sure "Include subfolders" is checked, click Next
16. Windows should find the correct driver for the Ouya and install it
17. Navigate to the i12bretro_OUYA_commands in windows explorer
18. Right click i12bretro_OUYA_commands.bat > Run as administrator
19. The script uses the Android Debug Bridge (ADB) to boot the Ouya into CyanogenMod recovery
20. When the command prompts to "-- Setup the fastboot driver", go back to Device Manager expand Android Device
21. Right click Android Bootloader Device > Update Driver
22. Select Browse my computer for driver software
23. Click the Browse... button
24. Navigate to the extracted i12bretro_OUYA_commands\files\driver
25. Click OK
26. Make sure "Include subfolders" is checked, click Next
27. Windows should find the correct driver for the Ouya and install it
28. Press Enter at the command prompt once the driver is installed to continue booting the Ouya to CyanogenMod recovery

## Restore i12bretro Image via CyanogenMod Recovery

1. With the OUYA in CyanogenMod Recovery:
2. Select Backup/Restore > Restore from USB disk
3. Navigate to and select the extracted i12bretro image from the USB disk clockworkmod\backup\2019-06-13.13.27.22
4. Select Yes to confirm restoring the backup
5. Wait several minutes for the various partitions of the image to be copied to the Ouya
6. From the main menu select Install zip > install zip from USB disk
7. Navigate to the RC-OUYA-1.2.1427-r1_ota.zip file on the USB disk
8. Select Yes to confirm installing the update
9. From the main menu select wipe cache partition
10. Select Yes to confirm wiping the cache
11. From the main menu select advanced > wipe dalvik cache partition
12. Select Yes to confirm wiping the dalvik cache
13. From the main menu select reboot device

## Cleaning Up

1. After successfully flashing the image to your Ouya, do the following
2. Right click Start > Command Prompt (Admin)
3. Paste the following commands to re-enable driving signing checks
   bcdedit -set loadoptions ENABLE_INTEGRITY_CHECKS
   bcdedit -set TESTSIGNING OFF
   shutdown /r
4. Your PC will reboot

Special thanks to https://www.s-config.com/cyanogen-mod-and-the-ouya/ for helping to keep the Ouya alive