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

    Unenroll and enroll a device in the same prosess Solved

    Hi. I am adding a managed google play account to my android devices and some of these devices will not receive this account. I get the message that the device do not support this even it is GMS device. I have tested to run enterprise reset but still it will not add an account.If I unenroll and enroll it adds account. There is so many devices, so I was hoping to do this from MobiControl using a script. Is there a solution for this?

    Android Scripting
    2 years ago
  • 0 votes 2 answers

    TC58 Datawedge api RESTORE_CONFIG

    I have been through all the documentation on the SOTI and Zebra sites and have tried all combinations of sendintents and i cannot get the datawedge profile to reset. Has anyone got this to work on a TC58 on the latest LG? sendintent -b "intent:#Intent;action=com.symbol.datawedge.api.ACTION;S.putExtra=RESTORE_CONFIG;end" sendintent -b "intent:#Intent;action=com.symbol.datawedge.api.ACTION;S.putExtra=com.symbol.datawedge.api.RESTORE_CONFIG;end" sendintent -b "intent:#Intent;action=com.symbol.datawedge.api.ACTION.RESTORE_CONFIG;end"

    Android Scripting
    2 years ago
  • 0 votes 4 answers

    Launch javascript from a lockdown menu item Solved

    Hello, i know that we can use something like the below to launch a script from the lockdown menu if we add it as a custom itemscript:///scriptPathis there a way we can do this with javascript files? i have a java script file that i can successfully send to my devices and get the intended result. it works like a charm, i want to be able to leverage this by adding it as lockdown item

    Android Scripting
    2 years ago
  • 2 votes 2 answers

    Change the default android keyboard via script Solved

    I know there used to be a way to push this via scripting but I'm having trouble finding it.  We recently had an app update that has a custom keyboard that needs to be enabled and made active. For some reason this time the app update went through, it lost the keyboard settings and needs to be reenabled but due to the lockdown launcher they are being blocked from accessing the keyboard settings. Any help is much appreciated. Additional info: Devices in question are Samsung Tablets and Moto G Power Phones, all fully updated Devices are all set up with android enterprise and we are running the cloud Mobicontrol 15.6 server We have 2 apps with custom keyboards, 1 is Proglove's Insight Mobile and the other is Zebra's Scan-to-connect app

    Android Scripting
    2 years ago
  • 0 votes 7 answers

    Script on Lockscreen enter Solved

    Hello, I am trying to run a script for devices that are inactive, meaning the lockscreen is entered. Is there a way to run a script, if a device enters the lockscreen or even better if it is staying for a few minutes on the lockscreen?  I could imagine that this would be possible with the Signal Policy, but there is no option for this. Best, Eduard

    Android Scripting
    3 years ago
  • 1 votes 1 answer

    Simulate a long press with injectKey function

    How can I simulate a long press on a device's key? Currently, I can only send short presses by mobicontrol.device.injectKey(XX). It seems that there is a way to do it by using ACTION_DOWN and _UP, as it says here: https://developer.android.com/reference/android/view/KeyEvent, but I couldn't figure out how to use it in the MobiControl WebConsole.

    Android Scripting
    3 years ago
  • 0 votes 3 answers

    No notification sound after sending a message

    Hello! I would like to send a message to Samsung tablets and also have a notification sound. I am using the following script command: showmessagebox "Some message ..." 60 3 NOTIFY_DEVICE The message is displayed but there is no sound. When I switch to Admin mode it works. It also works when I remove the applied Feature Control. But as soon as there is an active Feature Control, even with default settings or no settings at all, there is no sound. We use a Lockdown and a set of Feature Controls on our devices. We use MobiControl 14.4 and a 15.4.2 agent. Has anyone come across the same problem or has an idea what I could do?

    Android Scripting
    3 years ago
  • 0 votes 3 answers

    How to continuously log activities Solved

    I currently use a script to identify activities: identify_activity. The problem is that it will only catch one activity at a time.  How can I have this run for a set period of time to catch every activity that happens on a device?

    Android Scripting
    3 years ago
  • 0 votes 5 answers

    Intent Script to Connect and Disconnect OpenVPN Solved

    Dear Support Community, i'm not fimilar with Android Intents. I tried to figure it out how they work to get out a script but i'm out of ideas. I tried to build my script by using different informations. These might be the best: CONNECT WITH PROFLE Intent openVPN = new Intent("net.openvpn.openvpn.CONNECT"); openVPN.setPackage("net.openvpn.openvpn"); openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity"); openVPN.putExtra("net.openvpn.openvpn.AUTOSTART_PROFILE_NAME", "PC MYPROFILENAME "); openVPN.putExtra("net.openvpn.openvpn.AUTOCONNECT", true); openVPN.putExtra("net.openvpn.openvpn.APP_SECTION", "PC"); if (openVPN.resolveActivity(getActivity().getPackageManager()) != null) { startActivity(openVPN); } DISCONNECT Intent openVPN = new Intent("net.openvpn.openvpn.DISCONNECT"); openVPN.setPackage("net.openvpn.openvpn"); openVPN.setClassName("net.openvpn.openvpn", "net.openvpn.unified.MainActivity"); openVPN.putExtra("net.openvpn.openvpn.STOP", true); if (openVPN.resolveActivity(getActivity().getPackageManager()) != null) { startActivityForResult(openVPN, 0); } I tried the disconnect first because it seamed to be the easier part and came up with different scripts but none of them worked: sendintent -a "intent:#Intent;action=net.openvpn.openvpn.DISCONNECT;component=net.openvpn.openvpn;B.STOP=true;end;" or sendintent -a "intent:#Intent;action=net.openvpn.openvpn.DISCONNECT;B.STOP=true;end;" or sendintent -a "intent:#Intent;action=net.openvpn.openvpn.DISCONNECT;B.net.openvpn.openvpn.extra.STOP=true;end;" I guess i've tried them all but unforunately none of them worked. Hope you can help!

    Android Scripting
    3 years ago
  • 0 votes 9 answers

    Updating/Writing to INI file on Android Solved

    Hi all, I have been working with a Honeywell CT40 to iron out the configuration before we roll it out to our end users and the last thing I am struggling with is having the built-in SmartTE app use the device name for the WSID. I figure the best way to do with would be to write the SOTI %MCDEVICENAME% to the staylink.ini file where the app hosts this file. Is there any way to script this out? This realistically only needs to be done either when the device is configured or renamed

    Android Scripting
    3 years ago
  • 1 votes 11 answers

    Enforce mobile data

    Hi, I'm trying to prevent user from turning off mobile data from quick panel (without disabling whole quick panel). According to the documentation this script should do the trick "writeprivateprofstring DeviceFeature DisableCellularData 2 apply featurecontrol" but it behaves the same as "DisableCellularData 1" (tried that too) option = it turn off mobile data and block user from turning it on - exact opposite from what I would like to achieve. Device: Samsung Galaxy A34 5G (latest Android 13 OS) Management Type: Work Managed Device (KPE Status Active - Standard) Agent version: 15.4.2.1025 Mobicontrol: 15.6.1.1048 Does anybody have any tips or clues? Thanks

    Android Scripting
    3 years ago
  • 0 votes 7 answers

    Remove accounts from device using script (idealy) Solved

    Hello, I have a multiuser devices where for example:Morning shift at a factory pickup a device and logs-into MS apps.Later on he hands over device to afternoon shift, but forgot to log-off his MS account.MS apps can not get missused thanks to Intune's MAM policy that required PIN code while opening the apps.BUT!I need to log-out the other user, so I created a script in lockdown that users can click and it runs this:clearappcache com.microsoft.office.outlookclearappcache com.microsoft.teamsSo it clears cache, but since the account is still stored in the phone itself the afternoon shift can still log-onto his account.I couldnt find any script that would get rid of the account from device. So how do I do this?"I need users to be able to remove account within Kiosk mode"

    Android Scripting
    3 years ago
  • 0 votes 5 answers

    Combining Legacy Scripts and JavaScript

    Hello, is it possible to combine legacy scripts & JavaScript functionality? Also how would one place a javascript file on the lockdown? Same as Script:\\\Path\to\Script.cmd ?I want to add a "button" to our lockdown where its possible to wipe an app, but i want to ask for a simple pin code first so the normal user can not wipe the app while its in use.

    Android Scripting
    3 years ago
  • 0 votes 2 answers

    Disable Quick Panel Layout

    Hello, Looking to disable the "Quick Panel Layout" specifically the "Show Devices and Media buttons" on the pull down of the status bar on Samsung A12 and A13 devices I believe I found the correct values in Android Studio - Logcat but unsure how to formulate a script to turn off this setting

    Android Scripting
    3 years ago
  • 0 votes 2 answers

    Setting system language with javascript Solved

    Hello there,  I'm trying to set the system language of a device with javascript. As you can see in the js documentation, there is already an example script for it. I tried the example but I'm getting following error message: Custom log (Set locale failed with status code NOT_SUPPORTED) I used following example script in the js documentation: https://www.soti.net/mc/help/javascriptapi/en/mobicontrol.intl.Locale.html var locale = new mobicontrol.intl.Locale("en", "CA"); try { mobicontrol.intl.setLocale(locale); mobicontrol.log.info('Locale set.'); } catch (err) { mobicontrol.log.error('Set locale failed with status code ' + err.statusCode); }   MobiControl version: 15.5.1.1010 Agent Version: 15.4.2.1025

    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.