The residues of erythromycin (ERY) may have negative impacts on the ecological environment, health, and food safety. How to detect ERY effectively and visually is a challenging issue. Herein, we synthesized a molecularly imprinted polymer based nanozymes for selective detection of erythromycin (ERY-MIPNs) at neutral pH, and developed a mobile phone-assisted bicolor colorimetric detection system. This system produced a wide range of color changes from blue to pinkish purple as the ERY concentration increased, making it easy to capture the visualization result. Also, the system showed good sensitivity to ERY ranging from 15 to 135 μM, with a detection limit of 1.78 μM. In addition, the system worked well in the detection of ERY in river water and milk, with the recoveries of 95.57% ∼ 103.20%. These data suggests that this strategy is of considerable potential for practical applications and it provides a new idea for visual detection with portable measurement.