For iPhone users experiencing battery drain while the screen is locked, repeated reconnects after leaving Wi-Fi, or a VPN that comes back after being disconnected manually. Compare battery use with the VPN connected and disconnected on the same network, then change only the On Demand triggers to decide whether to keep automatic connections or connect manually when needed.
iPhone Battery Drain While Locked: Background Activity or Reconnection Attempts?
A locked screen means the display is off, not that network activity has stopped. Photo syncing, email fetching, and other background tasks can still use data. With a VPN tunnel connected, traffic routed through it still needs processing; an idle tunnel may also send keepalive packets, depending on the protocol or server settings. A tunnel that cannot stay connected is another possibility: switching networks or a weak signal can lead to repeated DNS lookups, handshakes, and reconnects. First check whether the connection stays stable or keeps changing, then decide whether to investigate background tasks or network switching.
Baseline: Turn off On Demand before testing
In Shadowrocket, turn off automatic triggers in Settings → On Demand, then disconnect from Home. Before you start recording, make sure the connection has not come back. Switching Global Routing to Direct does not turn off the tunnel, so it is not a valid disconnected baseline.
On your iPhone, open Settings → Battery and check battery use and activity for the relevant period. The percentage next to an app shows its share of battery use during that period; it does not show how many percentage points the app took from the entire battery, nor can it distinguish tunnel activity from other apps or cellular network use. Check for screen-on time, charging, or notable background activity during the same period, then compare the change in overall battery level.
Always-On, On Demand, and Manual Connections
An always-on connection means keeping the tunnel connected as much as possible after establishing it; it is not a Global Routing option. On Demand lets iOS manage the VPN automatically based on enabled conditions. It does not simply connect when you open a browser and disconnect when you close it: network changes or qualifying network requests can trigger a connection, even while the screen is off.
| Connection method | When the connection starts | What to check during troubleshooting |
|---|---|---|
| Always-on connection | Connect from Home and leave it on | Can the connection stay up on a stable network? Does it repeatedly disconnect and reconnect after a network change? |
| On Demand | iOS triggers the connection based on enabled conditions | Does it connect on the intended network? Does it also connect on networks where you don't need automatic connection? |
| Manual connection | Turn off On Demand, then connect or disconnect from Home as needed | Does it stay disconnected after you disconnect? Do you need to reconnect manually before using it? |
Change one type of setting at a time. To troubleshoot automatic reconnects, keep the same node and Global Routing option, and change only On Demand. If you use Config, keep the same configuration too: rules determine how connections entering the routing flow are handled, not when the system starts a VPN connection. If you change both rules and trigger conditions, even an improvement in standby battery use won't tell you which change made the difference.
Settings → On Demand: Test Wi-Fi and cellular separately
Note the current settings
In Home, note the selected node, connection status, and Global Routing option. Then open Shadowrocket's Settings → On Demand and note which network conditions are enabled so you can restore them after testing.
Narrow the trigger conditions
If you mainly use a trusted Wi-Fi network and Settings → On Demand lets you configure network conditions separately, start by enabling only the Wi-Fi condition you need and leave automatic cellular connections off. If you can't configure them separately, don't assume cellular is excluded; use manual connections for now.
Test Wi-Fi
Make sure your iPhone is connected to the target Wi-Fi network. Open a page that normally requires the connection, then return to Home and check the status. Lock the screen for a while, then unlock it and check whether the connection stayed stable. If the Wi-Fi network requires a web login, complete it first, then check whether the tunnel connects successfully.
Test cellular
In a location with a stable signal, turn off Wi-Fi in your iPhone's Settings → Wi-Fi and confirm that it has switched to cellular. Then repeat the same access test. If you don't want automatic connections on cellular, disconnect the existing tunnel while on that network and check whether it reconnects by itself. Don't mistake a connection established before switching networks for a new trigger.
Keep settings that match the results
If you use cellular only occasionally, keep automatic triggers on Wi-Fi and connect manually on cellular. If you also need automatic connections when you're out, enable the cellular condition separately and test again in places where you commonly switch networks. If frequent reconnects disrupt use, switch back to manual connections first and investigate which part of the network is unstable.
Compare Battery Drain While Locked: Change One Condition at a Time
For an initial comparison, choose a location with a stable signal and run two 60-minute screen-locked periods. Use the same iPhone with a similar starting battery level, and keep the network, Low Power Mode, and usual background settings consistent. Don't charge the phone or start a download during the tests. The 60-minute period is a convenient window for repeatable observations, not a benchmark for normal battery use. If the difference is only one battery-level increment, don't draw a conclusion from it; repeat the test during a similar period for longer and see whether the result holds.
- Baseline: Turn off On Demand and disconnect from Home. Record the start and end times, overall battery level, and background activity for the same period in Battery.
- Connected test: Leave On Demand off, manually connect to the same node, and lock the screen. Keep everything else unchanged and compare the change in overall battery level. If the connection has dropped by the time you unlock the phone, don't treat this run as a stable always-on connection.
- Network-switching test: Test On Demand separately. In one run with the feature off and another with it on, start from the same connection state and follow the same sequence: Wi-Fi → cellular → Wi-Fi. Record which switch interrupts access and whether the connection recovers. Don't combine network-switching results with screen-locked tests on a fixed network.
If battery use is similar between the two tests on a stable network but the connection repeatedly reconnects during network changes, narrow the automatic triggers first. If battery drain is significant both when connected and disconnected, look for factors common to both tests, such as photo syncing during the same period or a weak cellular signal. If the connected test repeatedly shows a clear difference, try another node from a service you already use on the same network. Don't change the network, node, and protocol all in one test.
Diagnosing Reconnects: Request Timeout or No Network?
If you see any of the following exact identifiers in system network diagnostics, note the network and what you were doing when they appeared. These are iOS network error identifiers and may not appear verbatim in Shadowrocket alerts. A single error is not enough to identify the cause of battery drain.
Error: NSURLErrorTimedOut (-1001)
Cause: The request did not complete within the allotted time. This error alone does not identify the node as the cause. What to do: Stay on the same network, turn off On Demand, and disconnect the tunnel. Confirm that ordinary web pages load, then manually connect to the original node and repeat the action that timed out.
Error: NSURLErrorNotConnectedToInternet (-1009)
Cause: No internet connection was available when the request was made. What to do: Wait for the network switch to finish. If Wi-Fi still requires a web login or cellular data is unavailable, restore basic internet access before testing whether On Demand triggers reliably.
If the connection comes back shortly after you disconnect manually, that isn't necessarily an error. First check Settings → On Demand to see whether automatic triggers are still enabled. To disable them temporarily, turn off On Demand before disconnecting from Home. Then test a network switch or open a page and confirm that the connection behaves as expected.