How to delete all files from assets with Companion

Here is an app that can be used to remove all files from assets with Companion - regardless of the Android version of the test device. This is sometimes necessary so that it still works (properly), for example after an extension update.

deleteAssetsCompanion.aia (800.7 KB)
Credit to Sunny - @vknow360 for his FileTools extension!

Android 9:

After that, disconnect Companion, reload the browser and reconnect to Companion...

8 Likes

This is a much-needed tutorial :kissing_heart:

1 Like

Very useful app !
What about deleting files from Companion asd ?

It does exactly that.

1 Like

I don't see where the blocks delete files from the:

/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files

directory ? (or am I missing something)

Ok, I understand it's supposed to clear the whole ASD. Yes, of course that's not a problem either, but it's not the topic here.

Please expand your block

If I understand well your block delete the folder, will this folder be re-created by companion?
Can I use this block instead of use Delete all assets button ?

How about trying it out?
Anyway, the answer is yes.

Why did you make many blocks for deleting assets files instead of deleting asd folder ?

Read the topic.

1 Like

For example: If many files have already been downloaded to the ASD (e.g. big videos), then these files would have to be downloaded again afterwards.

The purpose of the app is to only delete the assets and NOT all files in the root direcrtory and all subfolders of the ASD - as the topic already says.

for me, I choose to download the aia, unzip,delete assets folder, upload again.

But what for? What is that supposed to do?

ah, I misunderstand you. you are deleting the files in assets only from cellphone. but what is that for?

The app is about emptying the assets folder on the test device. This is useful, among other things, if extensions are to be updated correctly (as already explained in the description).

all this will update the extension in companion.

Is that a statement or a question?
If it's a statement, then it's true.
It will update all used extensions with Companion.

yes it's a statement. All this can update the extension, why need to delete all files from assets manually?

Yes, if there is only a problem with one extension, just emptying the comp folder would also be sufficient. But why make it more complicated than necessary? Because the assets are read in again when you restart anyway.

1 Like