> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glasswarp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Launch apps

> Spawn and drive Windows applications from your session.

Launch a Windows application on the rig and drive it with vision + input.

## Launch

```python theme={null}
result = gw.launch_app(sid, path=r"C:\Windows\System32\notepad.exe")
print(result)  # {'ok': True, 'pid': 14180}
```

Pass arguments when needed:

```python theme={null}
gw.launch_app(sid, path=r"C:\Windows\System32\mspaint.exe", args=[])
```

## Drive it

After launching, use [observe](/guides/observe) to find targets and
[input](/guides/input) to act:

```python theme={null}
gw.launch_app(sid, path=r"C:\Windows\System32\notepad.exe")

obs = gw.observe(sid, mark=True)
edit = next((t for t in obs.targets if t.role == "edit"), None)
if edit:
    gw.click_target(sid, edit.id, targets=obs.targets)
gw.type_text(sid, "Driven through the Glasswarp API")
```

## Clean up launched apps

```python theme={null}
gw.kill_app(sid, pid=result["pid"])   # or kill all session-launched apps
```

<Warning>
  Session-launched apps are cleaned up by `safety_restore` on session end, but
  kill long-running apps explicitly when your task is done.
</Warning>

See the [Notepad example](/examples/notepad) and [Paint example](/examples/paint)
for complete scripts.
