MuntashirAkon/AppManager · error · java.lang.UnsupportedOperationException

does not exists!

Error message

${executablePath} does not exists!

What it means

getServerRunnerCommand builds the command line to launch the AM server based on the mode of operation; it requires a specific executable file (root su binary, adb executable, or applet) to exist on disk. If the resolved executable's path does not exist, an UnsupportedOperationException naming the missing path is thrown.

Solutions

  1. Call ServerConfig.init(...) first so binaries are extracted to their expected paths
  2. Check new File(executable.getPath()).exists() for the mode-specific binary before building the command
  3. Switch the mode of operation (Ops.setMode) to one whose executable exists, e.g. ADB mode on non-rooted devices
  4. Verify the su binary exists (which su / LibUtils/BusyBox check) before selecting root mode

Example fix

// before
String[] cmd = ServerConfig.getServerRunnerCommand(...);
// after
if (!new File(ServerConfig.getExecutablePath(mode)).exists()) {
    ServerConfig.init(context, false); // extract binaries first
}
String[] cmd = ServerConfig.getServerRunnerCommand(...);
Defensive patterns

Strategy: validation

Validate before calling

File exe = new File(executablePath);
if (!exe.exists() || !exe.canExecute()) {
    // extract assets via ServerConfig.init or switch mode
}

Try / catch

try {
    String[] cmd = ServerConfig.getServerRunnerCommand(...);
} catch (UnsupportedOperationException e) {
    // e.getMessage() names the missing executable; re-extract or change mode
    ServerConfig.init(context, true);
}

Prevention

When it happens

Trigger: Requesting a server runner command while the expected executable — e.g. the 'su' binary for root mode, the copied applet jar, or the adb executable — is absent from its resolved absolute path.

Common situations: Running on a non-rooted device while root mode is selected, Magisk/su not installed, the app's binary assets not yet extracted (init not called), or an architecture without a bundled applet.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/0070a3f08ad0702d. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/servermanager/ServerConfig.java:109

            String token = getLocalToken();
            String amJarName = Constants.JAR_NAME;
            String mainJarName = Constants.MAIN_JAR_NAME;
            String appId = BuildConfig.APPLICATION_ID;
            int currentUserId = UserHandleHidden.myUserId();
            int debug = BuildConfig.DEBUG ? 1 : 0;

            return String.format(Locale.ROOT, "%s %d %s %s %s %s %d %d",
                    executable.getAbsolutePath(),
                    port,
                    token,
                    amJarName,
                    mainJarName,
                    appId,
                    currentUserId,
                    debug
            );
        }
        throw new UnsupportedOperationException(executable.getAbsolutePath() + " does not exists!");
    }

    /**
     * Get existing or generate new 16-digit token for client session
     *
     * @return Existing or new token
     */
    @AnyThread
    @NonNull
    public static String getLocalToken() {
        String token = sPreferences.getString(LOCAL_TOKEN, null);
        if (TextUtils.isEmpty(token)) {
            token = generateToken();
            sPreferences.edit().putString(LOCAL_TOKEN, token).apply();
        }
        return token;
    }

View on GitHub (pinned to 0152f468fc)