How to Stop a Running App and Auto-Reinstall Missing Apps via SOTI MobiControl

IK
ismail kurnaz
mobisis2025

Hello Dear SOTI Users,

I have two questions for you:

1️⃣ Is it possible to stop a running application on a device via a script from the console?
I tried the kill and stop packagename commands, but they didn’t work.
Is there a correct method or an alternative command for this?

2️⃣ There are about 1,300 Samsung devices registered in the console, and kiosk mode is not enabled on them.
We’ve allowed users to uninstall certain apps (in some cases, this is necessary).
However, when users uninstall the app, they often don’t reinstall it afterward.
Is there any setting or mechanism in MobiControl that can automatically check which apps should be installed on the device and reinstall any missing ones?

I know this is a bit of an unusual request, but maybe someone has faced a similar scenario 😊

Thank you!

a month ago
SOTI MobiControl
ANSWERS
B
Börge
a month ago

Hi Ismail,

regarding your first topic following JS command is working for us:

mobicontrol.app.stop('com.google.android.apps.youtube.music');
 
Best regards
Börge
IK
ismail kurnaz
a month ago

Hello Börge, Thank you.This script solved the problem, and kill_application packname also works in the script.

RS
Robert Schäfer
a month ago (edited a month ago)

Hi Ismail,

Kill application:

What Borge said, or use a legacy script like so: kill_application <package_name>.

Reinstall behaviour:

The only way you would be able to control what apps can be uninstalled, is if you are refering to apps deployed via packages (not via the google playstore). There's no mechanism for controling per app uninstallation for google play apps.

Based off the assumption that you are refering to apps installed via a package, there is no standard mechanism to re-install it if its been uninstalled that you can enable.

However you could certain design a solution for this using JS, whereby you check whether an app is installed periodically and if not use mobicontrol.packages.install (https://www.soti.net/mc/help/javascriptapi/en/mobicontrol.packages.html|) to then re-install the app.

If you are reffering to google play apps, they do re-install but i have also seen issues with how quickly this happens. It does not appear to coincide with a check in, whether triggered manually, by the update schedule or a profile/policy update. I believe it relates to a device side application check of the playstore but its not something i have investigated in depth as we tend to use a kiosk, trust our users to be able to to re-install themselves or prevent uninstallation altogether.

IK
ismail kurnaz
a month ago

Thank you Robert,

I am installing with the package. Then I assign these packages to the profile and send them to the device. I will test with the script.

A
ASMOD@SOTI
a month ago

Hi Ismail,

Thanks for posting on SOTI Pulse, and many thanks to Borge and Robert for their valuable inputs — your expertise and willingness to help are greatly appreciated.

  1. Stopping a running application:
    As mentioned by Borge and Robert, you can use the following JavaScript command:
    mobicontrol.app.stop("<bundleid>"); 

    Alternatively, you can try the legacy script:
    kill_application <package_name>

  1. Automatically reinstalling uninstalled applications:
    At present, there’s no built-in mechanism in MobiControl to automatically reinstall a MGP application once it has been manually uninstalled from the device. To prevent uninstallation, you can mark the app as Mandatory, ensuring it remains installed. However, if it’s configured as Suggested, MobiControl cannot enforce reinstallation.

You may also explore the periodic check approach suggested by Robert by designing a custom JavaScript suited to your use case to detect and reinstall missing apps as needed.

If you have additional questions, please do not hesitate to reach out or you can contact SOTI Support (support@soti.net) to open a new case and one of our support engineer will be there to assist you.

Kind Regards,

Aditi Sharma, Technical Support, SOTI | Call Us | SOTI.net | Discussion Forum | Log a Case Online