I have a big and messy string.xml file with 3000 records, which most of the values are useless and never used inside code. I want to find and omit those useless records automatically. Is there a way to find useless records inside string.xml file?
How can I find all fake or useless string values in string.xml file?
1.9k Views Asked by Davoud AtThere are 5 best solutions below
On
Menu -> Analyze -> Run Inspection by Name -> Unused resources
Actual resource Is there any simple way to find out unused strings in Android project?
On
I would suggest the best way would be to load the XML into objects such as Python ElementTree. import xml.etree.ElementTree You can then easily Prune all the branches down easily before exporting as an XML file. To deal with XML on a string level is a nuisance.
On
I found the that using the lint check and the translations editor works like a charm.
Go Analyse -> Run inspection by name -> Unused resources.
Here i add a file mask to only show me the strings
After the check has ran go to the Translations Editor, find the key(s) right click and safe delete.
This checks of the resource can safely be deleted and deletes the key in all your locales.

Right click on
strings.xmlfile: Click onRefractorand then onRemove Unused Resources. Click onRefractorin the confirm Dialog Box.