Here's the setup flow including adb. We presume adb is already activated (here is how to turn on developer mode and connect the device to the host by adb).
1. Open the list of configurations in the Headwind MDM web panel, choose the configuration for your devices, click the QR code icon, choose the device number assignment strategy (IMEI or serial number), then click "Generate JSON".
2. Save the JSON as init.json on your computer.
3. Download the APK file of the MDM agent to your computer (hmdm-x.xx-os.apk)
4. Connect the device to the computer by usb
5. Run the commands (they could be merged into a script):
adb install hmdm-x.xx-os.apk
adb shell dpm set-device-owner com.hmdm.launcher/.AdminReceiver
adb push init.json /storage/emulated/0/Android/data/com.hmdm.launcher/files/init.json
adb shell am start com.hmdm.launcher
6. To complete the setup, grant the permissions requested by the Headwind MDM launcher. This can also be done via adb console:
appops set com.hmdm.launcher SYSTEM_ALERT_WINDOW allow
appops set com.hmdm.launcher GET_USAGE_STATS allow
(not required in kiosk mode)
7. Optionally, turn off the USB debugging and developer options as these options make the device unsecure:
settings put global development_settings_enabled 0; settings put global adb_enabled 0
Important: these two commands must be sent as one line, because each of them interrupts the ADB session.