Files
rayhunter/doc/installing-from-source.md
2026-02-10 17:06:20 -08:00

2.9 KiB

Installing from source

Building Rayhunter from source, either for development or otherwise, involves a number of external dependencies. Unless you need to do this, we recommend you use our compiled builds.

At a high level, we have:

  • A JS frontend written in SvelteKit (./daemon/web/)
  • A Rust binary rayhunter-daemon (./daemon/) that runs on the device, and bundles the frontend.
  • A Rust binary installer (./installer) that runs on the computer and bundles rayhunter-daemon.

It's recommended to work either on Mac/Linux, or WSL on Windows.

Building frontend and backend

If you have Rust and Node.js/npm installed, you can build everything with:

./scripts/build-dev.sh
./scripts/install-dev.sh orbic  # replace 'orbic' with your device type

Hot-reloading the frontend

If you are working on the frontend, you normally have to repeat all of the above steps everytime to see a change.

You can instead run the frontend separately on your PC while the Rust parts continue running on your target device:

cd daemon/web

# Assumes rayhunter-daemon is listening on localhost:8080
npm run dev

# Use a custom target IP:port where the backend runs
API_TARGET=http://192.168.1.1:8080 npm run dev

The UI will listen on localhost:5173 and instantly show any frontend changes you make. Backend changes require building everything from the top (daemon and installer).

Installer utils, getting a shell

Check FIRMWARE_PROFILE=firmware-devel cargo run -p installer -- util --help for useful utilities for transferring files, opening shells. The exact tools available wildly depend on the device you're working on, and they are usually documented the relevant device's page under Supported Devices.

A lot of devices run a trimmed down version of Android and have ADB (Android Debug Bridge) support. The USB-based installers (orbic-usb, pinephone, uz801) use ADB to perform the installation.

You might want to install and use actual ADB to connect to the device, push files and generally poke around. installer util --help contains commands to enable ADB for some devices.

Note though that we can't assist with any issues setting ADB up, especially not on Windows. There have been too many driver issues to make this the "golden path" for most users or contributors. There have been instances where people managed to brick their orbic devices using ADB on Windows.

The installers orbic and tplink use network connections exclusively to perform the installation. They end up not enabling ADB at all, and as such cannot run into permission issues, driver issues. The downside is that the development tooling (getting a shell, transferring a file) is currently all over the place, and mostly consists of random subcommands in installer util.