The invention discloses a fruit fly attractant and a preparation method thereof, and the preparation method comprises the following steps: step S1,
purchasing fruit raw materials from a fruit market and an
orchard, washing and peeling the fruit raw materials, and then
grinding the fruit raw materials into
slurry by a pulping
machine; s2, adding the obtained
slurry into a
fermentation barrel, and adding sporospora globosa into the
fermentation barrel for sealed
fermentation; s3, after fermentation is finished, adding an auxiliary material additive into the fermentation
barrel, and uniformly stirring and mixing to obtain a mixture; s4, detecting the pH value, the
sugar content and the volatile organic compounds of the obtained mixture, and continuing fermentation if the detection indexes are unqualified; and if the detection indexes are qualified, obtaining the product, namely the fruit fly attractant, and packaging the product by adopting a full-automatic
packaging machine. Compared with a traditional
pesticide, the fruit fly attractant does not have the problems of
pesticide residues or damage to land and environment and the like, and has the advantages of being
environmentally friendly, free of
pollution and the like.