How to clear the cache of zebra devices for apps I have installed

Solved
HI
HamiltonJet IT
hamiltonjet

Hello there,

I'm in need of clearing the cache of two apps that I've installed on my zebra devices, there seems to be a few ways to achieve this but I'm not sure which is the best for me. I want to clear the cache of two specific apps I've installed weekly.

Any help is much appreciated.

3 days ago
Android Scripting
ANSWERS
RS
Rafael Schäfer
2 days ago (edited 2 days ago)

Depending on what version you are running, you can do it via JS for example as we use it (here for example for chrome, so you can call the function several times in a row with different bundleIDs being provided):

//0 = cache, 1 = cache & data
CleanApp('com.android.chrome', 1);
mobicontrol.agent.checkIn();

function CleanApp(BundleID, mode) {
    if (mode == 0) {
        mobicontrol.app.clearCache(BundleID);
    } else if (mode == 1) {
        mobicontrol.app.clearData(BundleID);
    }
}

Minimum agent version required for this is 2025.0.0!
https://soti.net/mc/help/javascriptapi/en/mobicontrol.app.html#.clearCache

For legacy you can use following:

clearappcache "com.android.chrome"

But here I'm not sure if it really just clears cache or entire data as we never used the legacy one.
https://soti.net/mc/help/v15.6/en/scriptcmds/reference/androidplus_enterprise_do.html#:~:text=org%22%20%2Dsn%2000A03DB42A7841AFF5-,clearappcache,-Clears%20the%20cache

Solution
DR
Darius Russell
2 days ago

Just off the back off this if you are on a version below 2025.0.0, you can set up a task scheduler profile on a schedule to run a script to automatically wipe the app cache at set intervals (weekly for example).

An alternitave script for this is:

wipeapplication com.android.chrome

Ah yes, wipeapplication was to delete all data (incl. cache) and mine one was then by sure only for the cache only.

And the task profile works with any of the provided scripts if needed on a scheduled base which i hope isn't the case for app wiping (except for shared device mode on logout for example).

HI
HamiltonJet IT
2 days ago

Hey Rafael,

This is just what I needed, I will run a test then set a schedule to run it weekly.

Thank you.

Ben Fox

Would be nice if you mark the relevant post as Solution when everything wents fine.

Glad to help.