### Install Application Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/quick-start.md Install an application from a .app or .ipa file onto a simulator or emulator. ```sh simdeck install /path/to/App.app ``` ```sh simdeck install /path/to/App.ipa ``` -------------------------------- ### Install Application Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Installs an application package onto the simulator. ```sh ./build/simdeck install /path/to/App.app ``` -------------------------------- ### Install App Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Installs an application on a simulator using a provided app path. ```APIDOC ## POST /api/simulators/{udid}/install ### Description Installs an application on a simulator by providing the path to the application bundle. ### Method POST ### Endpoint /api/simulators/{udid}/install ### Parameters #### Path Parameters - **udid** (string) - Required - The unique identifier of the simulator. #### Request Body - **appPath** (string) - Required - The absolute path to the application bundle (e.g., \"/path/to/App.app\"). ``` -------------------------------- ### Clone and Install SimDeck Source: https://github.com/nativescript/simdeck/blob/main/docs/contributing.md Clone the SimDeck repository, navigate into the directory, install dependencies, and build the project. ```sh git clone https://github.com/NativeScript/SimDeck.git cd SimDeck npm install npm run build ``` -------------------------------- ### SimDeck Example Response Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Example JSON response when starting the SimDeck service, including pairing code, process ID, and service URL. ```json { "ok": true, "pairingCode": "401974", "pid": 91285, "projectRoot": "-", "started": true, "url": "http://127.0.0.1:4310" } ``` -------------------------------- ### Start Camera Simulation with Webcam Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Start camera simulation using a specified webcam. Webcam support requires macOS camera permissions for SimDeck. ```bash simdeck camera start com.example.App --webcam "FaceTime HD Camera" ``` -------------------------------- ### Install App via Upload Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Installs an application on a simulator by uploading the raw application file (IPA for iOS, APK for Android). ```APIDOC ## POST /api/simulators/{udid}/install-upload ### Description Installs an application on a simulator by uploading the raw application file. This method is intended for browser clients. iOS simulator uploads must be `.ipa` archives; Android emulator uploads must be `.apk` files. The filename should be provided in the `x-simdeck-filename` header. ### Method POST ### Endpoint /api/simulators/{udid}/install-upload ### Parameters #### Path Parameters - **udid** (string) - Required - The unique identifier of the simulator. #### Headers - **x-simdeck-filename** (string) - Required - The filename of the uploaded application (e.g., \"App.ipa\"). #### Request Body Raw `.ipa` or `.apk` bytes. ``` -------------------------------- ### Enable SimDeck Autostart Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/service.md Installs or refreshes the macOS LaunchAgent so SimDeck starts automatically after login. `simdeck pair` also detects LAN and Tailscale addresses and prints pairing information. ```sh simdeck -a simdeck --autostart simdeck pair ``` -------------------------------- ### Boot Simulator Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Starts a specific simulator. ```sh ./build/simdeck boot ``` -------------------------------- ### Install App via Path Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Use this endpoint to install an application on a simulator using its path. Ensure the path points to a valid application archive. ```json { "appPath": "/path/to/App.app" } ``` -------------------------------- ### Install Application Source: https://github.com/nativescript/simdeck/blob/main/README.md Installs an application on the simulator. Supports .app (iOS), .ipa (iOS), and .apk (Android) formats. ```sh simdeck install /path/to/App.app simdeck install /path/to/App.ipa simdeck install android: /path/to/app.apk ``` -------------------------------- ### Start SimDeck with Specific Simulator Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/quick-start.md Open a specific simulator by its name or UDID when starting SimDeck. ```sh simdeck "iPhone 17 Pro Max" ``` ```sh simdeck 9750DF52-0471-48FF-B49A-B184C4BD3A3D ``` -------------------------------- ### Start Camera Simulation Source: https://github.com/nativescript/simdeck/blob/main/docs/cli/commands.md Starts a camera feed for an application using a file or webcam. This is iOS-simulator-only. ```sh simdeck camera start com.example.App --file /absolute/path/to/feed.mov --mirror off simdeck camera start com.example.App --webcam ``` -------------------------------- ### Start SimDeck Server Source: https://github.com/nativescript/simdeck/blob/main/docs/extensions/browser-client.md Run this command in your terminal to start the SimDeck server. After execution, open the printed local URL in your browser. ```sh simdeck ``` -------------------------------- ### Install and Launch Android App Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/quick-start.md Install and launch an Android application using its AVD name and APK file. ```sh simdeck install android: /path/to/app.apk ``` ```sh simdeck launch android: com.example.app ``` -------------------------------- ### Develop SimDeck Documentation Source: https://github.com/nativescript/simdeck/blob/main/docs/contributing.md Start a local development server to preview the SimDeck documentation site. ```sh npm run docs:dev ``` -------------------------------- ### Start SimDeck and Open Directly Source: https://github.com/nativescript/simdeck/blob/main/docs/extensions/browser-client.md This command starts the SimDeck server and automatically opens the browser client to the default local URL. ```sh simdeck --open ``` -------------------------------- ### Install SimDeck CLI Globally Source: https://github.com/nativescript/simdeck/blob/main/README.md Install the SimDeck CLI globally on your system for agentic use. Ensure you have npm installed. ```sh npm i -g simdeck@latest ``` -------------------------------- ### Install x264 for Source Builds Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/installation.md Install the x264 library using Homebrew, which is a dependency for building SimDeck from source. ```sh brew install x264 ``` -------------------------------- ### Preview Built Documentation Source: https://github.com/nativescript/simdeck/blob/main/CONTRIBUTING.md Starts a local server to preview the built documentation site. Use this to check the final output before deployment. ```sh npm run docs:preview ``` -------------------------------- ### Install react-native-simdeck Source: https://github.com/nativescript/simdeck/blob/main/docs/inspector/react-native.md Install the package and its native dependencies for iOS. ```sh npm install react-native-simdeck cd ios && pod install ``` -------------------------------- ### Run Development Server Source: https://github.com/nativescript/simdeck/blob/main/docs/contributing.md Start the SimDeck development server for active development and testing. ```sh npm run dev ``` -------------------------------- ### Install Dependencies and Build from Source Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/installation.md Install npm dependencies and build the SimDeck project from source. This command builds the native CLI and browser client. ```sh npm install npm run build ./build/simdeck ``` -------------------------------- ### Install and Uninstall Applications Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Installs or uninstalls applications on the selected device. Supports .app, .ipa, and .apk formats. ```bash simdeck install /path/to/App.app simdeck install /path/to/App.ipa simdeck install android: /path/to/app.apk simdeck uninstall com.example.App ``` -------------------------------- ### SimDeck Service Start and Options Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Starts the SimDeck background service. Use --open to automatically open the browser, -p to specify a port, and -a to register as a macOS LaunchAgent. ```bash simdeck simdeck --open simdeck -p 4311 simdeck -a ``` -------------------------------- ### Start Simulator Camera Feed Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Starts or updates the camera feed for a simulator with specified settings. ```APIDOC ## POST /api/simulators/{udid}/camera ### Description Starts the camera feed daemon for a simulator. Can optionally relaunch an app with the feed. Accepts a JSON body to configure the feed source and mirroring. ### Method POST ### Endpoint /api/simulators/{udid}/camera ### Parameters #### Path Parameters - **udid** (string) - Required - The unique identifier of the simulator. #### Request Body - **bundleId** (string) - Optional - The bundle identifier of the app to relaunch with the camera feed. - **mirror** (string) - Optional - Controls mirroring. Options: \"auto\", \"on\", \"off\". Defaults to \"off\". - **source** (object) - Required - Configuration for the camera source. - **kind** (string) - Required - The type of source. Options: \"placeholder\", \"image\", \"video\", \"webcam\". - **arg** (string) - Optional - The argument for the source. For \"image\" and \"video\", this is the path to the file. For \"webcam\", this can be a camera ID or name. Omit for default webcam. ### Request Example ```json { "bundleId": "com.example.App", "mirror": "off", "source": { "kind": "video", "arg": "/absolute/path/to/feed.mov" } } ``` ``` -------------------------------- ### Launch Application Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/quick-start.md Launch an installed application by its bundle ID. ```sh simdeck launch com.example.App ``` -------------------------------- ### Install NativeScript SimDeck Inspector Source: https://github.com/nativescript/simdeck/blob/main/packages/nativescript-inspector/README.md Install the inspector package using npm. ```sh npm install @nativescript/simdeck-inspector ``` -------------------------------- ### Select Xcode Installation Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/troubleshooting.md Force Xcode to use a specific installation path. Use this if the wrong Xcode version is selected. ```sh sudo xcode-select -s /Applications/Xcode.app simdeck list ``` -------------------------------- ### Preview SimDeck Locally Source: https://github.com/nativescript/simdeck/blob/main/packages/app-deeplink-pages/README.md Run this command to preview the SimDeck site locally. It starts a development server on port 4311. ```sh npm run dev # http://localhost:4311 ``` -------------------------------- ### Install SimDeck Globally Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/installation.md Install SimDeck globally using npm for regular use. This makes the `simdeck` command available system-wide. ```sh npm install -g simdeck@latest simdeck ``` -------------------------------- ### Install Local SimDeck Checkout Globally Source: https://github.com/nativescript/simdeck/blob/main/CONTRIBUTING.md Install the SimDeck CLI globally from a local source checkout to make the 'simdeck' command available on your system's PATH. ```sh npm install -g . ``` -------------------------------- ### Start Camera Simulation Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Initiates a camera simulation feed for a simulator. Supports various source kinds like video, image, or webcam. Local files must be absolute paths. ```json { "bundleId": "com.example.App", "mirror": "off", "source": { "kind": "video", "arg": "/absolute/path/to/feed.mov" } } ``` -------------------------------- ### Start SimDeck Service Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/service.md Starts or reuses the background service. Use `--open` to open the local browser URL and `-p` or `--port` to select a non-default port (default is 4310). ```sh simdeck simdeck --open simdeck -p 4311 ``` -------------------------------- ### Start SimDeck Inspector Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/troubleshooting.md Manually start the SimDeck inspector with a specific port. Ensure this is called before app bootstrap, especially for Angular. ```javascript startSimDeckInspector({ port: 4310 }) ``` -------------------------------- ### Manual Inspector Start with Options Source: https://github.com/nativescript/simdeck/blob/main/packages/react-native-inspector/README.md Manually start the SimDeck React Native Inspector with explicit port and source root options within a development check. ```ts import { AppRegistry } from "react-native"; import { startSimDeckReactNativeInspector } from "react-native-simdeck"; import App from "./App"; if (__DEV__) { startSimDeckReactNativeInspector({ port: 4310, sourceRoot: "/absolute/path/to/your/app", }); } AppRegistry.registerComponent("Example", () => App); ``` -------------------------------- ### Check SimDeck Prerequisites Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/troubleshooting.md Verify common prerequisites for building SimDeck on macOS. Ensure Xcode, Rust, and Node.js are installed. ```sh xcode-select --install rustc --version node --version ``` -------------------------------- ### Common SimDeck CLI Usage Source: https://github.com/nativescript/simdeck/blob/main/docs/cli/index.md Basic commands to start the SimDeck service, open the UI, select a device, or specify a port. ```sh simdeck simdeck "iPhone 17 Pro Max" simdeck --open simdeck -p 4311 simdeck -a ``` -------------------------------- ### Open URL in App Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/quick-start.md Open a specific URL within an installed application. ```sh simdeck open-url myapp://debug ``` -------------------------------- ### Camera Simulation Source: https://github.com/nativescript/simdeck/blob/main/README.md Starts camera simulation for an iOS app. Requires a booted simulator. Source can be a file, URL, or webcam. ```sh simdeck camera sources simdeck camera start com.example.App --file /absolute/path/to/camera.mov simdeck camera start com.example.App --webcam simdeck camera switch --placeholder simdeck camera stop ``` -------------------------------- ### Perform Action Request Source: https://github.com/nativescript/simdeck/blob/main/docs/api/inspector-protocol.md Example of a View.perform request to execute an action on a specific view. ```json { "id": 3, "method": "View.perform", "params": { "id": "view:0x1234", "action": "tap" } } ``` -------------------------------- ### Quick Try with npx Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/installation.md Use `npx` to run SimDeck without a global installation. This is useful for testing or trying out the latest version. ```sh npx simdeck ``` -------------------------------- ### Start Inspector with Manual Entrypoint Source: https://github.com/nativescript/simdeck/blob/main/docs/inspector/react-native.md Import the auto entrypoint and register the app component manually. ```ts import "react-native-simdeck/auto"; import { AppRegistry } from "react-native"; import App from "./App"; AppRegistry.registerComponent("Example", () => App); ``` -------------------------------- ### Create and Boot Simulator/Emulator Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Creates and boots a new simulator or emulator. Device configurations are specified using identifiers obtained from the `/api/simulators/create-options` endpoint. ```APIDOC ## POST /api/simulators ### Description Create and boot a simulator or emulator. ### Method POST ### Endpoint /api/simulators ### Request Body - **platform** (string) - Required - The platform of the device to create (e.g., "ios", "android"). - **name** (string) - Required - The name for the new simulator or emulator. - **deviceTypeIdentifier** (string) - Required - The identifier for the device type. - **runtimeIdentifier** (string) - Required - The identifier for the runtime. - **pairedWatch** (object) - Optional - Configuration for a paired Apple Watch. - **name** (string) - Required - The name for the paired watch. - **deviceTypeIdentifier** (string) - Required - The device type identifier for the watch. - **runtimeIdentifier** (string) - Required - The runtime identifier for the watch. - **androidEmulatorArgs** (array) - Optional - Arguments to pass to the Android emulator on startup. - **androidDisableAudio** (boolean) - Optional - Whether to disable audio for the Android emulator. Defaults to true. ### Request Example ```json { "platform": "ios", "name": "iPhone Air", "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.iPhone-Air", "runtimeIdentifier": "com.apple.CoreSimulator.SimRuntime.iOS-26-4", "pairedWatch": { "name": "Apple Watch Series 11 (46mm)", "deviceTypeIdentifier": "com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-11-46mm", "runtimeIdentifier": "com.apple.CoreSimulator.SimRuntime.watchOS-26-4" } } ``` ```json { "platform": "android", "name": "Pixel_8_API_36", "deviceTypeIdentifier": "pixel_8", "runtimeIdentifier": "system-images;android-36;google_apis;arm64-v8a", "androidEmulatorArgs": ["-no-snapshot"], "androidDisableAudio": true } ``` ``` -------------------------------- ### Check SimDeck Version and Status Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/troubleshooting.md Verify your SimDeck installation and service status. Use these commands for initial diagnostics. ```sh simdeck --version xcode-select -p simdeck service status simdeck list ``` -------------------------------- ### Fetch Simulators List Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Example using curl to fetch the list of simulators from the SimDeck API. Ensure the X-SimDeck-Token header is set. ```sh curl -H "X-SimDeck-Token: $SIMDECK_TOKEN" \ http://127.0.0.1:4310/api/simulators ``` -------------------------------- ### Select and Boot Devices Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Selects a device for the current workspace or boots a specific device. Supports UDID, AVD names, and custom emulator arguments. ```bash simdeck use simdeck boot simdeck boot android: --android-emulator-arg=-no-snapshot ``` -------------------------------- ### Update SimDeck Installation Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/installation.md Update SimDeck to the latest version by running the install command again. ```sh npm install -g simdeck@latest ``` -------------------------------- ### Simulate Pasteboard Operations Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Commands to set or get content from the device's pasteboard. ```bash simdeck pasteboard set 'text' ``` ```bash simdeck pasteboard get ``` -------------------------------- ### View Simulator Processes and Samples Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md List current simulator processes or capture a short CPU stack sample. The `sample` command may introduce a pause. ```bash simdeck chrome-profile ``` ```bash simdeck processes ``` ```bash simdeck sample --seconds 3 ``` -------------------------------- ### SimDeck CLI: Inspecting Agent Hierarchy Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Use 'simdeck describe' to get a diagnostic snapshot of the agent's hierarchy. Options control formatting, depth, and source. ```bash simdeck describe simdeck describe --format agent --max-depth 4 simdeck describe --format agent --max-depth 4 --interactive simdeck snapshot --format agent --max-depth 4 -i simdeck describe --format compact-json simdeck describe --point 120,240 simdeck describe --source auto simdeck describe --source nativescript|react-native|flutter|swiftui|uikit simdeck describe --source native-ax simdeck describe --source android-uiautomator simdeck describe --direct ``` -------------------------------- ### UI Element with Source Location Source: https://github.com/nativescript/simdeck/blob/main/docs/api/inspector-protocol.md Example of a UI element representation that includes source file location details. ```json { "type": "Label", "title": "Continue", "sourceLocation": { "file": "src/app/home.component.html", "line": 12, "column": 5 } } ``` -------------------------------- ### Start Inspector with Explicit Options Source: https://github.com/nativescript/simdeck/blob/main/docs/inspector/react-native.md Manually start the SimDeck React Native inspector with a specified port. ```ts import { startSimDeckReactNativeInspector } from "react-native-simdeck"; if (__DEV__) { startSimDeckReactNativeInspector({ port: 4310 }); } ``` -------------------------------- ### List Create Options Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Lists available device types and runtimes that can be used for creating new simulators or emulators. ```APIDOC ## GET /api/simulators/create-options ### Description List device types and runtimes for create. ### Method GET ### Endpoint /api/simulators/create-options ``` -------------------------------- ### Build Project Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Builds the entire native CLI and browser bundle for the project. ```sh npm run build ``` -------------------------------- ### Check Xcode Selection Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/installation.md Verify the currently selected Xcode installation. This is important if you have multiple Xcode versions installed. ```sh xcode-select -p ``` -------------------------------- ### SimDeck CLI Commands Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/index.md Common SimDeck CLI commands for managing devices and applications. Use these after starting the SimDeck service. ```sh simdeck list ``` ```sh simdeck use ``` ```sh simdeck boot ``` ```sh simdeck install /path/to/App.app ``` ```sh simdeck install /path/to/App.ipa ``` ```sh simdeck launch com.example.App ``` ```sh simdeck tap --label "Continue" --wait-timeout-ms 5000 ``` ```sh simdeck tap "Continue" ``` ```sh simdeck back ``` ```sh simdeck describe --format agent --max-depth 3 --interactive ``` -------------------------------- ### List Simulators Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Lists all available simulators. ```sh ./build/simdeck list ``` -------------------------------- ### Start Camera Simulation Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/testing.md Initiate camera simulation for iOS apps using AVFoundation. Specify the app's bundle ID, the video feed path, and optionally disable mirroring. ```sh simdeck camera start com.example.App --file /absolute/path/to/feed.mov --mirror off ``` -------------------------------- ### Start MP4 screen recording Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Starts an MP4 screen recording and returns a `recordingId` that can be used to stop the recording later. ```APIDOC ## POST /api/simulators/{udid}/screen-recording/start ### Description Starts an MP4 screen recording and returns a `recordingId`. ### Method POST ### Endpoint /api/simulators/{udid}/screen-recording/start ### Parameters #### Path Parameters - **udid** (string) - Required - The unique identifier of the simulator. ### Response #### Success Response (200) - recordingId (string) - The identifier for the ongoing recording. ``` -------------------------------- ### Start SimDeck Inspector for Angular Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/troubleshooting.md Start the SimDeck inspector before running the Angular NativeScript app. Ensures proper connection. ```javascript startSimDeckInspector({ port: 4310 }) // For Angular: runNativeScriptAngularApp(...) ``` -------------------------------- ### Build SimDeck Documentation Source: https://github.com/nativescript/simdeck/blob/main/docs/contributing.md Build the static assets for the SimDeck documentation site. ```sh npm run docs:build ``` -------------------------------- ### Run Local Service Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Starts or reuses the background SimDeck service. Prints local and LAN URLs and a pairing code. Can select a simulator by name or UDID. ```sh ./build/simdeck ./build/simdeck -p 4311 ``` -------------------------------- ### Get Stream Quality Settings Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md View the current stream quality settings by making a GET request to the /api/stream-quality endpoint. ```text GET /api/stream-quality ``` -------------------------------- ### Setup Codex Local Environment Source: https://github.com/nativescript/simdeck/blob/main/CONTRIBUTING.md Initializes the Codex local environment for SimDeck development. This script hydrates node_modules and target directories, falling back to 'npm ci' if necessary. ```sh npm run codex:setup ``` -------------------------------- ### Start SimDeck Inspector in NativeScript App Source: https://github.com/nativescript/simdeck/blob/main/packages/nativescript-inspector/README.md Import and start the inspector within your NativeScript application. Ensure this is only done in development mode. ```ts import { startSimDeckInspector } from "@nativescript/simdeck-inspector"; if (__DEV__) { startSimDeckInspector({ port: 4310, sourceRoot: "/absolute/path/to/your/app", }); } ``` -------------------------------- ### SimDeck LAN Access with Hostnames Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/lan-access.md Demonstrates starting SimDeck with different hostnames or IP addresses advertised for LAN access. Choose a value that the remote device can resolve. ```sh simdeck --bind 0.0.0.0 --advertise-host my-mac.local --open ``` ```sh simdeck --bind 0.0.0.0 --advertise-host 192.168.1.50 --open ``` ```sh simdeck --bind 0.0.0.0 --advertise-host 100.101.102.103 --open ``` -------------------------------- ### Launch and Open URLs Source: https://github.com/nativescript/simdeck/blob/main/skills/simdeck/SKILL.md Launches an application by its bundle ID or opens a URL in the device's default browser. ```bash simdeck launch com.example.App simdeck open-url myapp://route simdeck open-url https://example.com ``` -------------------------------- ### Run Experimental SwiftUI Preview Runner Source: https://github.com/nativescript/simdeck/blob/main/docs/inspector/swift.md Launch the experimental SwiftUI preview runner from the command line to facilitate local development. Specify the simulator UDID, the file containing the preview, and enable watch mode. ```sh npm run preview:swiftui -- \ --udid \ --file Sources/MyFeature/MyView.swift \ --preview "Default" \ --watch ``` -------------------------------- ### List Simulators Source: https://github.com/nativescript/simdeck/blob/main/README.md Lists available simulators. Defaults to compact JSON. Use --format json for full details. ```sh simdeck list simdeck list --format json ``` -------------------------------- ### Get Server Health Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Retrieve the server's health status, version information, and stream configuration using a GET request to the /api/health endpoint. ```text GET /api/health ``` -------------------------------- ### Build SimDeck CLI from Source Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/troubleshooting.md Build the SimDeck CLI from a source checkout. Use this if you are developing SimDeck itself. ```sh npm run build:cli ``` -------------------------------- ### Start Inspector for Angular NativeScript Apps Source: https://github.com/nativescript/simdeck/blob/main/docs/inspector/nativescript.md For Angular NativeScript apps, start the inspector before calling runNativeScriptAngularApp. This ensures the inspector is active when the Angular app initializes. ```ts import { startSimDeckInspector } from "@nativescript/simdeck-inspector"; startSimDeckInspector({ port: 4310 }); runNativeScriptAngularApp({ appModuleBootstrap: () => bootstrapApplication(AppComponent), }); ``` -------------------------------- ### SimDeck Command Structure Source: https://github.com/nativescript/simdeck/blob/main/docs/cli/index.md Illustrates the general syntax for invoking SimDeck commands, including device selection and command execution. ```sh simdeck [SIMULATOR_NAME_OR_UDID] simdeck [-p ] [--open] [--autostart] simdeck [--server-url ] [options] ``` -------------------------------- ### List, Use, and Boot Devices Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/quick-start.md Manage simulators and emulators using the CLI. 'simdeck use ' sets the default device for the current project directory. ```sh simdeck list ``` ```sh simdeck use ``` ```sh simdeck boot ``` -------------------------------- ### Build and Test iOS Integration Source: https://github.com/nativescript/simdeck/blob/main/docs/contributing.md Build the CLI and client, then run integration tests for iOS. ```sh npm run build:cli npm run build:client npm run test:integration:cli ``` -------------------------------- ### Install Local VS Code Extension Source: https://github.com/nativescript/simdeck/blob/main/CONTRIBUTING.md Install the locally packaged SimDeck VS Code extension into your VS Code environment. This command may package the extension first if the .vsix file does not exist. ```sh npm run install:vscode-extension # or: npm run install:vscode ``` -------------------------------- ### Open URL Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Opens a given URL within the simulator's default browser. ```sh ./build/simdeck open-url https://example.com ``` -------------------------------- ### Start SimDeck Flutter Inspector Source: https://github.com/nativescript/simdeck/blob/main/docs/inspector/flutter.md Initialize and start the SimDeck Flutter Inspector in your Flutter application's main function. Ensure this is only done in debug builds. The inspector listens on the specified port for SimDeck connections. ```dart import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:simdeck_flutter_inspector/simdeck_flutter_inspector.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); if (kDebugMode) { startSimDeckFlutterInspector(port: 4310); } runApp(const App()); } ``` -------------------------------- ### Manage Simulator Lifecycle Source: https://github.com/nativescript/simdeck/blob/main/docs/cli/commands.md Commands to select, boot, shut down, and erase simulators. ```sh simdeck use simdeck boot simdeck boot android: --android-emulator-arg=-no-snapshot simdeck shutdown simdeck erase ``` -------------------------------- ### Start SimDeck Flutter Inspector in Debug Builds Source: https://github.com/nativescript/simdeck/blob/main/packages/flutter-inspector/README.md Initialize and start the inspector during app startup in debug mode. Ensure WidgetsFlutterBinding is initialized before calling this function. The 'sourceRoot' parameter is crucial for publishing absolute file paths when Flutter reports relative ones. ```dart import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:simdeck_flutter_inspector/simdeck_flutter_inspector.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); if (kDebugMode) { startSimDeckFlutterInspector( port: 4310, sourceRoot: '/absolute/path/to/your/app', ); } runApp(const App()); } ``` -------------------------------- ### Boot Simulator/Emulator Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Boots a specific simulator or emulator identified by its UDID. ```APIDOC ## POST /api/simulators/{udid}/boot ### Description Boot a simulator or emulator. ### Method POST ### Endpoint /api/simulators/{udid}/boot ### Parameters #### Path Parameters - **udid** (string) - Required - The unique device identifier (UDID) of the simulator or emulator to boot. ``` -------------------------------- ### Android Emulator Boot Arguments Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Optional arguments for booting an Android emulator. Configuration can be overridden by request arguments. ```json { "androidEmulatorArgs": ["-no-snapshot"], "androidDisableAudio": true } ``` -------------------------------- ### Get Metrics Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Retrieves statistics for video, encoder, and client streams. ```APIDOC ## GET /api/metrics ### Description Retrieves video, encoder, and client stream counters. ### Method GET ### Endpoint /api/metrics ``` -------------------------------- ### Capture Process CPU Sample Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Captures a short CPU stack sample for a specific simulator process using the `sample` command. ```APIDOC ## POST /api/simulators/{udid}/processes/{pid}/sample ### Description Capture a short CPU stack sample with the `sample` command for a specific simulator process. ### Method POST ### Endpoint /api/simulators/{udid}/processes/{pid}/sample ### Parameters #### Path Parameters - **udid** (string) - Required - The unique identifier of the simulator. - **pid** (integer) - Required - The process identifier. #### Query Parameters - **seconds** (integer) - Optional - Stack sample duration. ``` -------------------------------- ### Pasteboard Operations Source: https://github.com/nativescript/simdeck/blob/main/README.md Sets or gets content from the simulator's pasteboard. ```sh simdeck pasteboard set "hello" simdeck pasteboard get ``` -------------------------------- ### Swipe Gesture Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Simulates a swipe gesture with specified start and end coordinates. ```sh ./build/simdeck swipe 200 700 200 200 ``` -------------------------------- ### Build All SimDeck Components Source: https://github.com/nativescript/simdeck/blob/main/CONTRIBUTING.md Execute this command to build the entire SimDeck project, including the application, inspector packages, and the simdeck-test helper. This command encompasses the default build plus additional components. ```sh npm run build:all # build:app + build:packages ``` -------------------------------- ### Get Stream Quality Settings Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Retrieves the current stream quality settings. ```APIDOC ## GET /api/stream-quality ### Description Gets the current stream quality settings. ### Method GET ### Endpoint /api/stream-quality ``` -------------------------------- ### Build SimDeck App (CLI + Client) Source: https://github.com/nativescript/simdeck/blob/main/CONTRIBUTING.md Use this command to build the main application, which includes the native CLI and the browser client. This is the default build target. ```sh npm run build # alias for build:app (CLI + client) ``` -------------------------------- ### Connect SimDeck Provider to Studio Source: https://github.com/nativescript/simdeck/blob/main/docs/cli/commands.md Connect a SimDeck provider to a hosted Studio instance. Requires the Studio URL, host ID, and host token. ```sh simdeck provider connect --studio-url --host-id --host-token ``` -------------------------------- ### Get Client Stream Statistics Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Retrieves recent statistics reported by clients. ```APIDOC ## GET /api/client-stream-stats ### Description Retrieves recent client stream reports. ### Method GET ### Endpoint /api/client-stream-stats ``` -------------------------------- ### Get Pasteboard Content Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Retrieves the current content of the simulator's pasteboard. ```sh ./build/simdeck pasteboard get ``` -------------------------------- ### Add simdeck_flutter_inspector dependency Source: https://github.com/nativescript/simdeck/blob/main/docs/inspector/flutter.md Install the simdeck_flutter_inspector package using the Flutter package manager. ```sh flutter pub add simdeck_flutter_inspector ``` -------------------------------- ### Get pasteboard text Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Retrieves the current text content of the simulator's pasteboard. ```APIDOC ## GET /api/simulators/{udid}/pasteboard ### Description Retrieves the current text content of the simulator's pasteboard. ### Method GET ### Endpoint /api/simulators/{udid}/pasteboard ### Parameters #### Path Parameters - **udid** (string) - Required - The unique identifier of the simulator. ### Response #### Success Response (200) - text (string) - The text content of the pasteboard. ``` -------------------------------- ### Boot Simulator Source: https://github.com/nativescript/simdeck/blob/main/README.md Boots a simulator by UDID or Android AVD name. Supports passing emulator arguments. ```sh simdeck boot simdeck boot android: --android-emulator-arg=-no-snapshot ``` -------------------------------- ### Launch Application Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Launches a specific application on the simulator by its bundle ID. ```sh ./build/simdeck launch com.apple.Preferences ``` -------------------------------- ### Inspector Protocol Event Envelope Source: https://github.com/nativescript/simdeck/blob/main/docs/api/inspector-protocol.md Example of a JSON event envelope for the Inspector Protocol. ```json { "event": "Inspector.connected", "params": { "protocolVersion": "0.1" } } ``` -------------------------------- ### Inspector Protocol Error Envelope Source: https://github.com/nativescript/simdeck/blob/main/docs/api/inspector-protocol.md Example of a JSON error envelope for the Inspector Protocol. ```json { "id": 1, "error": { "code": -32004, "message": "No view was found for id view:0x1234." } } ``` -------------------------------- ### Serve Custom Client Bundle Source: https://github.com/nativescript/simdeck/blob/main/docs/extensions/browser-client.md Serve a custom client application from a specified directory instead of the built-in client. This is useful for developing and deploying custom UIs. The `--client-root` flag points to the distribution directory of your custom client. ```sh simdeck --client-root /path/to/dist --open ``` -------------------------------- ### Inspector Protocol Success Envelope Source: https://github.com/nativescript/simdeck/blob/main/docs/api/inspector-protocol.md Example of a JSON success envelope for the Inspector Protocol. ```json { "id": 1, "result": { "roots": [] } } ``` -------------------------------- ### Open URL in Simulator Action Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Example using curl to send a POST request to open a URL in a specific simulator. Requires simulator UDID and includes Content-Type and authentication headers. ```sh curl -X POST \ -H "Content-Type: application/json" \ -H "X-SimDeck-Token: $SIMDECK_TOKEN" \ -d '{"action":"openUrl","url":"https://example.com"}' \ http://127.0.0.1:4310/api/simulators//action ``` -------------------------------- ### Inspector Protocol Request Envelope Source: https://github.com/nativescript/simdeck/blob/main/docs/api/inspector-protocol.md Example of a JSON request envelope for the Inspector Protocol. ```json { "id": 1, "method": "View.getHierarchy", "params": { "maxDepth": 4 } } ``` -------------------------------- ### Run Normal Unit and Client Tests Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/testing.md Execute standard unit and client tests using npm. ```sh npm run test ``` -------------------------------- ### TCP Transport Example Source: https://github.com/nativescript/simdeck/blob/main/docs/api/inspector-protocol.md Demonstrates sending an Inspector.getInfo request over TCP using netcat. ```sh printf '{"id":1,"method":"Inspector.getInfo"}\n' | nc 127.0.0.1 47370 ``` -------------------------------- ### Uninstall SimDeck Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/installation.md Remove the globally installed SimDeck package. Ensure the service is stopped before uninstalling. ```sh npm uninstall -g simdeck ``` -------------------------------- ### Pinch Gesture Source: https://github.com/nativescript/simdeck/blob/main/AGENTS.md Simulates a pinch gesture with specified start and end distances, used for zooming. ```sh ./build/simdeck pinch --start-distance 160 --end-distance 80 ``` -------------------------------- ### Manage Applications and URLs Source: https://github.com/nativescript/simdeck/blob/main/docs/cli/commands.md Commands for uninstalling, launching apps, and opening URLs. ```sh simdeck uninstall com.example.App simdeck launch com.example.App simdeck open-url https://example.com simdeck toggle-appearance ``` -------------------------------- ### Navigate Back and Describe UI Source: https://github.com/nativescript/simdeck/blob/main/docs/guide/quick-start.md Navigate back in the application or describe the UI hierarchy. 'describe --format agent' prints element references for direct targeting. ```sh simdeck back ``` ```sh simdeck describe --format agent --max-depth 3 --interactive ``` ```sh simdeck press @e3 ``` -------------------------------- ### List Available Simulators Source: https://github.com/nativescript/simdeck/blob/main/README.md Lists all available simulators managed by SimDeck. ```sh simdeck list ``` -------------------------------- ### Describe View at Point with Ancestors Source: https://github.com/nativescript/simdeck/blob/main/packages/inspector-agent/PROTOCOL.md Get the hit-tested view and its ancestor chain using View.describeAtPoint. ```json { "id": 6, "method": "View.describeAtPoint", "params": { "x": 120, "y": 240 } } ``` -------------------------------- ### Get Inspector Information Source: https://github.com/nativescript/simdeck/blob/main/packages/inspector-agent/PROTOCOL.md Retrieve metadata about the application and the inspector protocol version using Inspector.getInfo. ```json { "id": 2, "method": "Inspector.getInfo" } ``` -------------------------------- ### Simulator Action (Launch App / Open URL) Source: https://github.com/nativescript/simdeck/blob/main/docs/api/rest.md Performs an action on the simulator, such as launching an app or opening a URL. ```APIDOC ## POST /api/simulators/{udid}/action ### Description Launches an application or opens a URL on the simulator. ### Method POST ### Endpoint /api/simulators/{udid}/action ### Parameters #### Path Parameters - **udid** (string) - Required - The unique identifier of the simulator. #### Request Body - **action** (string) - Required - The action to perform. Can be \"launch\" or \"openUrl\". - **bundleId** (string) - Optional - The bundle identifier of the app to launch (required if action is \"launch\"). - **url** (string) - Optional - The URL to open (required if action is \"openUrl\"). ``` -------------------------------- ### Reference Icon in Markdown Source: https://github.com/nativescript/simdeck/blob/main/docs/public/icons/README.md Example of how to reference an SVG icon within a Markdown file for display. ```yaml - icon: src: /icons/rocket.svg width: 28 height: 28 title: ... details: ... ``` -------------------------------- ### Build and Test Android Integration Source: https://github.com/nativescript/simdeck/blob/main/docs/contributing.md Build the CLI and test utilities, then run integration tests for Android. ```sh npm run build:cli npm run build:simdeck-test npm run test:integration:android ```