ApplesauceOS
Read Markdown ↗Download .md

execAsRoot

Run a command as root.

js
execAsRoot(command)

Arguments

ArgumentTypeMeaning
commandstringShell command.

Returns

Combined output string, with the same behavior as exec(command, true).

Example

js
console.log(execAsRoot("id -u"));

Notes

Use only when the task needs root; ordinary commands default to mobile.

All JavaScript APIs · Automation playbook