Ait – Android installation tool


This tool automates the installation of LineageOS as much as possible. It downloads all required files and cryptographically verifies everything. As a first step, it applies a full or partial firmware upgrade, but only if necessary to fix severe problems. It continues to install LineageOS on that device, Along the way, it installs other system components like TWRP, OpenGApps and F-Droid, in the correct order and on the correct part of the system (A/B).

For the few remaining manual steps, the tool interactively tells the user exactly which buttons to press or which other actions to perform. The primary goal is to make the LineageOS installation safer by automating and testing as much as possible. The secondary goal is to make the LineageOS installation feasible to people who generally know what they do and are aware of all the risks, but who do not have specialized knowledge about Android or LineageOS.


Ait was primarily created to facilitate the installation of LineageOS on Sony Xperia XA2 devices, which is a lot more involved than a normal LineageOS installation to fix the "Bluetooth keeps stopping" issue. However, it is meant to support more devices in the future, as the installation on most other devices requires fewer quirks and allows for almost 100% automation.

Get involved!

Enter the Ait issue tracker to involved with this project. Ait is created and maintained by volunteers in their spare time. If you try it and find an issue, please report it. If you want to help out, please look at the open issues. If you have a great idea, please discuss it by creating a new issue, and connect with other volunteers to implement it. Either way, the central point to get in contact is the issue tracker.


First, install all required system packages. On Debian, Ubuntu and MINT, this means to run the following command:

sudo apt-get install git adb coreutils curl fastboot findutils unzip \
  usbutils gcc libexpat-dev libz-dev make pkgconf

Then, install Ait:

git clone ~/.local/share/ait
ln -s ../.local/share/ait/ait ~/bin/

Done! You can upgrade Ait at any time via:

cd ~/.local/share/ait && git pull


LineageOS installation

The following command installs LineageOS with Open GApps (pico) and F-Droid on Sony Xperia XA2 "pioneer". Note the you don't need to specify the model type such as "H4113", as it is determined automatically:

ait install lineageos+opengapps-pico+fdroid pioneer

LineageOS installation from bootloader

The following command installs the same LineageOS system as above. However, it is assumed that the device is already unlocked and the installation start from bootloader mode. Among others, this is useful to install LineageOS on a device where a previous (manual) installation attempt failed, that is, to unbrick a soft bricked device. Note that in this case you need to specify the exact model type, such as "H4113" instead of "pioneer":

ait install-unlocked lineageos+opengapps-pico+fdroid H4113

Download reduced firmware set

If you just want to download and unpack the reduced firmware set needed to fix the device, without installing anything, use the following command. Note that you need to specify the exact model type, such as "H4113" instead of "pioneer":

ait download-firmware-reduced H4113

Download full firmware set

If you want to download and unpack the full firmware set, use the following command. Note that this is overkill if you want to install LineageOS afterwards. This is only needed if, for some reason, you want to get back the stock operating system. You need to specify the exact model type, such as "H4113" instead of "pioneer":

ait download-firmware-full H4113

Restore stock installation

The following command downloads and restores the stock operating system. Note that you need to specify the exact model type, such as "H4113" instead of "pioneer":

ait install-unlocked stock H4113