The self-powered sensors have attracted widespread attention in the analysis field due to a huge demand of point-ofcare testing (POCT) in the early diagnosis of diseases. However, the output voltage of the reported self-powered sensors is always small, resulting in a narrow linear detection range and low assay sensitivity. Herein, a self-powered photoelectrochemical (PEC) sensor with zinc−air batteries as a power source was developed for activity assay of protein tyrosine phosphatase 1B (PTP1B) based on perovskite quantum dots encapsulated in the vinyl-functionalized covalent organic framework (COF-V). CsPbBr 3 nanocrystals were stabilized by the confinement effect of the COF-V cage without aggregation, and the resulting CsPbBr 3 @COF-V composite was used as the cathodic photoelectric material to construct the zinc−air battery with a large open-circuit voltage (OCV, 1.556 V). Before PTP1B activity assay, an auxiliary peptide− polyamidoamine−phosphopeptide (P2-PAMAM-P1) hybrid was introduced into the photocathode via thiol−ene click reaction between the thiol group on the P1 and the vinyl group on the COF-V. The steric hindrance effect of the P1-PAMAM-P2 hybrid inhibited the PEC performance of the photocathode, resulting in a small OCV of the zinc−air battery. When the PTP1B existed, PTP1B-catalyzed dephosphorylation of tyrosine on P1 facilitated the cleavage process of P1 by chymotrypsin, leading to the removal of the P2-PAMAM-P1 hybrid from the photocathode and consequently the enhancement of the OCV. Therefore, the activity of PTP1B was sensitively detected. The developed self-powered PEC sensor showed superior performance for PTP1B activity assay (broad linear response range, 0.1 pM to 10 nM and low detection limit, 0.032 pM) due to the large output voltage of the constructed zinc−air battery and has great potential in POCT of protein phosphatase-related diseases and the discovery of protein phosphatasetargeted drugs.