The development of sensitive, cheap, and portable methods for detecting nitroaromatics explosives has a profound significance and value for public health and environmental protection. For this purpose, a new D-π-A barbituric acid derivative CB-CYH with aggregation-induced emission (AIE) behavior was synthesized, which can interact with picric acid through photoinduced electron transfer (PET). Scanning electron microscopy (SEM) and dynamic light scattering (DLS) indicate that the enhanced emission of the compounds is related to the formation of nano-aggregates. It is well known that an important source of mechanochromic fluorescence (MCF) characteristic materials is the compound with AIE characteristics. The chemosensing test paper prepared by aggregated nanoparticles based on AIE properties is often subjected to external friction or squeeze during transportation or storage, resulting in changes of their optical properties, and destruction of test paper followed. Therefore, the development of compounds with AIE properties and stable optical properties in the presence of external stimuli is particularly important for chemosensing test paper. Molecular dynamics simulation (MDS) shows that the presence of hydrophobic cycloalkyl group in CB-CYH, which caused the molecules to be closely interspersed with each other; hence, it is difficult to change the microstructure and stacking mode of molecules by external stimulation simultaneously; the optical properties are not changed by external stimuli. Therefore, the test paper based on the AIE effect of CB-CYH was developed as chemosensing test paper for the detection of nitroaromatics.