1 This is not a “from zero” FlClash setup guide
If you still need APK sources, first-run VPN permission, or a walkthrough of subscription import, start with our FlClash Android complete setup article instead. The audience here has already passed that stage: the client runs, rules load, and latency looks fine—until the connection collapses in the background, after idle time, or after locking the device. That pattern almost always implicates Android’s power scheduler, manufacturer “boost” layers, or network policies that treat long-lived VPNs as budget leaks the OS would rather starve.
FlClash, like other Clash Meta front ends on Android, typically rides the platform VPN interface. The tunnel is a long-running process that holds wake locks, may keep radios warm, and competes with every other app the vendor promised “all day battery” for. Google added Doze and App Standby to batch network work; OEMs added even more aggressive task killers to win benchmark headlines. A proxy client is an easy target because users rarely notice a missed sync compared with a missed video call, so policies default to “freeze anything that dares to stay up.”
The fix is rarely a secret “developer option” (though those can help in edge cases). It is a boring sequence: exempt the app, confirm notifications, allow background data, then retest with a simple reproducible method so you are not confusing packet loss on a far-away node with a process that never woke up. Keep notes per device—your old Pixel behaves nothing like a fresh OnePlus when it comes to “auto launch” permissions.
2 What Doze, App Standby, and “battery optimization” actually do
Doze (introduced in Android 6) defers background CPU and network when the device is stationary, unplugged, and the screen is off. In deep idle, the system may only grant short “maintenance windows” where deferred jobs run together. A poorly exempted networking stack can look like “random” disconnects that always correlate with the phone sitting on a desk. App Standby is the per-app cousin: if you have not opened an app for a while, the OS can restrict its network access until you bring it to the foreground, even if you thought the VPN was “always on.”
Battery optimization is the user-facing name for the policy layer that controls whether a package is “restricted,” “optimized,” or “unrestricted.” The exact verbs differ by version and skin, but the idea is the same. Marking an app as optimized tells Android it is safe to delay or coalesce work; VPN software rarely survives that happily unless it uses a properly elevated foreground service with a visible notification, which is exactly what you want for FlClash when reliability matters more than a spotless status bar.
None of this means FlClash is flawed by default. It means mobile kernels assign priority differently than your Linux server running Mihomo under systemd. The Linux Mihomo guide is still useful conceptually—same YAML, different babysitter. On Android, you are debugging both the Clash engine and a moving target of vendor patches.
3 Symptom patterns that scream “OS policy”
Skim this list and mentally check boxes. The more you tick, the more you should distrust a pristine proxy profile and focus on background restrictions first. If, instead, the tunnel fails immediately on every connect attempt with identical log errors across reboots, lean toward config, DNS, or node quality—covered in a later section.
- Traffic dies seconds or minutes after the screen turns off, then returns instantly when you unlock.
- Disconnects cluster overnight or when the phone sits idle, not during active browsing.
- Switching from Wi-Fi to mobile data triggers a drop because the app was frozen and never re-bound sockets cleanly.
- The VPN key icon blinks or disappears, then FlClash’s notification vanishes, suggesting the service was killed rather than a remote server reset.
- A vendor “phone manager” or “auto cleanup” app shows FlClash in a sleep list right before problems begin.
Keep one clean experiment log: time of day, network type, screen state, and whether the issue survives a long session with the app left open in the foreground. If foreground is rock solid and background is flaky, you have already paid for the rest of this article.
4 Turn battery optimization off for FlClash (stock path)
The universal recipe on reasonably current Android: open Settings > Apps > FlClash > Battery (or “App battery”) and set usage to Unrestricted or Don’t optimize—wording depends on the release. If you only see a binary switch for “allow background activity,” turn it on. This single toggle fixes a surprising share of “it dies when I read a long article in Chrome with the display off” reports because it signals to JobScheduler that the package is not a free target for batch killing.
Also open Settings > Battery > Battery optimization (sometimes under the three-dot menu) and, if the UI offers a list of “not optimized” apps, confirm FlClash is explicitly in that allowlist. Some builds hide apps behind a “all apps” filter; switch the dropdown from “not optimized” to “all” so you are not staring at a misleading empty view. Reboot after changes once—power policies occasionally cache more aggressively than you expect, especially right after a monthly security patch.
If your ROM exposes Adaptive Battery or “smart power,” consider disabling those features temporarily while you validate stability. They learn patterns that sometimes misclassify VPNs as “rarely used” and punish them just as you return from a trip. You can re-enable them later once you know the baseline.
5 OEM checklists: Xiaomi, Samsung, Oppo, Vivo, Huawei, Honor
MIUI / HyperOS (Xiaomi, Redmi, POCO): look for Autostart (self-start) permission, often under Security app or Settings > Apps > Manage apps > FlClash. Enable autostart, then set battery saver to No restrictions. Lock the app in Recents: open the app switcher, pull FlClash down or long-press and tap the padlock, depending on skin version—this is not superstition; it often pins the process against swipe-away kills. Disable MIUI’s “battery saver for apps” and turn off Memory extension if you use it (swap tricks can add latency to wakeups, though they are secondary to autostart for most people).
One UI (Samsung): Settings > Apps > FlClash > Battery > Unrestricted first. Then Settings > Device care > Battery > Background usage limits > Never sleeping apps—add FlClash. Samsung also ships “Put unused apps to sleep,” which is exactly what you do not want for a network tunnel. If you use Good Lock or enterprise profiles, make sure a work security policy is not re-imposing power caps on top of your user choices.
ColorOS / OxygenOS (Oppo, OnePlus, Realme): search settings for auto launch, background freeze, and app quick freeze. Approve all launch types FlClash requests. Some builds expose a “allow background services” per app—toggle it. OnePlus historically buried these under a “**Advanced**” or “**Special app access**” label; use search first instead of hand-navigating every nested menu.
EMUI / Harmony (Huawei, older Honor): Settings > Battery > App launch > FlClash > Manage manually and enable Auto-launch, Secondary launch, and Run in background where available. Settings > Battery > Launch may duplicate similar toggles. Huawei aggressively manages cold starts, so you may see longer reconnect times until all three are green.
Nothing / Motorola / Sony near-stock: you may only need the stock Android path, but do confirm there is not a Stamina or Battery saver by app add-on. Sony’s Stamina has historically throttled long downloads unless whitelisted, which is adjacent to the VPN problem in failure mode. Always update vendor “system apps” with security fixes—some older builds shipped bugs that killed VPN services on upgrade night because profile migration reset permissions.
6 Data saver, unmetered access, and Private DNS
Data Saver and per-app background data switches are separate from CPU Doze. If FlClash needs to re-fetch a subscription or rule provider on cellular, blocking background data on metered networks can look like a broken profile when, in fact, the refresh simply never completed. In Settings > Network & internet > Data saver, either disable Data Saver or add FlClash to the unrestricted list. In App data usage, confirm both foreground and background toggles for mobile data and Wi-Fi are on—some carriers ship ROMs with “disable background data for new installs” as a default in regions with expensive LTE.
Private DNS (DNS-over-TLS) set to automatic or a strict hostname can break split DNS assumptions when combined with a fake-IP or DoH policy inside the profile. If disconnects line up with DNS timeouts rather than system kills, try Automatic or disable Private DNS for one test day. The behavior differs from a dead VPN process: you will see resolve failures in logs while the key icon still shows. Our documentation hub links to broader discussions of resolver chains if you need vocabulary for log lines.
Running two VPN apps (corporate per-app VPN, “firewall” apps, or another proxy) usually ends badly: only one can own the VpnService tunnel at a time, and the loser disconnects. If you must run both, seek split-tunnel or per-app allowlists from the enterprise product, or pause one stack while you test FlClash in isolation. Mixed tunnels are a common “works on Wi-Fi, dies on corporate APN” story.
7 Foreground service, notification channels, and the lock screen
Modern Android requires many long-running services to be foreground with a visible notification. Do not treat that notification as marketing spam. It is a contract: the system promises not to treat the service as an invisible leech. In FlClash, leave the “persistent” / “speed” / “status” style notification category enabled, depending on the build, and set its importance to at least the default (avoid full silence on Android 8+). If the client offers a tile in Quick Settings, add it: quick reconnection helps when a carrier or captive portal bounces the radio.
Biometric or smart lock can interact oddly with some VPNs when the keyguard transitions—rare, but if you only see hiccups when unlocking, test with a simple PIN to eliminate vendor biometrics glitches. Also confirm Always-on VPN in system settings: when enabled for FlClash, the OS is less likely to drop the interface silently, and you get a block-all toggle if the profile disconnects (which can be annoying but makes failures obvious).
8 A simple verification script you can repeat
Use this sequence instead of “I think it is better now.” One, note your FlClash build number and the Android security patch. Two, set all exemptions from sections 4–6. Three, start the tunnel, open one lightweight page that shows your public IP, and leave the display off for fifteen minutes on Wi-Fi. Four, wake the phone and refresh—if the IP and latency match expectations, the tunnel likely survived a short idle window. Five, repeat on mobile data walking between rooms to stress handovers. If it fails, capture whether FlClash was still in the notification shade; if the notification is gone, the process died—return to power settings. If the notification stayed but web fails, follow logging guidance in the next section.
Power users can enable Developer options > Stay awake while charging for one overnight soak test, which keeps the screen on and removes a variable. That is not a lifestyle recommendation—just a controlled experiment to tell screen-off idle apart from other factors. You can also watch logcat filtered to the app’s process if you are comfortable, but the notification presence heuristic covers most readers.
9 When it is probably not the OS
If the tunnel falls over while the screen is on and you are actively browsing, or within seconds of connect every time, suspect server-side or profile issues first. Update the subscription, switch nodes, compare rule mode to global mode briefly, and read FlClash logs for TLS errors or handshake timeouts. A single dead port on an outbound is indistinguishable from a shutdown service until you look at the error string. URL-test intervals that are too short can also waste battery; set sane periods so you are not flapping between broken nodes, which feels like a disconnect storm even though the phone never killed the app.
Remember that FlClash does not improve bad provider engineering. It faithfully applies whatever the remote YAML contains. If your policy marks domestic CDNs to DIRECT and something upstream changed AS paths, you may see “disconnects” that are just routing or DNS. Cross-check the same profile on a desktop Clash client on the same network when possible—if both fail, stop tweaking battery toggles and message your provider. If only Android fails, keep iterating the checklist above.
10 Wrap-up
Random FlClash disconnects on Android are often less mysterious than they feel: the OS is doing exactly what it was tuned to do—aggressively optimizing anything that looks idle, throttling background work under Doze, and bundling network access until a maintenance window. Exempt the client, tame OEM autostart and freeze lists, keep a foreground notification alive, and give the app unrestricted battery and data. After that, use a short, repeatable screen-off test to prove stability before you blame upstream nodes. Compared with haphazard toggling, that order saves hours.
The broader Clash ecosystem on desktop still offers a smoother editing experience for large YAML, while FlClash remains the practical pocket build for LTE and travel. If you have not read it yet, pair this checklist with the install-and-import guide so you are not missing a basic permission. When you are ready to align clients across platforms, fetch maintained builds from the hub instead of chasing random APK mirrors.