The demand of smart food detection system which in detecting food spoilage is increasing. In this work, a new type of aggregation-induced emission (AIE) compound was synthesized based on pectin (P) and l-lysine (Lys). P-Lys is an AIE active compound which has the advantages of simple synthesis, easy modification and processability, it also has good water solubility and biocompatibility. Moreover, P-Lys has potential application in detecting Fe3+ (oxidation from Fe2+) and bacterial in monitoring pork spoilage. In addition, P-Lys also has spectral antibacterial properties which can prevent pork spoilage. The research results shown that P-Lys, as a new type of food testing agent has a useful future in monitoring and protecting the freshness of food.