Loading...
Loading...
Operate run.cloud iOS simulator and Android emulator sessions with the CLI or TypeScript SDK. Use for creating, installing, inspecting, reading logs, controlling, embedding, smoke-testing, connecting local Metro, taking screenshots, injecting iOS media, or releasing remote mobile sessions.
npx skill4agent add newly-app/run-cloud-examples run-cloud-ios-simulatorruncloud@run-cloud/sdk@runcloud/uinpm install -g runcloudruncloud login--manualRUN_CLOUD_API_KEYRUN_CLOUD_API_TOKENRUN_CLOUD_API_URLhttps://api.run.cloudruncloud account --jsoncloud.account()cloud.usage({ orgId? })SESSION_ID=$(runcloud ios create \
--install ./build/MyApp.tar.gz \
--inactivity-timeout 60s \
--hard-timeout 10m \
--json | jq -r '.id')
trap 'runcloud ios delete "$SESSION_ID" >/dev/null 2>&1 || true' EXIT
runcloud ios get "$SESSION_ID" --jsoniosandroidcreatelistgetopen-urllogsdelete--jsonruncloud ios|android --help.app.zip.tar.gz.iparuncloud ios tap "$SESSION_ID" 0.5 0.3 --json
runcloud ios swipe "$SESSION_ID" 0.5 0.8 0.5 0.2 --duration 300 --json
runcloud ios type-text "$SESSION_ID" 'hello' --json
runcloud ios press-key "$SESSION_ID" enter --json
runcloud ios press-button "$SESSION_ID" home --json
runcloud ios screenshot "$SESSION_ID" --output ios.png --jsontapswipegesturetype-textpress-keypress-buttonrotatereloadscrolltoggle-software-keyboardsimulate-memory-warningrotate-digital-crownset-render-debugscreenshot--request-id--timeout--jsonruncloud <platform> <control> --help(0, 0)(1, 1)beginmoveenddelayMsend0shiftcontrolaltmetacapsLocknumLockscrollLockunsupported_actionnpm install @run-cloud/sdkfinallyimport { writeFile } from "node:fs/promises";
import { Client } from "@run-cloud/sdk";
const cloud = new Client();
const session = await cloud.android.create({
inactivityTimeout: "60s",
hardTimeout: "10m",
tags: { owner: "agent" },
});
try {
await cloud.android.tap(session.id, { x: 0.5, y: 0.3 });
await cloud.android.typeText(session.id, "hello");
await cloud.android.pressKey(session.id, "enter");
const screenshot = await cloud.android.screenshot(session.id);
await writeFile("android.png", screenshot);
} finally {
await cloud.android.delete(session.id);
}cloud.ioscloud.androidcloud.simulatorsinteractrequestIdtimeoutMssignalRunCloudErrorcoderetryablerequestIdactioncreatelistgetopenUrllogsfollowLogsdeletescreenshotuploadVideouploadMicrophoneAudiocloud.ioscreatelistgetopenUrllogsfollowLogsscreenshotcloud.androidruncloud ios logs "$SESSION_ID" --tail 1000
runcloud android logs "$SESSION_ID" --tail 1000--followruncloud ios tunnel "$SESSION_ID" --local-port 8081 --service metro --json
runcloud ios tunnel-status --jsonRemoteControl@runcloud/uiinteractonInteractionResultembed=1loadingGuard=1run-cloud:interactionrun-cloud:interaction-resultrequestIdrun-cloud:interaction-cancelrequestIdactionevent.sourcepostMessageios-simulator:commandios-simulator:session-restart-requestedruncloud sample download ios
runcloud asset push ./build/MyApp.tar.gz --name my-app --json
runcloud asset pull <asset-id>
runcloud ios create --install-asset my-app --json
runcloud demo run eight-device-mosaic --open
runcloud demo run live-camera-relay --open