Community - SOTI MobiControl

Community - SOTI MobiControl

There's a new home for Articles. Find Articles on Our Product Support Page.

Android Scripting Discussions


  • 0 votes 2 answers

    Can I launch a specific Velocity host profile via Intent or JavaScript from SOTI MobiControl?

    I would like to know if there is an intent or other script that I can launch from SOTI MobiControl to start Velocity with a specific host profile running. I would like to create separate icons on my MobiControl lockdown screen to launch a specific host profile.

    Android Scripting
    3 years ago
  • 0 votes 15 answers

    Script wipeapplication Solved

    Hello, I want to clear the cache of the google chrome and Soti Surf application at several times during the day which are not always at the same time, so I can't use scheduled tasks. I do not wish to use lockdown. Here are the commands: wipeapplication net.soti.surfwipeapplication com.android.chromestart net.soti.surf Is it possible to create an application with package studio or the user will be able to launch an application (APK) to launch this script? Thanks in advance for your feedback. Best regards

    Android Scripting
    3 years ago
  • 0 votes 1 answer

    How to Grant Permission on a specific category of silent notification on Android 13

    There an app running on Android 13 that requires permission to send silent notification for a specific category. The android agent is 15.3.4.1113 running as enterprise. The end user, even with no profile or rules has access to change such permission. We are able to enable and disable the silent notification by script:  afw_set_permission_grant_state it.overit.enelsaopaulowfm  android.permission.POST_NOTIFICATIONS allow The issue is that the notifications from this app has specific category and we are not able to control it by script or end user. The "diversos" that means several, comes enabled when we send the script  : afw_set_permission_grant_state it.overit.enelsaopaulowfm  android.permission.POST_NOTIFICATIONS allow I would need to enable the permission to "Notificações de Sincronização" (sync notifications). Is there a way to send a script in order to enable a category of notification ? Is there a way to grant end user the control this permission by himself ?

    Android Scripting
  • 0 votes 11 answers

    Download a data file (.csv) using javascript Solved

    Hi all, we have the problem, that we need to change an ini file and put in an number that is related to the device name. We use Zebra TC21 and MC33xx with Android 10 an 11. For the translation from device name into the number we would download an csv file with both values and read the values. Most of the script works, at the moment we are stuck in downloading a file. On the web are a lot of descriptions, but i did not find one that works. Is someone out there who has an idea to that? Best regardsJürgen

    Android Scripting
    3 years ago
  • 0 votes 9 answers

    How to set up DNS with Android script Solved

    Hi, I'm looking for an Android script to setup Private DNS on Android with DNS over TLS type Hostname like "security.cloudflare-dns.com". I managed to configure our VPN configuration with command like "writeprivateprofstring VPN Name0 IPSecXAuth3", but I can't for the DNS. Do you have any suggestions please? Cordially,

    Android Scripting
    3 years ago
  • 0 votes 7 answers

    Clear App Cache Script Solved

    Is there a way to create a script to clear cache for an app? Currently I am using: wipeapplication com.samsara.driver I would like to clear cache without deleting all data. 

    Android Scripting
    3 years ago
  • 0 votes 5 answers

    Launching an application automatically after it is installed Solved

    Hello, I created a policy app to install an application via the Google Play Store on a Zebra Android 10 device. The installation process takes about 10 to 20 minutes, and then I need to launch the application automatically. I have found the start command that works to launch the application, but I am having trouble getting it to run automatically after the installation is complete. Is there a way to launch the application automatically after installation on a Zebra Android 10 device? Any help or advice would be greatly appreciated. Thank you in advance for your help.

    Android Scripting
    3 years ago
  • 0 votes 4 answers

    file.writeText() not creating file Solved

    HiI've had this script that I run to let the user assign a name to the device. This worked on an older version of Mobicontrol but on the latest version I'm getting an error where the script fails to write to a file. #!/usr/bin/env js var file = new mobicontrol.io.File('/sdcard/SOTI/attr_devicename.ini'); mobicontrol.message.createTextPromptDialog('Device name?') .withQuestionIcon() .withCallback(onConfirm).show(); function onConfirm(result) { if (result.inputText != null) { mobicontrol.log.info(result.inputText + ' is the name of the device'); file.writeText('[DeviceInfo]' + '\n' + 'DeviceName = ' + result.inputText); mobicontrol.agent.checkIn(); } }  

    Android Scripting
    3 years ago
  • 0 votes 5 answers

    Error when calling install_system_update

    Hi, I've got a number of Zebra TC52 devices, and I need to apply the laterst LifeGuard update to them. I've created a File Sync rule, and that seems to work correctly. I.e. I get an entry to the device log which says that the file has been synced. Then I want to call the install_system_update script command, but I get the following log entry when I do: Custom log (Mx OTA failed: /sdcard/HE_FULL_UPDATE_11-30-24.00-RG-U00-STD-HEL-04.zip) Any idea what could be the cause of this? Regards, Daníel

    Android Scripting
    3 years ago
  • 0 votes 8 answers

    Uninstall Android Plugin from device

    Hello. Does anyone know of a way to uninstall an agent plugin from a currently enrolled Android 10 device without re-enrolling all devices? When I enrolled a bunch of Kyocera_DuraForcePro2 devices. The device they picked up Kyocera_KC-S302_sotienterprisemdm_1.20.0.102.apk When it needed to grab:Kyocera_DuraForcePro2_sotienterprisefullmdm_1.19.2.118.apk I have figured out how removed the plugins from the server. Now I need to uninstall the plugin from the device and for an upgrade using the profile on the server. I was also looking for a way to do this by scripting but I'm not sure if that's possible.

    Android Scripting
    3 years ago
  • 0 votes 6 answers

    FileSync Script launch .js file

    Hi, I have FileSync Rule (AE Managed Device) that is uploading multiple files to the devices. One of the file is .js and I would like to execute it if if any of the files changes but I don't know how. Only option that comes to my mind is to copy whole script to the FileSync rule script box but I would rather not as it could change in the future and it could lead to mess. The script itself is not created as (function(root).. , it begins simply with "try {.." so I'm not sure if I could load it with "require" and if yes how to launch it as whole script/file I will be glad for any suggestions

    Android Scripting
    3 years ago
  • 0 votes 3 answers

    using sendintent to start a service

    We use zebra no sleep app to keep our devices active. When this app is installed via mobicontrol we need to activate 2 options. to start the service and to start the service after reboot. I checked this via Github and there is the possibility to start this service via a sendintent.  The service respond to two intent actions (both uses the category: android.intent.category.DEFAULT) "com.zebra.nosleepservice.startservice" sent on the component "com.zebra.nosleepservice/com.zebra.nosleepservice.StartServiceBroadcastReceiver": Start the service.If the device get rebooted the service will start automatically once the reboot is completed. But I don't know how to script this.

    Android Scripting
    3 years ago
  • 0 votes 3 answers

    Script command to wipe Samsung Android Device Solved

    I see the command ""Reset /W /delay 0" and I can run that script from the console scripts however I would like to put in a button on a decom lock screen that when a device is put in Decom mode a new lock screen is presented that gives a button to wipe device.  One of our Companies will start having techs onsite in the next few months that will be working on replacing our aging fleet of Tab Active 2 devices with the Tab Active 3.  We will be sending the 2's to a recycling center and need to make sure they are wiped before sending them off.  Please let me know if the command above is supposed to work when called from a script on the lock screen or not. Thanks, Allen

    Android Scripting
    3 years ago
  • 0 votes 3 answers

    Android System crash using installSystemUpdate

    I would like to trigger the update of firmware on a Zebra device with JavaScript.  I know it's possible in legacy script, but I have my reasons to use JavaScript.   MobiControl Version: 15.5.2.1003 Agent Version 15.3.0.1006 Zebra TC57X Android OS 10.0 OEM Version 10-16-10.00-QG-U114-STD-HEL-04 File is present (if it's not a different error occurs)   Script: var FirmwareLG = new mobicontrol.io.File("/sdcard/HE_DELTA_UPDATE_10-16-10.00-QG-U133-STD-HEL-04.zip");mobicontrol.os.installSystemUpdate(FirmwareLG); When the script is run it throws the error: Custom log (Wrapped java.lang.RuntimeException: android.os.DeadSystemException (UserScript#2))

    Android Scripting
    3 years ago
  • 0 votes 8 answers

    Modify Lockdown from the script

    Hi, Is it possible to either change Lockdown template or modify Lockdown items using script (legacy or JS)? My idea is to have Out-of-Contact policy that will remove Lockdown shortcut to the production app (+ maybe show some info on the lockdown that device is out of contact but that's not necessary) It's Android Enterprise Fully Managed device

    Android Scripting
    3 years ago

Top 3 Contributors of The Week

View All

Earn Contributor Badge

More info
  • Diamond
    Diamond New

    Top-tier experts who are delivering outstanding content. Should have more than 7000 points.

  • Platinum
    Platinum

    Experts who are consistent with great content. Should have more than 1000 points.

  • Gold
    Gold

    Highly experienced members with valuable inputs. Should have more than 700 points.

  • Silver
    Silver

    Beginners taking the initiative. Should have more than 500 points.

  • Bronze
    Bronze New

    New contributors starting their journey. Should have more than 250 points.