Adding a Script to Android Dynamic Lockdown

Looking to add a button that would run a MobiControl script to the lockdown screen, this script would reach out to MobiControl and install a specific package. The use case is as follows:

we have two packages that contain of our proprietary app but two different versions, Im looking to make it so people that are testing the versions can press a button that would run a script to uninstall the currently installed package of the app and install the selected package without leaving the lockdown screen 

3 years ago
Android Scripting
ANSWERS
RC
Raymond Chan Diamond Contributor
3 years ago

You can use script://   prefix  (with file argument similar as for file:// ) to define your script to be associated with a kiosk item.  

Depending on your MobiControl server version, device agent version and the device enrollment mode,  the list of valid script command may vary and  thus cause your script execution initiated from kiosk to fail.   So, the first thing to do is to make sure all command in your script works fine on your target device.  Then, depending on your MobiControl version and the html/CSS template used for tyour kiosk, you might need to fine tune and make sure the argument sent to script:// are properly parsed and executed.

R
RSMOD@SOTI
3 years ago

Hi Matt Rosas,

Thanks for posting your query on SOTI Central.

To install packages, you can use the following script.

installpackage [path to package]

To add a button to execute the script from the lockdown screen, it depends on the version of your MobiControl.

In version 15.5, there is no “script://” item to be selected from the dropdown list of lockdown although Mobicontrol 15.5 help manual still lists this feature in Lockdown Home Screen.

https://www.soti.net/mc/help/v15.5/en/console/reference/dialogs/profiles/androidplus/profile_lockdown_addmenuitem_androidplus_2.html

Instead, you need to select "Custom" and type "script://..." to add the script to the lockdown as below.

Please try it and if any, reply to my comment.

I will then continue to investigate.

Thanks,

MR
Matt Rosas
3 years ago

Does the file have to live on the device or is there away I can point the path for the package to one that lives on the server?

R
RSMOD@SOTI
3 years ago

The file should be in the device.

For the package on your server, it should be downloaded to the device first.

Do you want to do all the tasks for updating your application with one button?

If so, can you list up the tasks you want the button to do?

MR
Matt Rosas
3 years ago

We are looking to set two buttons for our QA tablets, each button would uninstall the current version of our App then download the version associated to the button, then set the permissions for the App. 

I have created two packages already using mcstudio.exe that already do this, but if I cant reach out to the server retrieve these packages then it sounds like I would have to file sync the two versions of the .APKs and then have a button call a script to preform the 3 actions

R
RSMOD@SOTI
3 years ago

To achieve your goal, how about writing scripts in text files, saving theme as a .cmd file each and select them in the following screen when you create package files?

 

Scripts available for Android Enterprise and Android Classic are quite different.

Please check the scripts you want to use in the following sites.

<Android Classic>

https://www.soti.net/mc/help/v15.5/en/scriptcmds/reference/androidplus_classic.html?hl=script%2Ccommands%2Candroid%2Cplus%2Cdevices

<Android Enterprise>

https://www.soti.net/mc/help/v15.5/en/scriptcmds/reference/androidplus_enterprise_do.html?hl=script%2Ccommands%2Candroid%2Centerprise%3A%2Cmanaged%2Cdevices