At a glance

Skip the manual proxy toggle by configuring Shadowrocket’s On Demand behavior on your iPhone. This guide explains what automatic connection rules do, how to connect on selected networks, how to keep a trusted Wi-Fi network from triggering a connection, and how to test or undo the setup. Menu names and available conditions can vary with the app and iOS versions, so check the options shown on your device. This guide assumes you already have a working configuration; get any subscription details from your own service provider.

What On Demand controls—and what it does not

On Demand lets iOS start or stop a VPN connection when specified network conditions are met. In Shadowrocket, that means you can arrange for the VPN connection to be activated automatically instead of opening the app and switching it on each time. The rules are conditions for connecting, not a replacement for your server settings, subscription, or routing configuration.

It helps to distinguish the automatic connection from the traffic route. On Demand controls when the VPN connection is requested. Once connected, the active Shadowrocket configuration and Global Routing mode determine how traffic is handled. A connection that starts automatically can still fail to reach a website if the selected server is unavailable, the rules send the request to an unsuitable route, or DNS resolution fails.

On Demand also does not mean that an iPhone stays connected regardless of system state. iOS can apply its own network and VPN behavior, and a connection may need a moment to come up after you join Wi-Fi or switch to cellular. A manual tap in Shadowrocket can help you test a configuration, but it does not establish that automatic rules will behave the same way after every network transition.

3 checks
Trigger condition, active configuration, and actual connectivity
Wi-Fi
A network condition you may be able to match by SSID
1 change
Adjust one rule at a time so you can identify its effect

Before enabling rules, confirm that Shadowrocket connects manually on the network where you plan to use it. On Home, select your existing connection and start it; then try a site or app that should work through your current Global Routing and rules. If manual connection already fails, troubleshoot that first. Automation cannot repair an invalid server address, expired subscription, incompatible protocol settings, or a routing rule that sends the request to the wrong place.

Configure the automatic connection

Start with the simplest goal: connect when you use a network where you want the VPN active. The exact controls can vary. Open Shadowrocket’s Settings and look for On Demand; review the options displayed there rather than assuming every iPhone has identical labels or switches. If the app offers separate conditions for Wi-Fi, cellular, or domains, choose only the conditions that match your intended behavior.

  1. Test manually

    On Home, select your existing connection and switch it on while using the network you intend to automate. Confirm that the connection establishes and that a relevant website or app works. If it does not, resolve the connection problem before adding On Demand rules.

  2. Open On Demand

    Go to Settings → On Demand. Read the available controls and note their current values before changing them. Depending on the version, network conditions may appear as separate Wi-Fi or cellular options, or as entries within an On Demand rule list.

  3. Choose a trigger

    Enable the condition that matches when you want the connection to start. If you intend to use it on Wi-Fi only, do not enable a broader cellular condition just because it is available. If the screen offers a choice such as connecting on selected networks, use the selection controls shown on your device.

  4. Save and authorize

    Save the rule and accept any iOS prompt to allow or update the VPN configuration. If prompted, verify that you are authorizing Shadowrocket’s VPN connection. Return to Home and check that the intended configuration remains selected.

  5. Test a transition

    Turn the connection off manually if needed, then leave and rejoin the target network or switch between Wi-Fi and cellular. Wait briefly for iOS to apply the rule. Check Shadowrocket’s connection state and test a real destination; a VPN indicator alone does not prove that every request is routed as expected.

Do not enable every trigger at once. For example, a rule that connects on both Wi-Fi and cellular can make the VPN appear to reconnect even when you are trying to isolate a Wi-Fi-specific problem. Begin with one condition, verify it, and then add another only if the additional behavior is useful.

Exclude a trusted Wi-Fi network

You may want the VPN to connect on unfamiliar Wi-Fi while staying disconnected on a trusted home or workplace network. Look in Settings → On Demand for Wi-Fi network matching or SSID-related controls. An SSID is the Wi-Fi network name displayed by the device; it is not the router’s password. If Shadowrocket provides an explicit exclusion or “disconnect on” condition, use that option for the trusted network and check whether the interface lets you select the exact network.

Some versions may not offer a simple “exclude this Wi-Fi” list. If the available controls instead let you create connect and disconnect rules, add a disconnect condition for the trusted SSID and review the order or priority shown by the app. A more general connect rule can still apply if the exception is not evaluated as intended. If you cannot tell which rule takes precedence, test with one condition at a time and remove any conflicting rule rather than adding several guesses.

Network names are not permanent identifiers for every place you visit. A router can broadcast the same SSID as another network, and a saved network can be renamed. Treat an SSID exception as a convenience rule, not as a security test that proves the Wi-Fi itself is trustworthy. If you later change the network name or connect to a similarly named network, review the exception before relying on it.

Practical rule: automate the narrowest useful case

Start with one connection condition and one trusted-network exception. A short, testable rule set is easier to understand than a broad “connect everywhere” rule with several overlapping exceptions.

Test, troubleshoot, or undo the setup

Test the behavior in a repeatable order. First join the trusted Wi-Fi network and wait for the rule to take effect; confirm that Shadowrocket is disconnected if that is the intended result. Then join a network where the VPN should connect and check whether the connection starts. Finally, test cellular separately if you enabled a cellular condition. Do not judge the rule by an already-open webpage alone: an existing session or cached content may continue working after the network changes.

It connects on my home Wi-Fi even though I added an exception. What should I check?

In Settings → On Demand, verify that the exception matches the current SSID exactly and that it is a disconnect or non-connect condition, not another connect condition. Check for overlapping rules and test again after toggling Wi-Fi off and on. If your router broadcasts a separate guest SSID, add or test that network separately.

On Demand is enabled, but the VPN does not start on cellular. Why?

Check whether a cellular trigger is available and enabled; a Wi-Fi-only rule will not request a connection on cellular. Then connect manually on cellular to verify that the current configuration works there. If manual connection fails, investigate the network or connection settings before changing the automation rule.

Why does the connection return after I switch it off?

An enabled On Demand condition may request a new connection when its conditions are still satisfied. To stop automatic reconnection while troubleshooting, temporarily disable the relevant On Demand rule in Settings → On Demand, then switch the connection off from Home.

How do I return to manual control?

Open Settings → On Demand and disable the conditions you enabled, or remove the specific rules if you no longer need them. Then return to Home and switch the connection on or off yourself. Recheck the setting after a system or app update if the behavior changes.

If the VPN shows as connected but a page will not load, separate the automation question from the connectivity question. Confirm that the selected connection is usable, check Global Routing on Home, and test another destination. If only particular domains fail, inspect the active rules and DNS behavior rather than repeatedly changing On Demand. If the VPN fails to start only on one network, compare that network with a known-working Wi-Fi or cellular connection.

To undo the setup completely, turn off the On Demand conditions you added and remove any network-specific exceptions that are no longer needed. If iOS displays a prompt to update the VPN configuration, read it before approving. After disabling automation, verify that switching Shadowrocket manually still works; this confirms that you changed the trigger behavior rather than removing or replacing the connection configuration.

Keep a brief note of the original settings and the network names you changed. If an update or router change later alters the behavior, that record makes it easier to restore the earlier setup. Do not share screenshots containing subscription links, credentials, or other private connection details when asking for help.