Can I connect the Huawei HarmonyOS emulator in VS.Code?

1.7k Views Asked by At

I am developing a mobile application with VS Code, and my phone launches on a Huawei operating system (Harmony OS). Can I connect them and launch the app on my phone?

2

There are 2 best solutions below

0
On

HarmonyOS supports Native C++ for app development. If you use Huawei DevEco Studio IDE to develop a HarmonyOS app using C++ code, it can be installed on Huawei HarmonyOS phone. On the other hand, if you develop an app with Visual Studio IDE, it can't be launched on Huawei phone.

You can find the detail of DevEco Studio for HarmonyOS app development at https://developer.harmonyos.com/en/docs/documentation/doc-guides/tools_overview-0000001053582387.

0
On

Use an IDE, alike Android Studio or DevEco Studio, depending if this is an Android or HarmonyOS SDK app; there's also these "Lite" apps, which you may be referring to (currently only these can be emulated locally).

It's possible to configure external tools in VS.Code, but it's kind of "the wrong tool", because it lacks the HarmonyOS SDK, ADB/HDB (USB debugging) and most importantly, the emulator (Lite) - and logcat output also would need to be piped into the output window. OHOS only runs Android packages in compatibility mode, if I understood this correctly (but it runs both).

For Android Studio there's also a HMS Toolkit plugin for connecting remote emulators (not Lite). In short: you'd have to install DevEco Studio anyway; only then you'd have a chance of building and running such "hybrid" Lite app from VS.Code, via CLI scripting / or some plugin.