Purpose
SureMDM administrators may require WearOS devices to connect to a WiFi network automatically using RunScript.
Prerequisites
- CA certificate and Client certificate are required
- SureMDM Agent version should be higher than 2.01.07
- Device must be enrolled in Device Owner mode
Steps
- Push the CA certificate and the client certificate to the following location using a File Transfer job:
/data/data/com.nixwear/files
- After the certificates are pushed to the device, apply the following RunScript to configure the WiFi.
Note: This RunScript works only when Nix is set as Device Owner.
- Log in to the SureMDM Console
- Navigate to Jobs → New Job → Android → Run Script
- Enter a Job Name
- Add the following script:
#!suremdm
ConfigureWifiSettings({
“SSID”: “Rail”,”securityType”: “WPA/WPA2/WPA3 – Enterprise”,”identity”: “anonymous”,”CaCertificatePath”: “msnett-rootca-4116.cer”,”domain”: “msnett.railbb.be”,”UserCertificatePath”: “<clientcert>.pfx”,”UserCertificatePassword”: “<clientcert.pfx-password>”})
Runscript Key Descriptions
- SSID : The Wi-Fi network name to connect to.
- securityType : Security type used by the Wi-Fi network.
- identity : User identity/username for EAP-TLS authentication.
- CaCertificatePath : File name of the CA (Certificate Authority) certificate.
- domain : Domain suffix for certificate hostname matching.
- UserCertificatePath : File name of the client certificate (.pfx file).
- UserCertificatePassword : Password protecting the client certificate (.fx file).
Additional Notes
- Replace <clientcert>.pfx with the actual client certificate file name.
- Replace <clientcert.pfx-password> with the password protecting the client certificate.
- Ensure both the CA certificate and client certificate are available under:
/data/data/com.nixwear/files
- Save and deploy the job to the required device(s)
Conclusion
Using RunScript in SureMDM allows administrators to automate WiFi configuration on WearOS devices securely and efficiently.
This approach simplifies enterprise WiFi deployment using certificate-based authentication and ensures devices connect automatically without manual user intervention.
Need more help? Here’s how to get help from our experts.