# Building, testing and publishing ## What you need | For | Install | | --- | --- | | the native service | the [openlgtv buildroot NDK](https://github.com/openlgtv/buildroot-nc4/releases), `arm-webos-linux-gnueabi_sdk-buildroot` | | packaging | `npm install -g @webosose/ares-cli` | | the tests | a host C compiler, Python 3, Node (optional: `flatbuffers`, `jsdom`) | Unpack the NDK and relocate it once: ```sh tar xf arm-webos-linux-gnueabi_sdk-buildroot.tar.gz -C "$HOME" "$HOME/arm-webos-linux-gnueabi_sdk-buildroot/relocate-sdk.sh" ``` Register the TV with ares once, using the Homebrew Channel's ssh (port 9922, root): ```sh ares-setup-device --add tv \ --info "{'host':'192.168.1.20','port':9922,'username':'root'}" ``` ## Build and deploy ```sh ./tools/build.sh # cross-compile, stage, package -> out/*.ipk ./tools/build.sh install # ares-install on device "tv" ./tools/build.sh launch ./tools/build.sh logs ``` `DEVICE=livingroom ./tools/build.sh install` targets a different device; `WEBOS_SDK=/opt/webos-sdk ./tools/build.sh` a differently placed NDK. The same commands exist as npm scripts (`npm run build`, `npm run deploy`, …) if that is more your habit. ### What the packaging step does `ares-package` takes two directories: ```text build/stage/app frontend/, minus js/mock.js and its