Long-term tracking of bacterial viability is of great importance for monitoring the viability change of bacteria under storage, evaluating disinfection efficiency, as well as for studying the pharmacokinetic and pharmacodynamic properties of antibacterials. Most of the conventional viability dyes, however, suffer from high toxicity and/or poor photostability, making them unsuitable for long-term studies. In this work, an aggregation-induced emission molecule, TPE-2BA, which can differentiate dead and living bacteria and serve as a highly fluorescent and photostable probe for long-term viability assay. TPE-2BA is a cell-impermeable DNA stain that binds to the groove of double-stranded DNA. Bacteria with compromised membrane open the access for TPE-2BA to reach DNA, endowing it with strong emission. The feasibility of using TPE-2BA for screening effective bactericides is also demonstrated. Plate count experiment reveals that TPE-2BA poses negligible toxicity to bacteria, indicating that it is an excellent probe for long-term bacterial viability assay.