tencent cloud

Tencent Real-Time Communication

Run the Demo (HarmonyOS)

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-11-27 17:16:11
This guide shows you how to quickly set up and run the TUILiveKit Harmony Demo in just 10 minutes. You'll experience a fully-featured live streaming solution with a complete UI interface. Once launched, the demo displays the following screens:
Host Preview Before Going Live
Host Live Streaming
Audience Viewing
Host and Audience Co-hosting





Prerequisites

Activate the Service

Refer to Enable the Service to obtain a TUILiveKit trial version. Then, go to the Console for application management, and get the following:
SDKAppID: Application identifier (required). TRTC uses SDKAppID for billing and statistics.
SDKSecretKey: Application SecretKey, used to initialize the configuration file.

Environment Setup

Before running the demo, ensure your development environment meets these requirements:
DevEco Studio: DevEco Studio is installed with HarmonyOS SDK 6.1.1 (API 24), using DevEco's built-in JBR as the JDK.
Project Configuration: Hvigor modelVersion is 6.1.1; targetSdkVersion is 6.1.1(24), compatibleSdkVersion is 6.0.0(20), runtimeOS is HarmonyOS.
Device: A phone running HarmonyOS 6.0.0 (API 20) or above. Live streaming requires camera and microphone access, so use a real device for debugging.
Note:
Keep compatibleSdkVersion at 6.0.0(20). If you set it higher than your device supports, you'll see install failed due to older SDK version in the device during installation.

Instructions

Download the Demo

1. Download the source code: Get TUIKit_Harmony from GitHub, or run the following command in your terminal: git clone https://github.com/Tencent-RTC/TUIKit_Harmony.git
2. Open the project: The HarmonyOS version of the LiveKit Demo is in the live/livekitaccess directory of the repository. Open this directory with DevEco Studio.


Configuration

1. Configure SDKAppID and SDKSecretKey: Open the TUIKit_Harmony/live/livekitaccess/entry/src/main/ets/GenerateTestUserSig.kt file and enter your SDKAppID and SDKSecretKey.

2. Set up signing: In DevEco Studio, go to File > Project Structure > Signing Configs, log in with your Huawei developer account, and generate a debug signature. The OpenHarmony test certificate included with the SDK cannot be used for commercial HarmonyOS devices.

Build and Run

In the upper right corner of DevEco Studio, select the device you want to run the demo on. After selecting, click Run to deploy TUIKit_Harmony to your target device.

Note:
To fully experience the live streaming workflow, log in as two different users on two devices—one as the host and one as the audience.

Login

On the login page, enter your user ID and click Login. After logging in successfully, you'll be taken to the demo homepage. Use the homepage entry points to try out the features shown in the screenshots at the top of this guide.
Sign-in Page
Home Page


Note:
Avoid setting your UserID to simple strings like "1", "123", or "111". TRTC does not support multi-device login for the same UserID, so these IDs are easily occupied by others during collaborative development, resulting in login failures. Use unique UserIDs for debugging.

Next Steps

After running the demo successfully, refer to the following integration guides to add features to your project as needed:
Feature
Description
Integration Guide
Live Streaming
Supports ultra-low latency HD streaming, multi-user co-hosting/PK, real-time beauty filters, live comments, and gift interactions. Easily build interactive live streaming scenarios.

FAQs

Demo reports signature error or login failure?

Verify that the SDKAppID and SDKSecretKey in live-v2/livekitaccess/app/src/main/java/com/livekit/demo/GenerateTestUserSig.java are correct. Ensure they match the values from the Tencent Cloud Console Application Management page.

Contact Us

If you have any questions or suggestions during integration or usage, join our Telegram technical group or contact us for support.


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック