Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What and why some files are installed in data/local/tmp

Tags:

android

I am making one app on Android and I have no idea what is doing one file which is installed after app installation. This file is quite big (this is about this same size as installed apk - even after uninstall ~ 5MB) so this is the reason of my question.

he file is set in data/local/tmp/'name of my apk'.apk

What is it and when it is deleted, because when I'm testing my app on emulator and uninstall it then it still exists.

EDIT AND ANSWERS:

I am not sure of my app is using tmp files. The only file or resource my app is using is movie placed in resources folder which is around 5MB. Deleting this file after app uninstall brings back free space. Before uninstall no. But I want to have deleted it melodramatically or not created at all because this file makes me app 2 times bigger.

like image 900
sebap123 Avatar asked Sep 07 '25 14:09

sebap123


1 Answers

The files in there are temporary files and you can safely delete them. For instance, these are created when you:

  1. Install an APK trought the command line with adb install (the temporary file will have the same name as the original file);
  2. Install / Run an application through Android Studio (the temporary file will have the application package name).

To easily list all the temporary files, you can use the following command:

adb shell ls /data/local/tmp

To remove all of them, you can just use the following command:

adb shell rm /data/local/tmp/*
like image 126
Jorge Galvão Avatar answered Sep 10 '25 05:09

Jorge Galvão