1. Home
  2. Knowledge Base
  3. SureMDM
  4. How to execute Script Commands On Android Smartwatches Using SureMDM?
  1. Home
  2. Knowledge Base
  3. Wearable Management
  4. How to execute Script Commands On Android Smartwatches Using SureMDM?

How to execute Script Commands On Android Smartwatches Using SureMDM?

Following script commands can be executed on the Android smartwatches remotely using SureMDM. You can create a Run Script job in SureMDM using the steps mentioned below and apply it to desired enrolled smartwatches.

Steps to create a Run Script job

1. On SureMDM Home, click Jobs.

2. On the Job screen, click New Job.

3. On the Select the OS screen, select Android Wear.

4. On the Select Job Type screen, select Run Script.

5. On the Run Script prompt, enter the script and click OK.

6. Once done, use Apply option on SureMDM Home to apply the Run Script job to desired smartwatch(s).

Run Scripts for Android Smartwatches

1. Create sample folder inside sdcard

mkdir /sdcard/sample

2. Change current directory

cd /sdcard

3. Rename sample.txt to sample1.txt

mv /sdcard/sample.txt /sdcard/sample1.txt

4. Moves folder test1 to test

mv /sdcard/test1 /sdcard/test

5. Delete all files inside test folder with extensions

rm -r /mnt/sdcard/test/*.*

6. Delete all files(even without extenstions) and folders inside test folder

rm -r /mnt/sdcard/test/*

7. Delete file with name test.txt inside sdcard

rm -r /sdcard/test.txt

8. Launch specific activity

am start -n com.nixwear/com.nixwear.MainFrm

9. Open dialer with phone number

am start -a android.intent.action.DIAL tel:123

10. Make call to 123

am start -a android.intent.action.CALL tel:123

11. Launch SureLock

am start -a android.intent.action.MAIN -n com.gears42.surelockwear/.ClearDefaultsActivity

12. Launch Nix

am start -n com.nixwear/.MainFrm

13. Exit SureLock

am broadcast -a com.gears42.surelockwear.COMMUNICATOR -e password 0000 -e command exit_surelock

14. Apply Nix Settings (If Nix Settings on the device is not password protected)

am broadcast -a com.nixwear.COMMUNICATOR -e command apply_settings -e settings_path /sdcard/NixSettings.xml

15. Apply Nix Settings (If Nix Settings on the device is password protected)

am broadcast -a com.nixwear.COMMUNICATOR -e command apply_settings -e settings_path /sdcard/NixSettings.xml -e password 0000

16. To Stop Nix Service

am broadcast -a  com.nixwear.COMMUNICATOR -e command  change_nix_settings -e startNix false -e  password 0000

17. Set Device Name

am broadcast -a com.nixwear.COMMUNICATOR -e command change_nix_settings -e setDeviceName 1+1

18. Apply Settings

am broadcast -a com.nixwear.COMMUNICATOR -e command apply_settings -e settings_path /sdcard/NixSettings.xml

19.  Change Polling mechanism to periodic polling (If Nix Settings on the device is password protected)

am broadcast -a com.nixwear.COMMUNICATOR -e command change_nix_settings -e setPollingType 1 -e setPeriodicPollingIntervalInMins 42 -e password 0000

20.  Change Polling mechanism to periodic polling 

am broadcast -a com.nixwear.COMMUNICATOR -e command change_nix_settings -e setPollingType 1 -e setPeriodicPollingIntervalInMins 42

21.  Change Polling mechanism to Normal  polling(If Nix Settings on the device is password protected)

am broadcast -a com.nixwear.COMMUNICATOR -e command change_nix_settings -e setPollingType 0  -e setPeriodicPollingIntervalInMins 0 -e password 0000

22.  Change Polling mechanism to Normal  polling

am broadcast -a com.nixwear.COMMUNICATOR -e command change_nix_settings -e setPollingType 0  -e setPeriodicPollingIntervalInMins 0

23.  Change Polling mechanism  to Periodic ,Device Name ,Security Type to Http

am broadcast -a   com.nixwear.COMMUNICATOR  -e command  change_nix_settings -e setDeviceName 1+1 -e setPollingType 1  -e  setPeriodicPollingIntervalInMins  30 -e useSecureProtocol  false

24.  Send Messages

am broadcast -a com.nixwear.COMMUNICATOR -e command send_message -e account_id 1216016 -e subject MySubject -e message MyMessage

25.  Use Secure Protocol

am broadcast -a com.nixwear.COMMUNICATOR -e command change_nix_settings -e useSecureProtocol true

To explore more features in SureMDM for Android Smartwatches, click here.

Was this helpful?
YesNo
Updated on August 2021