As of 2023, the Square Kilometre Array will constitute the worlds largest radio telescope, offering unprecedented capabilities for a diverse science programme in radio astronomy. At the same time, the SKA will be ideally suited to detect extensive air showers initiated by cosmic rays in the Earths atmosphere via their radio emission. With its very dense and uniform antenna spacing in a fiducial area of one km$^2$ and its large bandwidth of 50-350 MHz, the low-frequency part of the SKA will provide very precise measurements of individual cosmic ray air showers. These precision measurements will allow detailed studies of the mass composition of cosmic rays in the energy region of transition from a Galactic to an extragalactic origin. Also, the SKA will facilitate three-dimensional tomography of the electromagnetic cascades of air showers, allowing the study of particle interactions at energies beyond the reach of the LHC. Finally, studies of possible connections between air showers and lightning initiation can be taken to a new level with the SKA. We discuss the science potential of air shower detection with the SKA and report on the technical requirements and project status.