This work presents a photocurrent-polarity-switching-based photoelectrochemical (PEC) biosensing platform for ultrasensitive detection of microRNA-21 (miR-21) through target-triggered catalytic hairpin assembly (CHA) for modulation of methylene blue (MB) and ferrocene (Fc) positional configurations using double-shelled Cu-doped ZnS nanocages (NCs)–Au nanoparticles (NPs) as photoactive materials. In the presence of miR-21, the assembly of MB-labeled HP1 and Fc-labeled HP2 leads to the generation of a large amount of double-stranded DNA (HP1–HP2), which pushes MB away from the electrode surface and brings Fc close to the electrode surface, resulting in effectively quenching the enhanced PEC signal to activate the photocurrent-polarity-switching system. Benefiting from the distance-controllable strategy, the designed PEC bioanalysis can effectively eliminate false-positive and false-negative signals due to the change of different signal expression patterns (from traditional the "signal-on" mode to the photocurrent-polarity-switching mode), thereby significantly improving the sensing specificity and sensitivity. The proposed PEC sensing system exhibited satisfying photocurrent responses toward target miR-21 within the working range from 1.0 fM to 1 nM at a low limit of detection (LOD) of 0.58 fM. More importantly, we demonstrated the successful integration of the proposed PEC biosensor with a handheld wireless device for instant detection of miR-21 concentrations in practical samples.