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 3 answers

    Script syntax for logging off user

    Hi SOTI Users, I'm new to SOTI and using the scripts, but I've tried several referenced here: Script Commands for Android Plus Devices (soti.net) and am able to trigger messages, but not actually "Sign out" of Soti or log off of the device. I've tried "disconnect" and "shutdown" and "turnoff". What I'm trying to accomplish is for a device to log out of SOTI if there is no activity for a long time to make sure that someone new picking up the device will need to log in again.  Any help is appreciated. 

    Android Scripting
    4 years ago
  • 0 votes 3 answers

    Launching SCRIPT from Lockdown

    Hi Community considering that the option Script:// is not anymore available on LockDown. How is it possible to create LockDown shortcut to launch a script ?

    Android Scripting
    4 years ago
  • 0 votes 1 answer

    Set screen resolution by script

    Hi I have a lot of devices with android 8, and mx 8.1. I look for a solution where i can set the screen resolution by script. I try stagenow, but it is not supported in mx 8.1 Can i do this through script?

    Android Scripting
    4 years ago
  • 0 votes 7 answers

    Is it possible to send an intent to mobicontrol app to execute an command?

    Hi, we want to create an automatism, who switch the adminmode from on to off. Like: _adminmode on   / _adminmode off We want to send an intent to the mobicontrol app, with data contains the commands. My idea is like: intent:#Intent;action=net.soti.mobicontrol.xxxxx extraKeyValuePair="commandtoexecute" Or in this case, is there a way to switch the adminmode from an other app on the device? Thanks a lot for help

    Android Scripting
    4 years ago
  • 0 votes 4 answers

    Restrict App Updates

    Hi According to the release notes in 15.1.2 there has been added some new scripts but you did not specify what the scripts are. Could you please describe how to use these?

    Android Scripting
    4 years ago
  • 0 votes 5 answers

    Android Plus - Soft reset device in script

    Hi all, We've created a profile that contains an XML file being pushed to the device, but for the configuration to apply the devices needs a reboot. Ideally we would want the device to reboot itself when the profile is installed. I've tried a post-install script in the package as ''reset /S'' but this doesn't work.  Is there a way to make a unit reboot automatically when a profile is installed ? Thanks,

    Android Scripting
    4 years ago
  • 0 votes 5 answers

    Android 11 MXConfig? Solved

    I am demoing a Zebra VC8300/VC83x that shipped with Android 11.  I can't say it's going as well as any previous new device. I've used StageNow to generate barcodes and xml files to adjust screen time outs, wifi preferences etc and NOTHING is changing. If I send this legacyt script things do change immediately - do I need to migrate EVERYTHING to writesecuresetting on Android11 or is this device just acting up.  To match the fun, if I type the wifi password wrong during initial setup, it boot loops for almost 3 hours before it recovers itself - so it's possible the OS build on this device is just not right - and there are no updates available for it since May 2021. Here is what is working so far. writesecuresetting -sys SCREEN_BRIGHTNESS_MODE_MANUAL 1writesecuresetting -sys SCREEN_BRIGHTNESS 255writesecuresetting -sys screen_off_timeout 1800000

    Android Scripting
    4 years ago
  • 0 votes 1 answer

    How allow an app to break the "Do not disturb" mode?

    We have an alerting app on the Samsung SM-G525F devices, which displays the message: "Please allow novalert to break the 'Do Not Disturb' mode" Does someone know how I can I set this permission by scripting on the devices?

    Android Scripting
    4 years ago
  • 0 votes 4 answers

    Task Scheduler Script only to devices that are online (do not queue)

    Hello All When you send a (legacy) script to one or more devices in Mobicontrol, at the bottom you have the option to "Queue messages for offline devices". I want to make a Profile with a task scheduler which will run a script weekly.But I do not want it to queue for offline devices. I only want to run the script on online devices. Is this possible with a task scheduler? Must I add a filter somewere? Because I do not have the slider option "Queue messages for offline devices"

    Android Scripting
    4 years ago
  • 0 votes 6 answers

    Here is a policy to lock a device on Chrome and restrict Chrome, what is the best way to make this work on an enrolled device? Solved

    Good Morning, I was wondering what the best way to get the following policy to work with SOTI and our devices. The policy's goal is to restrict Chrome and whitelist one of our companies approved sites. Below is a current example:  {"applications": [{"packageName": "com.android.chrome","installType": "FORCE_INSTALLED","managed_configuration": {"URLBlacklist": ["*"],"URLWhitelist": ["test.webapps.jacam.com"]},"lockTaskAllowed": true,"defaultPermissionPolicy": "GRANT"}],"persistentPreferredActivities": [{"receiverActivity": "com.android.chrome","actions": ["android.intent.action.MAIN"],"categories": ["android.intent.category.HOME","android.intent.category.DEFAULT"]}],"statusBarDisabled": true}

    Android Scripting
    4 years ago
  • 0 votes 2 answers

    Saving macro output to file on device Solved

    Hi, I am looking for a way of sending the output of %OEM_VERSION% to an ini file on a Honeywell CT60 (Android Enterprise) device. I would then like to use this as Custom Data to trigger a device relocation rule.Is it possible to use such a macro in either a legacy script or Javascript? If so, I would really appreciate a code example.Thank you.

    Android Scripting
    4 years ago
  • 0 votes 3 answers

    "if exist" script on Android Enterprise Solved

    Hi, I am trying to come up with a method to identify whether a specific file is present on a fleet of Honeywell CT60 Android Enterprise devices running Android 9. I need to be able to identify which devices have the file using a Log Information Report (or similar).I was hoping that the solution would be to run a legacy script along the lines of:if exist "/sdcard/Android/data/com.vendor.myapp/files/LogonData.ini" echo "LogonData.ini exists"but this returns the error 'Script command is not supported by device (if).'A directory listing like the ls command with output sent to the logs would also be ideal.Any suggestions would be gratefully received, thank you.

    Android Scripting
    4 years ago
  • 0 votes 3 answers

    Javascript API/Command to query OEM-Version? Solved

    It’s just an informational Question, if there’s an javascript command, with which I could query the OEM-Version of a Zebra TC56/57 handheld for using in a self-created website? (for the Enterprise Browser that’s installed on the Zebra TC56-devices)I recently found a command to query the OS-Version, the second step would be to query the OEM-Version. The purpose is to create a full automated installation-process for the Zebra Handhelds with pre-detection of Android Version and OEM-Version.Kind regards, Peter Petry

    Android Scripting
    4 years ago
  • 0 votes 4 answers

    Script for "overlay" and "notification" settings

    Hello  I am looking for a way to enable app permission for the app "Ascom Unite Axess" automatically (please check printscreen) Does anybody know a way to enable this notifications with a script? Soti version: 15.4.2.1020 Soti agent: 15.1.3.1071 Android version: 10 Device: Ascom Myco 3

    Android Scripting
    4 years ago
  • 0 votes 3 answers

    Script to "unlock" or emulate swipe up on Android Device?

    Hi, I was looking to see if anyone was aware of a script for Android that would essentially unlock the device or perform the same thing as a swipe up on the device?  The reason for this script is I'm writing some javascript that will check if a particular application is running in the foreground and then perform an update if it is not running.  When the device screen times out and goes black, the script can no longer return what is in the foreground.  We don't have passwords/PINs on the devices, so the screen timeout is activating and just requires a home button and swipe up (page up in remote) to get back into the device. If anyone knows of a better way to go about doing this in general, I'm all ears.  For context, my Javascript looks like below: var ABC = 'com.abc';var foregroundActivities = mobicontrol.app.foregroundActivities;if (foregroundActivities != null) {    foregroundActivities.forEach(function (activity) {        if (activity.packageName = ABC) {mobicontrol.log.info("App is running, not upgrading automatically.  Perform update manually.")}        if (activity.packageName != ABC) {            mobicontrol.log.info("App is not running, upgrading.")            mobicontrol.app.stop('com.abc');            mobicontrol.packages.install('/mnt/sdcard/MobiControl/Packages/LatestRelease.pcg');        }    });} function onFinish(result) {    if (result.isSuccessful) {        mobicontrol.app.start('com.abc');        mobicontrol.log.info("App has been updated.")    }}

    Android Scripting
    4 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.