Category filter
Grant Permissions for Hexnode Apps using Android Debug Bridge (ADB)
To grant system-level permissions to Hexnode MDM without manual user intervention, use the Android Debug Bridge (ADB). This is primarily required for permissions like Usage Stats, Write Settings, and Draw Over Other Apps on devices where the MDM cannot grant them automatically. The core command structure is:
Prerequisites
Before executing ADB commands, prepare the target Android device:
- Enable Developer Mode: Go to Settings > About phone > Software information. Tap on Build number 7 times.
- Enable USB Debugging: Go to Settings > Developer options and toggle on USB debugging.
- Setup Host Computer: Install ADB on your computer.
- Physical Connection: Connect the device to the PC via a high-quality USB cable.
Step 1: Install Hexnode and Assign Device Owner
- Download the Hexnode UEM app and place it in your computer’s ADB folder.
- Open Command Prompt (Windows) or Terminal (Mac/Linux) and navigate to the ADB folder.
- Start the ADB server:
1adb start-server
- Connect the Android device to the computer via USB.
- Install the app:
1adb install HexnodeMDM.apk
- Set as Device Owner: This command grants Hexnode full control over the device.
1adb shell dpm set-device-owner com.hexnode.hexnodemdm/com.hexnode.mdm.receivers.HexnodeDeviceAdminReceiver
Step 2: Grant Permissions via ADB
Once the app is installed, use the following commands to automatically grant necessary permissions.
- Enable Usage Access
Allows Hexnode to track app usage data.
1adb shell appops set com.hexnode.hexnodemdm GET_USAGE_STATS allow - Enable Draw Over Apps
Required for kiosk mode and remote view features.
1adb shell appops set com.hexnode.hexnodemdm SYSTEM_ALERT_WINDOW allow - Write System Settings
Allows Hexnode to modify system configurations (e.g., brightness, volume).
1adb shell appops set com.hexnode.hexnodemdm WRITE_SETTINGS allow - Notification Access
Allows Hexnode to read or dismiss notifications.
For Android 10 and above:
1adb shell cmd notification allow_listener com.hexnode.hexnodemdm/com.hexnode.hexnodemdm.mylistenerFor Android versions below 10:
12adb shell settings put secure enabled_notification_listenerscom.hexnode.uem.androidtv/com.hexnode.uem.androidtv.mylistener - Allow App Installation
Permissions to silently install enterprise apps.
1adb shell appops set com.hexnode.hexnodemdm REQUEST_INSTALL_PACKAGES allow - Disable Battery Optimization
Ensures the Hexnode app runs in the background without being killed by the OS.
1adb shell dumpsys deviceidle whitelist +com.hexnode.hexnodemdm - Manage All Files (Android 11+)
Grants full access to device storage.
1adb shell appops set com.hexnode.hexnodemdm MANAGE_EXTERNAL_STORAGE allow
Frequently Asked Questions (FAQs)
Q1: Can I use these commands for the “Hexnode For Work” app?
Yes. However, you must replace the package identifier in the commands.
- Standard App: com.hexnode.hexnodemdm
- Work App: com.hexnode.mdm.work
Example: adb shell appops set com.hexnode.mdm.work WRITE_SETTINGS allow
Q2: Will the user still need to manually grant any permissions?
Yes. Even after running these commands, the user may still need to manually grant permissions for App Logs and activate the Password Token inside the app to complete full enrollment.
Troubleshooting Common ADB Errors
If you encounter issues while running the commands above, refer to the specific errors below.
1. Error: device not found or unauthorized
Description: The computer cannot communicate with the Android device.
Possible Cause: USB Debugging is not enabled, the USB cable is faulty, or you haven’t accepted the RSA fingerprint prompt on the device screen.
Solution: Check Developer Options to ensure USB debugging is ON. Unplug and replug the device, and watch the phone screen to tap “Allow” on the “Allow USB debugging?” prompt.