1. Home
  2. Knowledge Base
  3. SureMDM
  4. Android Management
  5. How to execute Script Commands on Samsung Android Devices using SureMDM Agent?

How to execute Script Commands on Samsung Android Devices using SureMDM Agent?

With SureMDM, you can create jobs (read more) and deploy it to your devices remotely. One of the jobs listed for Android devices is Run Script. With Run Script, you can create a Job to remotely execute script commands on the devices.

List of Scripts Commands:

1.Enable KNOX:

!#suremdm
activateknox

2. Reboot Device:

!#suremdm
reboot

3. Install application:

!#suremdm
install(/sdcard/file name)

4. Uninstall application:

!#suremdm
uninstall(package name)

5. Clear App Data:

am broadcast -a com.nix.COMMUNICATOR -e command clearAppData -e packages package1,package2,…packageN  com.nix

6. Turn GPS OFF:

!#suremdm
TurnOnGPS(false)

7. RunScript to toggle lollipop screen capture

!#suremdm
LollipopScreenCapture(TRUE)

8. RunScript to set Time ,Date and Time Zone

!#suremdm
SetDateTime(DD-MM-YYYY,00:00:00AM/PM,Continent/State)

9. To deactivate SureMDM Agent admin on Device

!#suremdm
deactivateadmin(com.nix)

10. To enable app by package name

!#suremdm
enable(pkg1,pkg2..pkN)

11. To disable app by package name

!#suremdm
disable(pkg1,pkg2..pkN)

12. To edit phone number

!#suremdm
updatephonenumber(912345678)

13. To disable uninstall

!#suremdm
blockUninstall(pkg1,pk2,..,pkgN)

14. To enable uninstall

!#suremdm
allowUninstall(pkg1,pk2,..,pkgN)

15. Block OTA updates

!#suremdm
blockOTAUpgrade(TRUE)

16. Unblock OTA updates

!#suremdm
blockOTAUpgrade(FALSE)

17. Set screen off timeout

!#suremdm
screenofftimeout(60)

18. Configure Email

!#suremdm
configureEmail(action, userName, password, serverType, incomingServerAddress, outgoingServerAddress, securityType_Incoming, securityType_Outgoing, incomingPort, outgoingPort, signature)

19. Screen Capture

!#suremdm
screencap

20. Swipe

!#suremdm
swipe(x1,y1,x2,y2)

21. Reauthenticate SuperSu

!#suremdm
reauthenticateSuperSu(TRUE)

22. Copy To System Folder

!#suremdm
copyToSystemFolder(packageName)

23. Set Admin Removable

!#suremdm
setAdminRemovable(removable, Packagename)

24. Enable Firewall

!#suremdm
ApplyFirewallRules(browser_package,websites_to_whitelist,websites_to_blacklist)

25. Disable Firewall

!#suremdm
DisableFirewall

26. Firewall Whitelist App

!#suremdm
firewallwhitelistapp(package1,package2,…..packagen)

27. Create APN Settings

!#suremdm
createApnSettings(apnname,user,password,server,mmsc,mmsproxy,mmsport,mcc,mnc,type,name, setdefaultValue)

28. Delete APN Settings

!#suremdm
deleteApnSettings(APN_name)

29. BlockIncomingMMS

!#suremdm
BlockIncomingMMS(TRUE)

30. BlockOutgoingMMS

!#suremdm
BlockOutgoingMMS(TRUE)

31. Shutdown Device

!#suremdm
shutdown

32. Reboot after 10 Seconds

!#suremdm
reboot(sec)

33. Shutdown after 10 Seconds

!#suremdm
shutdown(sec)

34. To force stop an app

!#suremdm
StopApp(package1,package2,..,packageN)

35. Turn NFC ON/OFF

!#suremdm
NFCState(ON/OFF)

36. Set Lock Screen Wallpaper on the device screen.

!#suremdm
LockScreenWallpaper(/sdcard/DCIM/Camera/20170504_212614.jpg)

37. Reset Lock Screen Wallpaper on the device screen

!#suremdm
ResetLockScreenWallPaper

38. Disable DataRoaming on the device

!#suremdm
disableDataRoaming(TRUE)

39. Reset DataRoaming on the device

!#suremdm
disableDataRoaming(FALSE)

40. Control power saver mode android settings of the device

!#suremdm
disablePowerSavingMode(true/false)

41. Block incoming SMS

!#suremdm
blockIncomingSMS(true)

42. Block outgoing SMS

!#suremdm
blockOutgoingSMS(true)

43. Block specific number

!#suremdm
blockOutgoingSMS (Number1,Number2,..etc)

44. Firewall script to whitelist apps

!#suremdm
firewallwhitelistapp(pacakge1,pacakge2…pacakgen)

45. Enable Multi Window Mode

!#suremdm
allowMultiWindowMode(true)

46. Disable Multi-Window Mode

!#suremdm
allowMultiWindowMode(false)

47. Remove account from Gmail App

!#suremdm
removeAccountFromDevice(account type)

48. Remove Gmail account from Email App

!#suremdm
removeAccountFromDevice(package name for Email app)

49. Change Font size based on user prefer by applying

!#suremdm
setSystemActiveFontSize(fontSizeInFloat)

50. Dump System Font Sizes in a file

!#suremdm
dumpSystemFontSizes

51. Change Lock Screen Wallpaper

!#suremdm
LockScreenWallpaper(/sdcard/DCIM/a.jpg)

52. Whitelist WiFi restriction

!#suremdm
whiteListWifiSSID(SSID1,…SSIDn)

53. Blacklist WiFi restriction

!#suremdm
blackListWifiSSID(SSID1,…SSIDn)

54. Remove WiFi restriction

!#suremdm
clearWifiRestriction

55. Disable battery optimization for any third party applications.

!#suremdm
removeAppFromBatteryOptimization(packageName1,…,packageNameN)

56. Enable battery optimization for any third party applications.

!#suremdm
addAppToBatteryOptimization (packageName1,…,packageNameN)

57. Remote screen image ignore scale down

!#suremdm
setSystemActiveFontSize(fontSizeInFloat)

58. Run script to disable factory reset for Knox devices

!#suremdm
DisableFactoryReset(true/false)

59. Turn Hotspot OFF

!#suremdm
disableHotspot(true)

60. Allow or deny runtime permissions :

!#suremdm
allowRuntimePermissions(true/false,packagename)

61. Set shortcut image on SureLock Homescreen. :

!#suremdm
CreateAppShortcut(PackageName,ClassName,Url,Title,IconPath)

62. Set provided image as Homescreen Wallpaper. :

!#suremdm
setHomeScreenWallpaper(/sdcard/download/wallpaper2.jpg)

63. Clear Firewall rules:

!#suremdm
ApplyFirewallRules(browser_package,websites_to_whitelist,websites_to_blacklist)

For more details on our products, click here 
If you need further assistance, please submit a ticket here

Was this helpful?
YesNo
Updated on August 2021