Real-time visualization of messenger RNA (mRNA) is essential for tumor classification, grading, and staging. However, the low signal-to-background ratios and nonspatiotemporal specific signal amplification restricted the in vivo imaging of mRNA. In this study, a near-infrared (NIR) light-activated DNA nanodevice (DND) was developed for spatiotemporal in vivo fluorescence imaging of mRNA. The DND was fabricated by encapsulating indocyanine green (ICG) and DNA fluorescent probes within thermosensitive liposomes and subsequently functionalizing the liposomes with aptamers. The ICG offers the "always-on" fluorescence signal, offering a feasible strategy for monitoring DND distribution. The fluorescence signal of DNA probes remains inactive ("off" state) during the delivery process. Upon targeted delivery of the DNDs to tumor cells via aptamer recognition, the thermosensitive liposomes could be dissociated by the photothermal effect induced by ICG under near-infrared irradiation, thereby facilitating the release of DNA probes. The DNA probes were activated ("turn on") by tumor-specific thymidine kinase 1 (TK1) mRNA through toehold-mediated strand displacement cascades, enabling the signal-amplified fluorescence imaging of mRNA. This study reveals the distinctive light-activated merit and remarkable fluorescence imaging of DNDs, highlighting their great potential to promote progress in spatiotemporal resolution imaging of other disease-relevant RNAs in vivo.