First, determine whether the client or the core is exiting

Launch it once and note the time. Then check the tray or menu bar icon and look for the process in Task Manager or Activity Monitor. If the window disappears but the tray icon still opens, it may simply be hidden or minimized to the tray. If the UI is still running but the log shows core exited, start with the core output. If the UI process also disappears, check the operating system's crash reports first. If the process and local listeners are healthy but node tests time out, troubleshoot the connection instead.

Client and system log locations
SystemWhere to lookWhat to check first
Windows If the UI opens, look for “Logs” or an app-data folder shortcut in Settings. If it won't open, press Win + R, run perfmon /rel, or open Event Viewer → Windows Logs → Application. The faulting application name, exception code, and timestamp. If the report names the core process, check its log from the same time.
macOS Open Applications → Utilities → Console and check the crash reports. You can also use Finder's Go to Folder command to open ~/Library/Logs/DiagnosticReports/. The process name and termination reason in the report. A normal exit may not produce a crash report; in that case, check the client logs first.
Linux On desktop, launch the client from a terminal using its usual startup command and capture standard error. If it runs under systemd, use journalctl --user -b -n 100 to view recent user logs from this boot. For a system service, check the system journal without --user. The actual service unit name, exit status, and first error. Once you know the unit name, narrow the results with -u.
Android / iOS If the Android UI is available, check the in-app logs. If ADB is already set up, reproduce the crash and run adb logcat -b crash -d to view the crash buffer. On iOS, check the relevant entry under Settings → Privacy & Security → Analytics & Improvements → Analytics Data. Distinguish an app crash from a VPN extension that starts and then disconnects; use the timestamp to find the relevant entry. If there is no crash report, check the app's connection logs.

Capture the details first: Note the client version, core version (if shown in the UI or logs), and any changes made around the last successful launch. Before sharing logs, redact subscription URLs, node credentials, and the controller secret. Keep timestamps, line numbers, ports, and the exact error text.

Cause 1: Invalid config syntax or rule references

If you see yaml: line 24, did not find expected key, or cannot unmarshal, first identify which config file the error refers to. Many GUI clients combine subscriptions and overrides into a runtime config at startup. A subscription that imports successfully may still produce a config that cannot be loaded. Use the path shown in the startup log, back up the original, and inspect a copy in an editor.

  1. Check two or three lines above the reported line for a missing colon, an unclosed quote, or misaligned list markers such as -. Use spaces for indentation and keep it consistent at each level. The parser reports where it detected the problem, which may not be where the mistake was made.
  2. If the YAML parses, check field types, policy group names referenced by rules, and support in your core. For example, if a rule targets Proxy but the policy group is named PROXY, make the names match. Don't use the field list for another Clash core to validate a mihomo config.
  3. On desktop, if you can run the same mihomo version directly, use the command below from the directory containing a copy of the config. If the log points to a generated config, test that output—not just the original subscription file. Configs with relative resource paths must also use the same working directory as the client; mihomo lets you set its home directory with -d.
mihomo -t -f ./config-test.yaml

To see whether the subscription is the source of the problem, save the minimal config below and use it with a mihomo client that supports local configs. It contains only direct-connection rules—no nodes, remote rule sets, or TUN settings. Before testing it, turn off the client's system proxy and TUN to avoid changing your normal traffic route. If the minimal config starts, restore required settings one at a time. If the error is still about binding a port, continue to the next section.

config-test.yaml
mixed-port: 7890
allow-lan: false
mode: rule
rules:
  - MATCH,DIRECT

Cause 2: A proxy or controller port is already in use

If the log shows address already in use, identify the process using the address, protocol, and port shown after bind or listen. The example below checks TCP 7890; it isn't a default for every client. If the log reports 127.0.0.1:9090 and that address is set as external-controller in the config, check the controller port instead of changing mixed-port.

Find the process using a port

  • Windows PowerShell: Get-NetTCPConnection -State Listen -LocalPort 7890. Check OwningProcess, then match the PID to a program name under Task Manager → Details.
  • macOS: lsof -nP -iTCP:7890 -sTCP:LISTEN. Check COMMAND and the PID; don't assume which client owns a process based on the port number alone.
  • Linux: ss -ltnp 'sport = :7890'. A regular user may not see process names for other accounts, but the listening address can still confirm whether the port is in use.

If an older client is using the port, quit it normally from the tray or menu bar, then run the same check again to confirm the listener is gone. If another program that must keep running owns the port, choose one that isn't already listening for the current client—for example, 7891. If you change the proxy port, update the system proxy and any apps configured to use it. If you change the controller port, update the address in external dashboards. Don't terminate a process if you don't know what owns it.

Cause 3: Missing core files or an architecture mismatch

If the UI appears but the log says failed to spawn or executable file not found, compare the reported path with the installation directory. A working launcher doesn't guarantee the separate core file is present. This can happen if only the main program was copied from an archive, an update left an outdated path, or security software quarantined the file. If you see no such file or directory even though the file exists, Linux may be missing its dynamic loader; don't assume the core was deleted based on that message alone.

  1. Check the core path listed in the log. For a portable version, use the fully extracted directory; don't launch the app from an archive preview window. If the client includes core management, use its built-in repair or core selection option first.
  2. If you see exec format error or bad CPU type in executable, check your OS, processor architecture, and the package's target architecture. On Windows, check Settings → System → About for System type. On macOS, check the chip under Apple menu → About This Mac. On Linux, run uname -m; common results include x86_64 and aarch64.
  3. If security software logged a block, review the reason and verify the publisher and version. After preserving any needed config, repair the installation with a complete package from a trusted source that matches your client. Don't disable system protection to test the launch or replace the core with one from an unrelated client.

Cause 4: Insufficient permissions for the data directory or TUN

If you see permission denied, access is denied, or operation not permitted, first check what action the error refers to. Failing to write a log, launch an executable, or create a virtual network interface can all produce permission errors, but each requires a different fix.

  • Can't write to the data directory: Check the exact file and parent directory named in the log. If a portable version is in a read-only or protected installation folder, move it to a location your user account can write to. On Linux, if you previously launched the client as root, use ls -ld with the reported directory path to check ownership. Only change ownership of the app's data directory if you've confirmed it belongs to that app.
  • Core file isn't executable: On macOS or Linux, check the file's execute permissions and whether the volume allows apps to run. If the system blocks the app from opening, check the warning and software source; prefer a release built for your current system.
  • Only fails when TUN is enabled: Turn off TUN in the UI if possible, then restart and test the regular proxy listener. If that works, follow the client docs to check service mode, system network extension permissions, or Linux access to the TUN device. On mobile, confirm system VPN permission is granted and disconnect any other active VPN before testing again.

Grant permissions only to the components that need them. Running the entire client as administrator or root long-term can hide data-directory ownership problems and prevent a regular user from writing files the next time.

Cause 5: An old client service or startup item is still running

If a new client reports that a service is already running, connects to an old core, or finds its port occupied again as soon as you close the old process, check what is relaunching it. Closing a window doesn't necessarily stop its background service. Ending a process once in Task Manager won't disable a service's automatic restart either.

  1. On Windows, run services.msc and check suspicious entries' properties and executable paths. Also look for the old client under Task Manager → Startup apps. On macOS, check System Settings → General → Login Items & Extensions for login items and background items; some versions label this section Login Items. On Linux, use systemctl --user list-units --type=service to find user services. For system services, run the query without --user.
  2. Once you've confirmed an entry belongs to the old client, use its Service Mode uninstall option or the uninstaller from its original package. If you aren't sure whether the clients share a helper component, stop the confirmed old service and test first; don't rush to delete service definitions or helper programs.
  3. Launch only the client you intend to keep. Recheck the conflicting port and confirm the listening process path and core path in the new logs. If the old process doesn't return after a system restart, restore the system proxy or TUN settings you need.

Verify the fix in three steps

  1. Check startup: With both the system proxy and TUN off, launch the client. Confirm the logs aren't showing repeated restarts and that the expected port is being used by the current core. An open window is only the first step; make sure the core actually started.
  2. Check the config: Restore the original subscription or overrides and restart once. If the problem returns only after restoring a particular item, compare the runtime config before and after it takes effect. There's no need to reinstall the client.
  3. Check traffic routing: Restore only one required feature at a time. If you use the system proxy, check that apps route through it as expected. If you use TUN, review the logs and connection after enabling it. After quitting the client, confirm the system proxy has returned to its previous state.

If it still crashes, include your OS version, client and core versions, steps to reproduce, and the first error from that launch along with a few surrounding log lines. The first error is more useful than the final “startup failed” message for distinguishing a config issue from a core exit or UI crash.