Although porphyrin modification can improve the peroxidase-like activity of some inorganic nanozymes, it is hardly studied that metal porphyrin self-assembled nanoaggregates as sacrificial templates to turn on the peroxidase-like activity of inorganic nanozymes under light illumination. In this work, cobalt (II) 5,10,15,20-Tetrakis (4-carboxylpheyl)porphyrin (CoTCPP) self-assembled nanoaggregates are firstly used as soft templates to prepare TiO2-based nanozymes with the enhanced peroxidase-like activity. Interestingly, CoTCPP nanoaggregates can be changed into Co oxide nanoparticles dispersed into the nanosphere composites. Furthermore, the peroxidase-like activity of CoTCPP-TiO2 nanospheres can be controlled by light illumination. Comparatively, CoTCPP-TiO2 nanoshperes exhibit the highest peroxidase-like activity of three nanospheres (CoTCPP-TiO2, H2TCPP-TiO2 and TiO2) with similar morphology under the light illumination. Other than the existence of oxygen vacancy, the formation of heterostructure between TiO2 and a small amount of Co3O4 are ascribed to increase the catalytic activity of CoTCPP-TiO2 composites. Thus, a facile and convenient colorimetric sensing platform has been constructed and tuned by light illumination for determining H2O2 and amikacin in a good linear range of 20–100 and 50–100 μM with a limit of detection (LOD) of 3.04 μM and 1.88 μM, respectively. The CoTCPP-TiO2 based colorimetric sensing platform has been validated by measuring the amikacin residue in lake water.