Cobalt-based catalysts have been widely proved to be promising electrocatalysts for oxygen reduction (ORR), hydrogen evolution (HER), and oxygen evolution (OER). In this paper, to maximize the trifunctional reactivity of the catalyst, a series of one-dimensional carbon-coated cobalt-based compound nanowires with changed anions were reported, and their trifunctional activities were systematically investigated. Among the cobalt-based compounds with different anions, carbon-encapsulated cobalt phosphide nanowires (CoP/C NWs) show impressive trifunctional catalytic activity toward ORR, OER, and HER. Using CoP/C NWs as a trifunctional electrocatalyst, an integrated device of the two-electrode water splitting device powered by the zinc–air battery system was realized. The assembled zinc–air battery exhibits high power density (115 mW cm–2) and long-term cycle stability (over 350 h, 1050 cycles). This work provides an insight into the effects of anion substitution on electrocatalytic activity and provides a highly effective feasibility for the design of energy-related devices with high-activity and durable catalysts.