I want to remove all unused layouts, strings, drawables, colors, etc from my Android res directory. Are there any tools that will give me a list of files and I can remove from my repository and elements within specifics files (e.g. unused string entries) that are no longer used?
To run it on whole project go to Analyze -> Run inspection by name... , type Unused declaration and select desired scope. Then carefully check output and mark some classes as entry points if needed. Now you can select Unused declaration node in list and perform Safe delete action on all unused declarations at once.
TL;DR: No. It will not cause any problems. Hidden folders in your home directory should contain only application settings.
You can easily search for unused resources from Android Studio. Just press CtrlAltShifti and type "unused resources" (without quotes). That will execute lint. Super easy way to run lint commands (and other stuff from IDE).
OR
In Android Studio Menu > Refactor > Remove Unused Resources...
Select the resources you want to remove. You can exclude resources you want to keep by right-clicking on the resource item.
Use Do Refactor to remove all Resources at once.
Update: use ⌘OptionShifti for mac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With