Skip to content

I want to run an rm command on my chromebook from android studio and I tried using all the best possible way. #4

@harshsharma1999

Description

@harshsharma1999

Used this code as well but it says permission denied in android and also in Chromebook it is not running so anyone have any way so that i could just execute a rm command for Chromebook using android studio .
The below are the generally terminal command how to use them in Android Studio.
Shell
"rm -rf /home/chronos/user/Downloads/*"

try {
val su = Runtime.getRuntime().exec("su")
val outputStream = DataOutputStream(su.outputStream)
outputStream.writeBytes("rm -rf /home/chronos/user/Downloads/*")
outputStream.flush()
outputStream.writeBytes("exit\n")
outputStream.flush()
su.waitFor()
} catch (e: IOException) {
throw Exception(e)
} catch (e: InterruptedException) {
throw Exception(e)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions