Skip to content

Commit b2f8fbf

Browse files
authored
Update install guidance and always-on service docs (#4)
* Update SimDeck install guidance and service docs * Harden JS API integration cleanup * Harden isolated SimDeck test daemon startup
1 parent 4927709 commit b2f8fbf

15 files changed

Lines changed: 269 additions & 22 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,24 @@ Drive iOS Simulator apps from the CLI, browser, and automated tests on macOS.
77
npm i -g simdeck@latest
88
```
99

10+
After installing the CLI, install the Codex skill so agents know the stable
11+
SimDeck workflow:
12+
13+
```sh
14+
npx skills add NativeScript/SimDeck --skill simdeck -a codex -g
15+
```
16+
17+
For VS Code, install the `nativescript.simdeck` extension to open the simulator
18+
view inside the editor.
19+
1020
## Features
1121

1222
- WebTransport based streaming server in Rust, hardware encoded HVEC/H264 video stream
1323
- Simulator control & inspection using private accessibility APIs
1424
- CoreSimulator chrome asset rendering for device bezels
1525
- NativeScript and React Native runtime inspector plugins, plus a native UIKit inspector framework for other apps
1626
- Project daemon reuse: normal CLI commands automatically start and reuse one warm native host per project.
27+
- Optional macOS LaunchAgent service for an always-on local SimDeck daemon.
1728
- `simdeck/test` for fast JS/TS app tests that can query accessibility state and drive simulator controls.
1829
- Agent [`SKILL.md`](./skills/simdeck/SKILL.md) reference
1930

@@ -43,6 +54,16 @@ npm install -g .
4354

4455
After a global install, use the `simdeck` command directly. From a local checkout, you can also run `./build/simdeck`.
4556

57+
Install the agent skill with [skills.sh](https://skills.sh/):
58+
59+
```sh
60+
npx skills add NativeScript/SimDeck --skill simdeck -a codex -g
61+
```
62+
63+
The npm postinstall message also prints this command after a global install.
64+
It also recommends `simdeck service on` for always-on local access from agents
65+
and editor integrations.
66+
4667
## Documentation
4768

4869
Full documentation lives at [simdeck.nativescript.org](https://simdeck.nativescript.org/), with guides, the CLI reference, the REST API, the WebTransport video pipeline, and the inspector protocols. The source for the site lives in [`docs/`](docs/) — preview it locally with `npm run docs:dev`.
@@ -79,6 +100,18 @@ simdeck daemon status
79100
simdeck daemon stop
80101
```
81102

103+
`simdeck daemon` manages the normal per-project warm process. For an always-on
104+
daemon that is available after login, use the macOS user service commands:
105+
106+
```sh
107+
simdeck service on
108+
simdeck service off
109+
```
110+
111+
This uses a LaunchAgent, keeps the server bound to localhost by default, and is
112+
best for agents or editor integrations that should be able to open SimDeck
113+
without first starting a project daemon.
114+
82115
Use software H.264 when macOS screen recording starves the hardware encoder:
83116

84117
```sh

docs/.vitepress/config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "vitepress";
22

33
const repoName = "SimDeck";
4-
const githubUrl = `https://github.com/DjDeveloperr/${repoName}`;
4+
const githubUrl = `https://github.com/NativeScript/${repoName}`;
55
const siteUrl = "https://simdeck.nativescript.org";
66

77
export default defineConfig({

docs/api/health.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Returns a snapshot of every server-side counter and the rolling buffer of client
9191

9292
`client_streams` is a rolling buffer of the most recent reports a client posted to `POST /api/client-stream-stats`. The server keeps the last 48 entries per `(clientId, kind)` pair.
9393

94-
The browser client uses these to render its in-app diagnostics overlay and to size its decoder workers. Every field is optional except `clientId` and `kind`; see [`ClientStreamStats`](https://github.com/DjDeveloperr/SimDeck/blob/main/server/src/metrics/counters.rs) for the full schema.
94+
The browser client uses these to render its in-app diagnostics overlay and to size its decoder workers. Every field is optional except `clientId` and `kind`; see [`ClientStreamStats`](https://github.com/NativeScript/SimDeck/blob/main/server/src/metrics/counters.rs) for the full schema.
9595

9696
## Submitting client stats
9797

docs/cli/commands.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@ Stop the daemon for the current project:
5454
simdeck daemon stop
5555
```
5656

57+
### `service`
58+
59+
Manage the optional always-on macOS user service. Use `simdeck daemon` for the
60+
normal per-project process; use `simdeck service` when you want a LaunchAgent
61+
that starts after login and stays available.
62+
63+
```sh
64+
simdeck service on [--port 4310] [--bind 127.0.0.1]
65+
[--advertise-host <host>] [--client-root <path>]
66+
[--video-codec hevc|h264|h264-software]
67+
[--access-token <token>]
68+
simdeck service restart [same options as service on]
69+
simdeck service off
70+
```
71+
72+
`service on` installs `~/Library/LaunchAgents/dev.nativescript.simdeck.plist`
73+
and starts a LaunchAgent that serves SimDeck after login. It is intended for
74+
agents and editor integrations that should be able to open the UI without first
75+
starting a project daemon.
76+
5777
### `core-simulator`
5878

5979
Manage Apple's CoreSimulator service layer:

docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Optional:
2121
Clone, install dependencies, and build everything:
2222

2323
```sh
24-
git clone https://github.com/DjDeveloperr/SimDeck.git
24+
git clone https://github.com/NativeScript/SimDeck.git
2525
cd simdeck
2626
npm install
2727
npm run build

docs/guide/daemon.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ SimDeck runs one warm native host per project. The daemon owns the HTTP API, the
44

55
Normal CLI commands start the daemon automatically when they need it. Use `simdeck daemon` only when you want to manage it explicitly.
66

7+
`simdeck daemon` is project-scoped. `simdeck service` is the optional macOS
8+
LaunchAgent wrapper for users who want an always-on daemon after login.
9+
710
## Start
811

912
```sh
@@ -69,6 +72,35 @@ simdeck daemon stop
6972

7073
This terminates the daemon for the current project and removes its metadata file from the system temp directory. The next CLI command that needs the daemon starts a fresh one.
7174

75+
## Always-On Service
76+
77+
For agents and editor integrations that should be able to reach SimDeck at any
78+
time after login, use `simdeck service` to install the macOS user service:
79+
80+
```sh
81+
simdeck service on
82+
```
83+
84+
This writes `~/Library/LaunchAgents/dev.nativescript.simdeck.plist`, starts the
85+
server with `launchctl`, and keeps it alive. It binds to `127.0.0.1:4310` by
86+
default and serves the bundled browser client.
87+
88+
Restart it after changing options:
89+
90+
```sh
91+
simdeck service restart --port 4310 --video-codec h264-software
92+
```
93+
94+
Disable it when you do not want a persistent daemon:
95+
96+
```sh
97+
simdeck service off
98+
```
99+
100+
Prefer the project daemon for project-scoped metadata and automatic lifecycle.
101+
Use the service when the priority is easy access from Codex, VS Code, or a
102+
browser at any time.
103+
72104
## CoreSimulator Service Layer
73105

74106
The project daemon is different from Apple's CoreSimulator service. If `simctl` reports stale service state or the live display never produces a first frame, restart Apple's service layer:

docs/guide/installation.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,39 @@ This installs the launcher and bundled native binary to your global `node_module
2929
simdeck --help
3030
```
3131

32+
The global install prints the next setup steps:
33+
34+
```sh
35+
simdeck ui --open
36+
npx skills add NativeScript/SimDeck --skill simdeck -a codex -g
37+
simdeck service on
38+
```
39+
40+
Install the `nativescript.simdeck` VS Code extension if you want the simulator
41+
view inside VS Code.
42+
43+
`simdeck service on` is recommended when agents or editor integrations should be
44+
able to reach SimDeck any time after login. It installs a localhost macOS
45+
LaunchAgent and can be removed with `simdeck service off`.
46+
47+
## Install the Codex skill
48+
49+
SimDeck includes an agent skill at `skills/simdeck/SKILL.md`. Install it with
50+
[skills.sh](https://skills.sh/) so Codex can choose the right commands and
51+
inspection loops automatically:
52+
53+
```sh
54+
npx skills add NativeScript/SimDeck --skill simdeck -a codex -g
55+
```
56+
57+
Restart Codex after installing the skill.
58+
3259
## Install from source
3360

3461
Clone the repo and install dependencies:
3562

3663
```sh
37-
git clone https://github.com/DjDeveloperr/SimDeck.git
64+
git clone https://github.com/NativeScript/SimDeck.git
3865
cd simdeck
3966
npm install
4067
```

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ hero:
1414
link: /guide/
1515
- theme: alt
1616
text: View on GitHub
17-
link: https://github.com/DjDeveloperr/SimDeck
17+
link: https://github.com/NativeScript/SimDeck
1818

1919
features:
2020
- icon:

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"LICENSE",
1111
"README.md",
1212
"bin/",
13+
"scripts/postinstall.mjs",
1314
"build/simdeck-bin",
1415
"client/dist/",
1516
"packages/simdeck-test/dist/"
@@ -52,6 +53,7 @@
5253
"docs:dev": "vitepress dev docs",
5354
"docs:build": "vitepress build docs",
5455
"docs:preview": "vitepress preview docs",
56+
"postinstall": "node scripts/postinstall.mjs",
5557
"prepack": "npm run build:cli && npm run build:client"
5658
},
5759
"devDependencies": {

0 commit comments

Comments
 (0)