In human body, carboxylesterases (CEs) play the crucial roles in xenobiotic metabolism and lipid homeostasis. But the abnormal CEs expression is highly associated with some diseases, such as hyperlipidemia, diabetes and liver cancer. Therefore, it is of great significance to develop an efficient tool for the accurate detection of CEs in living organisms. Herein, an innovative near-infrared (NIR) fluorescent probe TTAP−AB has been designed for CEs detection based on aggregation-induced emission (AIE) mechanism. This probe exhibits rapid response (2 min), excellent sensitivity (limit of detection = 8.14×10−6 U/mL), and high selectivity towards CEs. Additionally, owing to the good biocompatibility, probe TTAP−AB enables to monitor the dynamic changes of CEs level under drug-induced modulation in living cells and zebrafish. More importantly, probe TTAP−AB is successfully employed to image the liver tumor and assist tumor resection by the real-time monitoring of CEs, indicating that TTAP−AB is promising to guide liver cancer surgery. Therefore, probe TTAP−AB can not only enrich the strategies for CEs detection in biological systems, but also has great potential for some clinical imaging applications, including medical diagnosis, preclinical research, and imaging-guided surgery.