Stf: Automatically cleanup installed app when you stop using the device

Created on 12 Jan 2016  路  8Comments  路  Source: openstf/stf

Hi guys:

I met a problem when I use stop using selected device:

  1. I selected one ZTE device.
  2. Install an app.
  3. Stop using and reuse it.
  4. I found the installed app cleaned up by stf device plugins. Other devices like XiaoMi, Huawei, Nexus don't have this problem

Please give some guidance.

Thanks
Luis

Most helpful comment

It's now possible to disable the cleanup plugin by using stf local -C or stf local --no-cleanup. Same for the provider unit if you use it separately.

All 8 comments

Reset the device, this problem fixed. But it still welcome some reasons from your side.

Well, as far as I know. This is an intentional feature not a problem. When you are sharing devices with others, you don't wanna keep development binaries inside device.

This is how this feature works,

  1. device unit will store a list of pre-installed apps when device is connected to provider
  2. on group.leave (Stop Using), it will again list packages and uninstall all the new apks installed by the user.

In case, XiaoMi, Huawei, Nexus is not uninstalling app after device session is over, then there is a problem. Can you recheck again on those devices? In case they don't uninstall apps, could you also post stf logs.

@vbanthia , thanks for your explanation.
But it seems current stf in my side doesn't do clean up package for most devices. Just attached log after I stop using one device:

IMP/device:plugins:group 16737 [ZTEG719C] No longer owned by "[email protected]"
INF/device:plugins:group 16737 [ZTEG719C] Unsubscribing from group channel "+8mzY+tCS9eTFOeIyyuXOA=="

Well logs in my case looks like this

IMP/device:plugins:group 5244 [EP7351U3WQ] No longer owned by "[email protected]"
INF/device:plugins:group 5244 [EP7351U3WQ] Unsubscribing from group channel "CofgpJOkQ5Oi//7sPUsT9g=="
INF/device:plugins:cleanup 5244 [EP7351U3WQ] Cleaning up package "com.vbanthia.androidsampleapp"

As you can see the last line, it is from cleanup plugin, which clean all the new added apps. In my case it was com.vbanthia.androidsampleapp. cleanup plugin uninstalled it.

I think, the reason why stf is not uninstalling apk in your case is because your apk was already present in the device when your first connected it to stf. So according to cleanup plugin, it is not a new entry. I know this is not very good design but we are working on making it better and probably release it in next big release.

So, I advice you to clean your device first i.e, uninstall all the unnecessary apk and then connect it to stf provider.

If the above solution does not works, then it may be problem with your device. I am not sure if we can provide any support remotely. In this case you can either debug your self by debugging cleanup plugin or being a Hardware Sponsor

Thanks for your advice.

Hi, is it possible to disable this feature? Since testing work here in my place requires the application to run for quite a long time and we are taking parts managing them, stop using will cause the application to stop running, which is not an expected result.

Thanks!

Well currently it is not possible to hide this feature without changing the code itself.

In case you are okay with editing code and building stf yourself then just comment out the below line, stf will not uninstall any app later.

https://github.com/openstf/stf/blob/master/lib/units/device/index.js#L35

It's now possible to disable the cleanup plugin by using stf local -C or stf local --no-cleanup. Same for the provider unit if you use it separately.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ThinkerT picture ThinkerT  路  4Comments

luoxi001713 picture luoxi001713  路  5Comments

PariKdm picture PariKdm  路  4Comments

WillyRL picture WillyRL  路  8Comments

vovinio picture vovinio  路  5Comments