59 lines
2.7 KiB
Markdown
59 lines
2.7 KiB
Markdown
---
|
|
name: sam-usage
|
|
description: use this skill whenever you need to work on webOS TV Board to launch,stop,list running/installed applications
|
|
---
|
|
# SAM (System Application Manager) — Usage
|
|
|
|
SAM is the webOS daemon responsible for **running** and **installing/removing**
|
|
applications. It exposes a Luna bus service named `com.webos.applicationManager`
|
|
(compat aliases: `com.webos.service.applicationmanager`,
|
|
`com.webos.service.applicationManager`).
|
|
|
|
## Where things live
|
|
|
|
| Item | Location |
|
|
|------|----------|
|
|
| Binary | `/usr/sbin/sam` |
|
|
| systemd unit | `sam.service` (starts after `ls-hubd.service`, `surface-manager.service`) |
|
|
| Luna service name | `com.webos.applicationManager` |
|
|
| Dev-only category | `/dev` (only when devmode enabled) |
|
|
|
|
## Tooling
|
|
|
|
SAM is driven over the Luna bus. The standard CLI is `luna-send` / `luna-send-pub`
|
|
(shipped by the `luna-service2` package). Use `-pub` to talk over the public bus
|
|
and `-n 1` to wait for exactly one reply:
|
|
|
|
```sh
|
|
luna-send -n 1 <uri> '<json-payload>'
|
|
```
|
|
|
|
Uri starts with `luna://`
|
|
|
|
You should wait several seconds for the response performed with direct ssh exec
|
|
|
|
## Basic commands
|
|
|
|
| Operation | Luna method | Example |
|
|
|-----------|-------------|---------|
|
|
| **Launch** an app | `launch` | `luna-send -n 1 luna://com.webos.applicationManager/launch '{"id":"com.webos.app.enactbrowser"}'` |
|
|
| **Stop** an app | `close` / `closeByAppId` | `luna-send -n 1 luna://com.webos.applicationManager/close '{"id":"com.webos.app.enactbrowser"}'` |
|
|
| **List running** apps | `running` | `luna-send -n 1 luna://com.webos.applicationManager/running '{}'` |
|
|
| **List installed** apps | `listApps` | `luna-send -n 1 luna://com.webos.applicationManager/listApps '{}'` |
|
|
| App status | `getAppStatus` | `luna-send -n 1 luna://com.webos.applicationManager/getAppStatus '{"appId":"com.webos.app.enactbrowser"}'` |
|
|
| App info | `getAppInfo` | `luna-send -n 1 luna://com.webos.applicationManager/getAppInfo '{"id":"com.webos.app.enactbrowser"}'` |
|
|
| List launch points | `listLaunchPoints` | `luna-send -n 1 luna://com.webos.applicationManager/listLaunchPoints '{}'` |
|
|
|
|
## Notes
|
|
|
|
- **Launch** accepts `id` (appId), `launchPointId`, or `instanceId` (relaunch).
|
|
Optional params: `params`, `target`, `noSplash`, `keepAlive`, `preload`, etc.
|
|
- **Stop** (`close`) identifies the app by `id` (appId) or `instanceId`;
|
|
`closeByAppId` requires `id`. Both are equivalent to `close`.
|
|
- **running** returns an array under `running`; supports `subscribe`.
|
|
- **listApps** returns an array under `apps`; supports `subscribe` and an
|
|
optional `properties` array to select fields.
|
|
- The `/dev` category (`com.webos.applicationManager/dev/...`) exposes
|
|
`close`, `closeByAppId`, `listApps`, `running`, `managerInfo` and is only
|
|
available when devmode is enabled.
|