Use Phone Use
Embed an agent session
Give a natural-language goal to the built-in Phone Use agent loop.
Create a session
import { createSession } from "phone-use";
import { ios } from "@phone-use/sdk";
const device = await ios.launch();
const session = createSession({
device,
onConfirm: (request) => {
console.log(request.summary);
return false;
},
});
const result = await session.prompt(
"Open Settings and read the iOS version"
);
console.log(result.status, result.summary);
await device.close();Requirements
ANTHROPIC_API_KEYmust be set for the built-in agent loop.- The caller owns the device and must close it.
- If
onConfirmis omitted, confirmation-tier actions are denied. - The destructive-action permission floor cannot be disabled.