The steps to build a Roku app depend on whether you are developing a You.i React Native app or a C++ app, and whether you want a Debug or Release version of the app.
Furthermore, Roku apps have both a cloud server portion containing the app logic and a Roku client portion that is on the Roku device. This topic covers building the cloud server portion only. For instructions on building the Roku client portion, see Update Using the Build Script.
Cloud Solution app development can occur on macOS or Linux. If you use Linux for Cloud Solution app development, Ubuntu 18.04 is required for React Native and C++ projects.
For feature parity and maximum compatibility, it’s important that your Roku client and server applications use the same You.i Platform release. Starting in release 5.6, You.i Platform enforces a shared You.i Platform version between client and server components.
While it’s not recommended, there may be cases where you need to allow a mismatch between You.i Platform versions used by your client and server applications. Test your application very well if using this exception mechanism; differences in the You.i Platform version may cause unexpected behavior.
To allow a server version greater than the client version, find or create /AE/assets/json/default/serverConfig.json
in your project folder.
Add the You.i Platform version of your client as shown below.
In this example, if the server is upgraded to 5.7.0, client applications can continue to use version 5.6.0. Note: Connections are always accepted if both are using the same version of You.i Platform.
// serverConfig.json
{
"serverVersionOverride" : "5.6.0"
}
If you’re updating your client but not your server, you can add client_version_override
to the client manifest file, specifying the You.i Platform version of the server application your client is expecting to connect to.
For example, a client built with You.i Platform version 5.8 can connect to a server with version 5.7 if the following is added to the client manifest file:
# manifest
# other config values...
analytics_providers=ConvivaAnalytics
client_version_override=5.7.0
Once you fix the mismatch, simply remove these lines from serverConfig.json
and the client manifest
files.
Also note that clients or servers built with You.i Platform 5.6 or higher don’t work (even with an exception set) with You.i Platform versions 5.5 and lower.
Override values are never compared against each other, and you should only override either the client or the server. Matching You.i Platform versions are always allowed.
For Debug builds, you can build from a Mac or Linux platform.
You.i TV recommends that you use the osx
build target for ongoing development builds.
If using the sample application, copy the /Users/<username>/youiengine/<version>/samples/RNSampleApp/
folder to a location outside the youiengine
directory; for example:
cd /Users/<username>/MyApp
Install dependencies for the project:
yarn install
If you installed multiple versions of You.i React Native software on your machine with youi-tv install
, the new project automatically uses the latest version of the libraries while building.
Build your debug application by running the following command from your project’s youi
folder (substitute -p linux
if on linux):
youi-tv build -p osx -d YI_BUILD_CLOUD_SERVER=ON
If the build fails, read and analyze the failure messages to identify the cause. Refer to Roku App Build Issues for possible corrective measures. For other build options, see youi-tv build.
Once the app builds successfully, do the following steps to launch the app.
Use the Metro Bundler ( yarn
server), open a new Terminal, then do:
cd <your application folder>
e.g., cd MyApp
yarn start
The yarn
server starts.
Look for the following to appear in the window:
Welcome to React Native!
Learn once, write anywhere
To stop the Metro Bundler, press Ctrl + C
.
For Mac, you can launch the app from MyApp/youi/build/osx/Debug/MyApp
or you can use Xcode as follows:
Navigate to the directory containing the IDE project. Enter:
cd ~/MyApp/youi/build/osx
Start Xcode and open the project. In the Terminal window enter:
open MyApp.xcodeproj
Xcode opens the project and indexes the project files.
Ensure the MyApp target is selected from the dropdown menu to the right of the Play button.
Press the Play button in the top-left corner or press Cmd-R to run the app. You may be prompted to enable Developer mode.
The app displays a blank monochromatic screen while it waits to communicate with a client running on a Roku device.
Prepare the Roku device for local testing as described in Roku Client Builds.
Launch the app installed on the Roku device.
The app plays simultaneously on a simulator on your development platform and on the test Roku device. Use the Roku controls to interact with the app. Observe the result of your changes.
Ensure the macOS build identifies itself as the TV form factor to enable focus.
For Linux, navigate to the build/linux/Debug/bin
subdirectory and run ./MyApp
.
Tip You can use the following run time argument for debugging during development:
./MyApp -n1
, to see all the logs and messages on your screen instead of the app’s user interface.
You can only see the messages or logs when the app connects to Roku client../MyApp -i
.Production apps are intended to be sent for certification or deployed to the general public.
For details, see Deploying Roku Apps.
You need to build the Release version of the app for the linux
platform target.
The procedure is similar to building the Debug version, but requires the extra -c Release
argument.
Use the following checklist to ensure you have a correct build environment for the Release version of the app.
The correct versions of CMake and GCC (Linux) are installed installed. See Hardware and Software Specifications.
YI_CLOUD_SERVER_PORT
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
YI_SCENEGRAPH_EXPORT_BUCKET
YI_SCENEGRAPH_EXPORT_DIR
YI_CLOUD_S3_TAG
Confirm your Linux build environment is correctly configured by building a You.i Platform sample app from the You.i Platform package on Linux. See Building a You.i React Native Sample App.
This procedure assumes the following:
yarn global add youi-cli
.
See Installing the Software.To build your app, do following steps from a Linux computer:
youi
folder:youi-tv build -p linux -d YI_BUILD_CLOUD_SERVER=ON -c Release
If you want to deploy the production version of your Cloud Solution app on AWS, you must use the --local
build argument.
For more details, see the Build Options section.
Your application is generated in the build/linux/Release/bin
subdirectory.
For details, see Building apps.
Tip You can use the following run time arguments for debugging during development:
./MyApp -n1
, to see all the logs and messages on your screen instead of the app’s user interface.
You can only see the messages or logs when the app connects to Roku client.If the build fails, read and analyze the failure messages to identify the cause. Refer to Roku App Build Issues for possible corrective measures.
For Debug builds, you can build from a Mac or Linux platform.
You.i TV recommends that you use the osx
build target for ongoing development builds.
To build your app, do following steps from your project’s youi
folder (substitute -p linux
if on linux):
youi-tv build -p osx -d <my_CloudSDK_option>
Substitute <my_CloudSDK_option>
for the option you created when you customized your project CMake file.
See Step 6 in Additional Developer Setup Tasks and Updating your Legacy C++ App’s Build Files.
The following are examples of possible commands depending on your implementation of the CMake file:
youi-tv build -p osx -d YI_BUILD_CLOUD_SERVER=ON
, oryoui-tv build -p osx -d YI_CONFIG_PATH=config/config-osx.txt
The app is generated in the build/osx/Debug
or the build/linux/Debug/bin
subdirectory.
If the build fails, read and analyze the failure messages to identify the cause.
Refer to Troubleshooting for possible corrective measures.
Once the app builds successfully, do the following steps to launch the app.
For Mac, you can launch the app from MyApp/build/osx/Debug/MyApp
or you can use Xcode as follows:
Navigate to the directory containing the IDE project. Enter:
cd ~/MyApp/build/osx
Start Xcode and open the project. In the Terminal window enter:
open MyApp.xcodeproj
Xcode opens the project and indexes the project files.
Ensure the MyApp target is selected from the dropdown menu to the right of the Play button.
Press the Play button in the top-left corner or press Cmd-R to run the app. You may be prompted to enable Developer mode.
The app displays a blank monochromatic screen while it waits to communicate with a client running on a Roku device.
Prepare the Roku device for local testing as described in Roku Client Builds.
Launch the app installed on the Roku device.
The app plays simultaneously on a simulator on your development platform and on the test Roku device. Use the Roku controls to interact with the app. Observe the result of your changes.
Ensure the macOS build identifies itself as the TV form factor to enable focus.
For Linux, navigate to the build/linux/Debug/bin
subdirectory if the build succeeded and run ./MyApp
.
Tip You can use the following run time argument for debugging during development:
./MyApp -n1
, to see all the logs and messages on your screen instead of the app’s user interface.
You can only see the messages or logs when the app connects to Roku client../MyApp -i
.Production apps are intended to be sent for certification or deployed to the general public.
For details, see Deploying Roku Apps.
You need to build the Release version of the app for the linux
platform target.
The procedure is similar to building the Debug version, but requires the extra -c Release
argument.
Use the following checklist to ensure you have a correct build environment for the Release version of the app.
The correct versions of CMake and GCC (Linux) are installed installed. See Hardware and Software Specifications.
YI_CLOUD_SERVER_PORT
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
YI_SCENEGRAPH_EXPORT_BUCKET
YI_SCENEGRAPH_EXPORT_DIR
YI_CLOUD_S3_TAG
Confirm your Linux build environment is correctly configured by building a You.i Platform sample app from the You.i Platform package on Linux. See Your first You.i C++ App
This procedure assumes you have been successfully building Debug versions of the app as part of your development effort. See Building C++ Roku Apps - Debug Version.
To build your app, run the following command from your project’s youi
folder on a Linux computer:
youi-tv build -p osx -d <my_CloudSDK_option>
Substitute <my_CloudSDK_option>
for the option you created when you customized your project CMake file.
See Step 6 in Additional Developer Setup Tasks and Updating your Legacy C++ App’s Build Files.
The following are examples of possible commands depending on your implementation of the CMake file:
youi-tv build -p osx -d YI_BUILD_CLOUD_SERVER=ON
, oryoui-tv build -p osx -d YI_CONFIG_PATH=config/config-osx.txt
Your application is generated in the build/linux/Release/bin
subdirectory.
Tip You can use the following run time arguments for debugging during development:
./MyApp -n1
, to see all the logs and messages on your screen instead of the app’s user interface.
You can only see the messages or logs when the app connects to Roku client.If the build fails, read and analyze the failure messages to identify the cause. Refer to Troubleshooting for possible corrective measures.