且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从 android 项目中删除所有未使用的资源

更新时间:2021-07-07 10:09:08

您可以从 Android Studio 轻松搜索未使用的资源.只需按 CtrlAltShifti 并输入未使用的资源"(不带引号)).这将执行 lint.运行 lint 命令(以及来自 IDE 的其他内容)的超级简单方法.

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).

Android Studio 菜单 > 重构 > 删除未使用的资源...

选择要删除的资源.您可以通过右键单击资源项来排除要保留的资源.

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.

更新:使用 OptionShifti for mac

Update: use OptionShifti for mac