Version: 1.3
语言 : 中文
Testing and debugging
OpenHarmony symbols

Debugging on an OpenHarmony device

Tuanjie supports the following ways to debug an application on an OpenHarmony device:

USB debugging

Tuanjie supports USB debugging for OpenHarmony devices. To use USB debugging, enable developer options on your device.

Use a USB cable to connect the device to your computer. If you are developing on a Windows computer, you might need to install a device-specific USB driver. See the manufacturer’s website for your device for additional information.

The setup process differs for Windows and macOS. For more information on connecting your OpenHarmony device to the SDK, refer to the Run Your App section of the OpenHarmony Developer documentation.

OpenHarmony Device Connector

Tuanjie supports OpenHarmony Device Connector (HDC) over USB for OpenHarmony devices and over wireless connection for OpenHarmony devices. Wireless connection is useful when you can’t perform USB debugging, such as when a controller is plugged into the OpenHarmony device

Connect via USB

To connect an OpenHarmony device to Tuanjie through HDC using a USB:

  1. Enable HDC on the device. For information on how to do this, refer to Set up a device for development.
  2. Use a USB cable to connect your OpenHarmony device to the machine running Tuanjie.
  3. In Tuanjie, open OpenHarmony Build settings.
  4. In the Build settings window, select the Run Device drop-down and select your device from the options. If your device doesn’t appear, click Refresh.

Connect wirelessly

To wirelessly connect an OpenHarmony device to Tuanjie through HDC:

  1. Enable HDC on the device. For information on how to do this, refer to Set up a device for development.
  2. Find the IP address of your device. The process to do this depends on your device manufacturer.
  3. In Tuanjie, open OpenHarmony Build settings.
  4. In the Build settings window, select the Run Device drop-down and then select the <Enter IP> option.
  5. In the window that opens, enter the IP address and port number of the device and select Add. If the device’s port number is 5555, you don’t need to enter it. After Tuanjie successfully connects to the device, it selects the device as the Run Device.

View OpenHarmony logs

When you run a build of your application on an OpenHarmony device, OpenHarmony collects messages such as stack traces and logs from scripts.

Testing and debugging
OpenHarmony symbols