# RemoteC.forApp

Create or reuse a C client for a running app.

```js
RemoteC.forApp(bundleId)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `bundleId` | string | App with automation enabled. |

## Returns

C client sharing the corresponding ObjC session.

## Example

```js
openApp("com.apple.Preferences");
const app = RemoteC.forApp("com.apple.Preferences");
console.log(app.getInfo());
```

## Notes

Advanced API: the declared types must match the real native function. Wrong signatures/addresses can crash the target. No variadic functions, callbacks or arbitrary custom structures. Calls run on the target main thread. See [C functions and memory](/doc/native) for types and ownership.

## Also available as

`C.forApp`.

[All JavaScript APIs](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
