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.


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


Full 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

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 in this case you need to specify the exact model type, such as "H4113" instead of "pioneer":

ait download-firmware-reduced H4113