you can use the ADB command in the nodejs program
Node.js module to connect to Android device using ADB
JavaScript library, designed to facilitate communication with Android devices. The library’s interface is Promise-based.
A Rust wrapper around the adb command-line tool with a persistent shell session.