# iHalo: Fire TV Stick setup, done by an AI agent

Give this file to an AI coding agent that can run terminal commands on your computer (Claude Code, Codex CLI,
Gemini CLI or similar) and say: **"Follow iHalo-AI-Setup.md and set up my Fire TV Stick."**
The agent will guide you, ask before each change, and keep a record so everything can be undone.

Your computer and the Fire TV must be on the same Wi-Fi. No root, nothing is deleted from Amazon's system.

---

## Instructions for the AI agent

You are setting up an Amazon Fire TV Stick over ADB for a non-technical person. Follow these rules throughout.

### Rules

1. **Talk in the user's language.** If they write in Hindi or Hinglish, answer in the same. Keep messages short and simple.
2. **Ask before every change to the TV**, one group at a time, saying in one line what it does. Read-only
   commands (getprop, pm list, settings get, dumpsys) need no asking.
3. **Disable, never uninstall** Amazon system apps: only `pm disable-user --user 0 <package>`. Never use
   `pm uninstall` on a system package, never root, never `rm` anything on the TV.
4. **Never touch these** (Fire TV needs them): `com.amazon.tv.launcher`, `com.amazon.tv.settings*`,
   `com.amazon.venezia` (Appstore, apps check their licence with it), `com.amazon.avod` (Prime Video),
   `com.amazon.cloud9` (Silk browser), anything with `bluetooth`, `keyboard`, `webview`, `inputmethod`,
   `systemui`, `ime`, `remote`, `account`, `auth`, `dial`, `parental`, `oobe` or `setup` in its name.
5. **Keep a record.** Before changing anything, save the TV's current state to `ihalo-backup.txt` in the
   current folder (Step 2). Append every change you make to `ihalo-changes.txt`, one line each.
6. **Downloads only from the official sources named here** (Google, the iHalo and TizenTube GitHub repos). Tell the user
   the file name, source and size before downloading.
7. If a command fails, explain it simply, skip that item and continue. Never retry something Fire OS refused.
8. Don't ask the user to read long output. Summarise.

### Step 0: Get ADB on this computer

Check: `adb version`. If it's missing, ask the user, then install:

- macOS: `brew install android-platform-tools` (if Homebrew is missing, download instead, below)
- Windows: `winget install Google.PlatformTools`
- Linux (Debian/Ubuntu): `sudo apt install adb`
- Otherwise: download Platform Tools from Google,
  `https://dl.google.com/android/repository/platform-tools-latest-<darwin|windows|linux>.zip`, unzip it into
  the current folder and use `./platform-tools/adb`.

### Step 1: Connect to the TV

Tell the user, in their language, to do this on the TV:

1. Settings > My Fire TV > About: click the first line (the device name) **7 times** until it says
   they are a developer.
2. Back to Settings > My Fire TV > **Developer options**: turn on **ADB debugging** (and **Apps from Unknown
   Sources** / **Install unknown apps**).
3. Settings > My Fire TV > About > **Network**: read out the **IP address**.

Then run `adb connect <IP>:5555`. The TV shows "Allow USB debugging?": tell the user to tick **Always allow**
and press **OK**. Check with `adb devices` (must say `device`, not `unauthorized`).
If you have a network scan tool and the user doesn't know the IP, look for open port 5555 on the local network.

Check the device:

```
adb shell getprop ro.product.model
adb shell getprop ro.build.version.name
adb shell getprop ro.product.cpu.abilist
adb shell cat /proc/meminfo | grep MemAvailable
adb shell df -h /data
```

If `adb connect` never works and the model is a 2025 Fire TV Stick 4K Select or HD running **Vega OS**, stop:
those can't install Android apps. Tell the user this guide doesn't apply.

Note the free memory and storage: you'll show the before/after at the end.

### Step 2: Save the current state

```
adb shell pm list packages -d > ihalo-backup.txt
adb shell settings list global >> ihalo-backup.txt
adb shell settings list secure >> ihalo-backup.txt
adb shell settings list system >> ihalo-backup.txt
```

### Step 3: Turn off Amazon's bloat (ask per group)

For each group, ask; if yes, for each package that is installed (`adb shell pm list packages <pkg>`) and not
already disabled, run `adb shell pm disable-user --user 0 <pkg>` and log it. Some may be refused by Fire OS:
skip those.

| Group | What it does | Packages |
| --- | --- | --- |
| Ads and screen tracking (recommended) | Amazon's ads, autoplay previews, on-screen content tracking | com.amazon.kso.blackbird, com.amazon.ftvads.deeplinking, com.amazon.tv.acr, com.amazon.hybridadidservice, com.amazon.media.recommendations, com.amazon.sneakpeek, com.amazon.tigris |
| Telemetry and logs (recommended) | Usage reports and logs sent to Amazon | com.amazon.tv.fw.metrics, com.amazon.wirelessmetrics.service, com.amazon.dp.logger, com.amazon.neo.minerva.logcat, com.amazon.logan, com.amazon.perfc, com.amazon.spiderpork |
| Shopping, promos and unused apps (recommended) | Shopping on TV, miniTV, Photos, Music, Kids, games hub, tutorials, smart home and multi-room audio | com.amazon.shoptv.client, com.amazon.shoptv.firetv.client, com.amazon.minitv.android.app, com.amazon.bueller.photos, com.amazon.bueller.music, com.amazon.tahoe, com.amazon.gamehub, com.amazon.storm.lightning.tutorial, com.amazon.tmm.tutorial, com.amazon.tv.releasenotes, com.amazon.tv.matter, com.amazon.tv.mattercohost, com.amazon.whad, com.amazon.whasettings, com.amazon.audiohome, com.amazon.wha.mediabrowserservice, com.amazon.spotify.mediabrowserservice, com.amazon.ods.kindleconnect, com.amazon.rtcsessioncontroller, com.amazon.hedwig, com.amazon.wifilocker, com.amazon.d3, com.amazon.cardinal |
| Forced Amazon updates (optional) | Services that push Fire OS updates | com.amazon.tv.forcedotaupdater.v2, com.amazon.tv.easyupgrade |
| Alexa (optional) | Voice search on the remote stops working | com.amazon.vizzini, com.amazon.vizzini.ftvcds, com.amazon.alexa.externalmediaplayer.fireos, com.amazon.alexamediaplayer.runtime.ftv, com.amazon.alexadirectivebrokerservice, com.amazon.alexa.datastore.app, com.amazon.aca, com.amazon.tv.alexaalerts, com.amazon.tv.alexanotifications |

Tell the user Prime Video, Netflix, Hotstar and their other apps keep working.

### Step 4: Quick settings (ask for each)

- **Block ads and trackers (AdGuard DNS):**
  `adb shell settings put global private_dns_mode hostname` and
  `adb shell settings put global private_dns_specifier dns.adguard-dns.com`
- **Faster animations:** `adb shell settings put global window_animation_scale 0.5`, the same for
  `transition_animation_scale` and `animator_duration_scale`.
- **Sleep timers** (screen off after 10 idle minutes, sleep after 15):
  `adb shell settings put system screen_off_timeout 600000` and `adb shell settings put secure sleep_timeout 900000`

### Step 5: New home screen (ask)

Install **iHalo Home**, an Apple TV-style home screen built on FireFrame (open source, MIT).

1. Download `iHalo-Home.apk` from https://github.com/GaurangMishra1008/ihalo/releases/latest/download/iHalo-Home.apk
2. `adb install -r iHalo-Home.apk`
3. Make the Home button open it (Fire OS doesn't allow changing the launcher, so iHalo Home uses an
   accessibility service). Keep any services already listed, but drop an older FireFrame entry:
   ```
   adb shell settings get secure enabled_accessibility_services
   adb shell settings put secure enabled_accessibility_services ""
   adb shell settings put secure enabled_accessibility_services <existing>:app.ihalo.home/com.fireframe.home.HomeService
   adb shell settings put secure accessibility_enabled 1
   ```
   (If nothing was listed, use just `app.ihalo.home/com.fireframe.home.HomeService`.) Setting it to empty
   first matters: an install turns the service off, and only a change turns it on again.
4. The "Now playing" card and the Wi-Fi data chip:
   ```
   adb shell cmd notification allow_listener app.ihalo.home/com.fireframe.home.MediaListener
   adb shell appops set app.ihalo.home GET_USAGE_STATS allow
   ```
5. Ask for the user's first name (for the greeting) and city (for the weather), both optional, then:
   `adb shell am start -n app.ihalo.home/com.fireframe.home.MainActivity --es user_name "<name>" --es weather_city "<city>"`
6. Ask the user to press **Home** on the remote: iHalo Home should open. Its settings are on the TV (top right).

### Step 5b: iHalo Helper (ask, only after Step 5)

Install it after iHalo Home: it gets Home's phone-remote permission when it is installed. It adds: the
remote's power button really puts the TV to sleep, a phone remote (a web page on the home Wi-Fi), a clock
screensaver, Bluetooth speakers let go when the TV sleeps, and optionally other apps on the remote's
Netflix and Amazon Music buttons.

1. Download https://github.com/GaurangMishra1008/ihalo/releases/latest/download/iHalo-Helper.apk and `adb install -r iHalo-Helper.apk`
2. Permissions and the screensaver:
   ```
   adb shell pm grant app.ihalo.helper android.permission.READ_LOGS
   adb shell dpm set-active-admin app.ihalo.helper/app.ihalo.helper.AdminReceiver
   adb shell settings put secure screensaver_components app.ihalo.helper/app.ihalo.helper.ClockDream
   adb shell settings put secure screensaver_enabled 1
   adb shell settings put secure screensaver_activate_on_sleep 1
   ```
3. Ask what the **Netflix** and **Amazon Music** buttons should open: unchanged (`off`), or an installed app's
   package (JioHotstar `in.startv.hotstar`, TizenTube `io.gh.reisxd.tizentube.cobalt`, YouTube
   `com.amazon.firetv.youtube`, Spotify `com.spotify.tv.android`; check it is installed). Then start it with
   the settings (city as in Step 5, or `off`):
   ```
   adb shell am broadcast -f 0x20 -n app.ihalo.helper/app.ihalo.helper.BootReceiver --es netflix_button <pkg|off> --es music_button <pkg|off> --es weather_city "<city|off>"
   ```
4. Tell the user: on the home screen, press up from the dock to **Use mobile as remote** and scan the code
   with the phone camera (phone on the same Wi-Fi). Or open `http://<TV IP>:8095` on the phone.

### Step 6: Ad-free YouTube (ask)

Install **TizenTube Cobalt** (open source): https://github.com/reisxd/TizenTubeCobalt/releases/latest

- If `ro.product.cpu.abilist` contains `arm64-v8a`: download `cobalt-arm64.apk`, else `cobalt-arm.apk`.
- `adb install -r cobalt-arm.apk`
- The user signs in on their phone at yt.be/activate, or picks "Watch as guest".

### Step 7: Check and finish

1. `adb reboot`, wait about a minute, `adb connect <IP>:5555` again.
2. Ask the user to press Home (the new home screen should open) and open Prime Video or one streaming app.
3. Show free memory and storage before and after.
4. Tell the user: if an Amazon update turns things back on, they can run you again with this file.

### Undo (when asked)

- Turn back on every package in `ihalo-changes.txt`: `adb shell pm enable <pkg>`
- `adb shell settings put global private_dns_mode off`
- Animations: put the three scales back to `1.0`
- iHalo Helper: `adb shell am broadcast -f 0x20 -n app.ihalo.helper/app.ihalo.helper.BootReceiver --ez release_admin true`
  (it gives up device admin itself; Fire OS refuses `dpm remove-active-admin`),
  `adb shell settings delete secure screensaver_components`, then `adb uninstall app.ihalo.helper`
- Home button back to Amazon: remove `app.ihalo.home/com.fireframe.home.HomeService` from `enabled_accessibility_services`,
  then `adb uninstall app.ihalo.home`
- TizenTube: `adb uninstall io.gh.reisxd.tizentube.cobalt`

### Troubleshooting

| Problem | Fix |
| --- | --- |
| `adb connect` times out | Same Wi-Fi? ADB debugging still on? Restart the TV and try again. |
| `unauthorized` | Accept the prompt on the TV, then `adb kill-server` and connect again. |
| Home opens Amazon's screen again | Re-run Step 5, part 3. Reinstalling an app turns its service off. |
| An app stopped working | `adb shell pm enable <package>` for the packages in `ihalo-changes.txt`, one group at a time. |
| A browser says it can't link to WebView | Keep Silk (`com.amazon.cloud9`) on and use it. |
| Phone remote's arrows or Home do nothing | Reinstall iHalo Helper (it must go in after iHalo Home), then send the Step 5b broadcast again. |
| Power button doesn't sleep the TV | `adb shell pm grant app.ihalo.helper android.permission.READ_LOGS`, then the Step 5b broadcast. |

---

Not made by or affiliated with Amazon. Credits: iHalo Home is built on FireFrame by dyascj (MIT); TizenTube Cobalt by reisxd,
AdGuard DNS.
