Skill: jiayun/androidtv-netflix (version 1.0.0)

--- name: androidtv-netflix description: Search and play Netflix content on Android TV. When the user asks to play a specific Netflix title on TV, the agent looks up the title ID and executes ADB commands for precise playback. version: 1.0.0 metadata: openclaw: requires: bins: - adb os: - macos - linux --- # Android TV Netflix Skill This skill remotely controls an Android TV device to play Netflix content via ADB. ## Prerequisites If the user has not set up ADB access before, guide them through these steps: 1. **Enable Developer Options on the Android TV**: - Go to **Settings → Device Preferences → About** and tap **Build** 7 times. - Go back to **Settings → Device Preferences → Developer options** and enable **USB debugging** (also called "Network debugging" on some devices). 2. **Assign a static IP to the Android TV** (either method works): - **Router-side (recommended)**: In the router's admin page, find DHCP reservation / static lease settings and bind a fixed IP to the Android TV's MAC address. This requires no changes on the TV itself. - **TV-side**: Go to **Settings → Network & Internet → (your Wi-Fi network) → IP settings → Static** and assign an address outside the DHCP range. 3. **Install ADB on the local machine**: - macOS: `brew install android-platform-tools` - Linux (Debian/Ubuntu): `sudo apt install adb` 4. **Connect and authorize**: ```bash adb connect <ANDROID_TV_IP>:5555 ``` A prompt will appear on the TV asking to allow USB debugging — the user must **confirm on the TV** (check "Always allow" to skip this next time). Verify with `adb devices` — it should show `device`, not `unauthorized`. 5. **Set the environment variable** (optional — defaults to `192.168.125.228`): ```bash export ANDROID_TV_IP="192.168.1.200" ``` ## Core Workflow 1. **Look up the title ID**: Use `web_search` to find the Netflix Title ID for the requested content (typically an 8-digit number, search within the user's region). 2. **Ensure ADB connectivity**: Verify that `adb` is connected to the Android TV device. 3. **Execute playback**: Run `scripts/play_netflix.sh <TITLE_ID>` for precise deep-link playback. ## Tools - **Direct playback script**: `scripts/play_netflix.sh <ID>` - **ADB basic controls** (see `references/adb-keycodes.md` for the full list): - Pause / Play: `adb shell input keyevent 85` - Volume up: `adb shell input keyevent 24` - Volume down: `adb shell input keyevent 25` - Home: `adb shell input keyevent 3` ## Troubleshooting - If Netflix is stuck on the profile selection screen, press Enter to confirm: `adb shell input keyevent 66`. - If the video does not auto-play, send a D-pad Center press: `adb shell input keyevent 23`.

path: references/adb-keycodes.md
content: # ADB Keycode Reference

Common keycodes for controlling Android TV via `adb shell input keyevent <code>`.

## Navigation

| Key | Code | Description |
|-----|------|-------------|
| D-pad Up | 19 | Navigate up |
| D-pad Down | 20 | Navigate down |
| D-pad Left | 21 | Navigate left |
| D-pad Right | 22 | Navigate right |
| D-pad Center | 23 | Select / confirm |
| Back | 4 | Go back |
| Home | 3 | Go to home screen |
| Enter | 66 | Confirm input |

## Media

| Key | Code | Description |
|-----|------|-------------|
| Play/Pause | 85 | Toggle play/pause |
| Play | 126 | Start playback |
| Pause | 127 | Pause playback |
| Stop | 86 | Stop playback |
| Fast Forward | 90 | Fast forward |
| Rewind | 89 | Rewind |
| Next | 87 | Next track |
| Previous | 88 | Previous track |

## Volume

| Key | Code | Description |
|-----|------|-------------|
| Volume Up | 24 | Increase volume |
| Volume Down | 25 | Decrease volume |
| Mute | 164 | Toggle mute |

## Power & System

| Key | Code | Description |
|-----|------|-------------|
| Power | 26 | Power on/off |
| Sleep | 223 | Put device to sleep |
| Wake Up | 224 | Wake device |
| Menu | 82 | Open menu |
| Search | 84 | Open search |

## Text Input

Use `adb shell input text "hello"` for typing text directly.


path: scripts/play_netflix.sh
content: #!/bin/bash
# scripts/play_netflix.sh - Deep-link a Netflix title on Android TV via ADB

ANDROID_TV_IP="${ANDROID_TV_IP:-192.168.125.228}"
TITLE_ID=$1

if [ -z "$TITLE_ID" ]; then
    echo "Usage: ./play_netflix.sh <TITLE_ID>"
    exit 1
fi

# Step 1: Force-launch Netflix with a deep link
adb -s ${ANDROID_TV_IP}:5555 shell am start -n com.netflix.ninja/.MainActivity \
    -a android.intent.action.VIEW \
    -d "https://www.netflix.com/watch/${TITLE_ID}" \
    -f 0x10808000 -e source 30

# Step 2: Wait for Netflix to render
sleep 5

# Step 3: Send D-pad Center to start playback (in case it lands on the info page)
adb -s ${ANDROID_TV_IP}:5555 shell input keyevent 23


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)