Anthropogenic activities such as hydraulic fracturing (HF) can trigger destructive earthquakes, the triggering mechanisms of which are still largely in debate. We utilize near-fault seismic recordings to study the preparatory phase of the 2019 Mw 5.0 earthquake in the Weiyuan shale gas field, Sichuan Basin, China, which struck 3 months after stimulation completion. This is one of the largest HF-triggered earthquakes worldwide. We observe an 11-month long precursory fault activation, during which continuous seismicity illuminated the fault plane and provided warnings for a potential destructive earthquake. The fault activation is a consequence of injections in multiple HF well pads, with a variety of mechanisms at play. Numerical simulation reveals that the occurrence of the mainshock involves stress perturbation from post-injection aseismic slip. This work promotes our understanding of HF-induced earthquakes and suggests incorporating long-term near-fault observations and taking post-injection aseismic slip into account for effective hazard management.