Skip to content

How-to-use

How to use RTT4U

To use Real Time Testing for Unity (hereinafter referred to as RTT4U), you need to follow the steps below.

  1. Build the RTT Client app (initially once or rebuild as necessary)
  2. Run Unity Editor Play Mode

RTT Client

RTT4U operates by building an app that applies the Hive SDK internally and then running it in the RTT Player, which is an Android emulator.

Therefore, to test any app implemented with the Hive SDK using RTT4U, the app must be built at least once. The built app is referred to as the RTT Client. The RTT Client app runs the Hive SDK Android library on the RTT Player and returns the execution results to the Unity Editor.

To build the RTT Client app, the following conditions must be met:

  • Complete all processes from installing and configuring the Hive SDK Unity Android to app development
  • Ensure that Android SDK and NDK are installed so that the app can be built correctly in Unity


There are two methods for building the RTT Client app: automatic and manual.

The build process is as follows:

  1. Save the Unity project.
  2. Select Hive > RTT4U > Build RTT Client from the menu to start building the RTT Client.
  3. Once the build is complete, RTTClient.apk will be created in UNITY_PROJECT_DIRECTORY/Library/Builds/RTTClient. This is a temporary Unity project for the RTT Client.


If you change the contents of hive_config.xml or modify Android dependencies, you must rebuild the RTT Client.

Manual build

If the automatic build takes too long or RTTClient.apk is not created, try a manual build. Before attempting a manual build, check the following:

  1. Ensure that the Hive SDK is properly applied
  2. Confirm that the app can be built correctly in the Unity project


The manual build follows the steps below:

  1. Select Hive > RTT4U > Check RTT Client Project Path from the menu.
  2. Look for the log RTTClient Temp Project : {PROJECT_DIRECTORY} in the Unity Editor Console.
  3. Open the project located in PROJECT_DIRECTORY in the Unity Editor. This is a temporary Unity project for the RTT Client.
  4. Build the project directly by selecting File > Build Settings > Build. The project target should be Android.
  5. Resolve any issues that arise during the build.
  6. Apply the solutions found to the original Unity project you were working on.

Running Unity Editor Play Mode

After building the RTT Client app, follow the steps below to test the Hive SDK functionality in Unity Editor Play Mode.

1. Implement Plugin initialization in the Start Scene

Implement the Hive SDK Unity Plugin initialization (HIVEUnityPlugin.InitPlugin) in the Scene that starts the app. Ensure that the initialization code for the Hive SDK Unity Plugin is called after running the RTT Client app.

void Awake () {
// Creates a game object for the Hive SDK plugin.
hive.HIVEUnityPlugin.InitPlugin();
}
Warning

If you switch to another Scene before the Hive SDK Unity Plugin initialization is complete, the Hive SDK GameObject will not be created, and RTT4U will not function properly.

2. Activate RTT4U

Select Hive > RTT4U > RTT Enable from the menu to activate RTT4U.

Note

You cannot activate RTT4U using Run the RTT Player in the RTT Player. You must activate RTT4U using RTT Enable. Use Run the RTT Player only to check if the emulator is functioning properly after installation.

3. Open RTTClientWaiter Scene

After saving the currently working Scene, select Hive > RTT4U > Open RTT Client Waiting Scene to open the RTTClientWaiter Scene.

4. Enter Play Mode

Click the Play button in the Unity Editor to enter Play Mode.

5. Wait for the RTT Client app to run

Once you enter Play Mode, the RTT Player and RTT Client app will automatically run. Wait until the RTT Client app is launched.

6. Test Hive SDK functionality

Test the Hive SDK functionality in the desired Scene. For example, in a game app, you can test the Hive SDK functionality in various Scenes such as login, game lobby, store, and battle. The Hive SDK UI will be displayed on the RTT Player, allowing you to test the Hive SDK from the displayed UI and return to the Unity Editor Player Mode to test the app.

Note

It is recommended to follow the Hive SDK flow for testing. For example, most Hive SDK features can be tested after executing the Hive SDK initialization and IdP login.