{"record":{"id":"0070a3f08ad0702d","repo":"MuntashirAkon/AppManager","slug":"executablepath-does-not-exists","errorCode":null,"errorMessage":"${executablePath} does not exists!","messagePattern":"(.+?) does not exists!","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/servermanager/ServerConfig.java","lineNumber":109,"sourceCode":"            String token = getLocalToken();\n            String amJarName = Constants.JAR_NAME;\n            String mainJarName = Constants.MAIN_JAR_NAME;\n            String appId = BuildConfig.APPLICATION_ID;\n            int currentUserId = UserHandleHidden.myUserId();\n            int debug = BuildConfig.DEBUG ? 1 : 0;\n\n            return String.format(Locale.ROOT, \"%s %d %s %s %s %s %d %d\",\n                    executable.getAbsolutePath(),\n                    port,\n                    token,\n                    amJarName,\n                    mainJarName,\n                    appId,\n                    currentUserId,\n                    debug\n            );\n        }\n        throw new UnsupportedOperationException(executable.getAbsolutePath() + \" does not exists!\");\n    }\n\n    /**\n     * Get existing or generate new 16-digit token for client session\n     *\n     * @return Existing or new token\n     */\n    @AnyThread\n    @NonNull\n    public static String getLocalToken() {\n        String token = sPreferences.getString(LOCAL_TOKEN, null);\n        if (TextUtils.isEmpty(token)) {\n            token = generateToken();\n            sPreferences.edit().putString(LOCAL_TOKEN, token).apply();\n        }\n        return token;\n    }\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/servermanager/ServerConfig.java#L91-L127","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Call ServerConfig.init(...) first so binaries are extracted to their expected paths","Check new File(executable.getPath()).exists() for the mode-specific binary before building the command","Switch the mode of operation (Ops.setMode) to one whose executable exists, e.g. ADB mode on non-rooted devices","Verify the su binary exists (which su / LibUtils/BusyBox check) before selecting root mode"],"exampleFix":"// before\nString[] cmd = ServerConfig.getServerRunnerCommand(...);\n// after\nif (!new File(ServerConfig.getExecutablePath(mode)).exists()) {\n    ServerConfig.init(context, false); // extract binaries first\n}\nString[] cmd = ServerConfig.getServerRunnerCommand(...);","handlingStrategy":"validation","validationCode":"File exe = new File(executablePath);\nif (!exe.exists() || !exe.canExecute()) {\n    // extract assets via ServerConfig.init or switch mode\n}","typeGuard":null,"tryCatchPattern":"try {\n    String[] cmd = ServerConfig.getServerRunnerCommand(...);\n} catch (UnsupportedOperationException e) {\n    // e.getMessage() names the missing executable; re-extract or change mode\n    ServerConfig.init(context, true);\n}","preventionTips":["Always call ServerConfig.init before building server commands","Match the mode of operation to actual device capabilities (rooted vs not)","Check executable existence with File.exists() at startup","Log the absolute path from the exception message when diagnosing"],"tags":["android","filesystem","server"],"backgroundTag":"file-not-found","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}