Anintelligent colorimetric sensing platform integrated with in situ immunomagnetic separation function was developed for ultrasensitive detection of Escherichia coli O157: H7 (E. coli O157: H7) in food. Captured antibody modified magnetic nanoparticles (cMNPs) and detection antibody/horseradish peroxidase (HRP) co-functionalized AuNPs (dHAuNPs) were firstly synthesized for targeted enrichment and colorimetric assay of E. coli O157: H7, in which remarkable signal amplification was realized by loading large amounts of HRP on the surface of AuNPs. Coupling with the optical collimation attachments and embedded magnetic separation module, a highly integrated optical device was constructed, by which in situ magnetic separation and high-quality imaging of 96-well microplates containing E. coli O157: H7 was achieved with a smartphone. The concentration of E. coli O157: H7 could be achieved in one-step by performing digital image colorimetric analysis of the obtained image with acustom-designed app. This biosensor possesses high sensitivity (1.63 CFU/mL), short detecting time (3h), and good anti-interference performance even in real-sample testing. Overall, the developed method is expected to be a novel field detection platform for foodborne pathogens in water and food as well as for the diagnosis of infections due to its portability, ease of operation, and high feasibility.