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

# Sideloading

> How to sideload the GlobalTV channel onto a Roku device for development testing.

Sideloading installs the channel directly from your machine to a Roku device on the same network. You need to do this every time you want to test a new build.

<Warning>
  Developer mode can be disabled by a Roku firmware update. If sideloading stops working after an automatic update, re-enable developer mode using the key sequence below.
</Warning>

## Prerequisites

* Roku device and development machine on the same local network
* `make`, `zip`, and `curl` installed
* Source code checked out

<Tabs>
  <Tab title="macOS / Linux">
    `make`, `zip`, and `curl` are available through your system package manager or are pre-installed.
  </Tab>

  <Tab title="Windows">
    Use **Git Bash** (includes `make`, `zip`, `curl`) or install the tools with Chocolatey:

    ```bash theme={null}
    choco install make zip curl
    ```
  </Tab>
</Tabs>

## Steps

<Steps>
  <Step title="Enable developer mode on the Roku">
    With the Roku remote, enter the following key sequence from the **Home** screen:

    ```text theme={null}
    Home × 3   Up × 2   Right   Left   Right   Left   Right
    ```

    The screen will display a **Developer Settings** dialog. Note the IP address shown — you will need it in step 3.

    <Note>
      Each activation of developer mode generates a **new** developer password. The previous password is invalidated. Record the new password before dismissing the dialog.
    </Note>
  </Step>

  <Step title="Find the Roku's IP address">
    If you missed the IP shown during activation, find it at:

    **Settings → Network → About**

    The IP address is listed under **IP address**.
  </Step>

  <Step title="Set the developer password">
    When the Developer Settings dialog appears, enter a password and click **Enable Installer**. This password is your `ROKU_PASS` for all Make targets.

    Store it somewhere accessible — you will use it repeatedly during development.
  </Step>

  <Step title="Run make install">
    From the project root, run:

    ```bash theme={null}
    make install ROKU_IP=192.168.x.x ROKU_PASS=yourpassword
    ```

    This builds `out/GlobalTV.zip` first (via `make zip`), then POSTs it to the device.

    **Full example:**

    ```bash theme={null}
    make install ROKU_IP=192.168.1.42 ROKU_PASS=mydevpass
    ```
  </Step>

  <Step title="Check the install result">
    The Makefile prints the result string extracted from `out/_install_response.html`:

    ```text theme={null}
    >>> [install] HTTP 200
    >>> [install] Resultado: Install Success
    >>> [install] Listo. Revisar el Roku.
    ```

    If the command does not find a known result string, inspect the full response:

    ```bash theme={null}
    open out/_install_response.html   # macOS
    # or
    xdg-open out/_install_response.html  # Linux
    ```

    <Note>
      An **"Identical"** result means the zip you uploaded is byte-for-byte the same as what is already installed. The channel is still running; no action is needed. This typically happens when source files have not changed since the last install.
    </Note>
  </Step>

  <Step title="Launch the channel on the device">
    The sideloaded channel appears under **My Channels** as **dev channel** (a plain purple tile). Select it to launch.

    You can also launch it from the Roku home screen by pressing **Home**, scrolling to **My Channels**, and selecting **Dev**.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="curl: (7) Failed to connect">
    The device is unreachable. Verify:

    * Both devices are on the same network segment.
    * The IP address is correct (`Settings → Network → About`).
    * Developer mode is active (a firmware update may have disabled it).
  </Accordion>

  <Accordion title="HTTP 401 Unauthorized">
    The `ROKU_PASS` is wrong. Re-enable developer mode to reset the password, or use the password you set during the current activation.
  </Accordion>

  <Accordion title="Install Failure in response HTML">
    The zip was rejected by the device. Common causes:

    * `manifest` is missing or malformed. Run `make check` to validate.
    * A required image file is missing from `images/`.
    * The zip contains nested directories. The Makefile packages from the project root to ensure `manifest` is at the top level.
  </Accordion>

  <Accordion title="make: command not found (Windows)">
    Use **Git Bash** instead of Command Prompt or PowerShell, or install `make` via Chocolatey:

    ```bash theme={null}
    choco install make zip curl
    ```
  </Accordion>
</AccordionGroup>
