# execAsRoot

Run a command as root.

```js
execAsRoot(command)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `command` | string | Shell 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](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
