← 全部工具

KevinDoremy/SearchDeadCode

热度 75 更新于 开发与构建

A fast CLI tool to detect and remove dead/unused code in Android projects (Kotlin & Java)

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

<div align="center"

<img src="assets/logo.svg" alt="SearchDeadCode Logo" width="120"/

SearchDeadCode

Find and eliminate dead code in Android projects

English · 简体中文 · 日本語 · 한국어

A fast Rust CLI to detect and safely remove dead code in Android projects (Kotlin & Java). Inspired by Periphery for Swift.

brew install KevinDoremy/tap/searchdeadcode  # macOS / Linux
cargo install searchdeadcode                  # via Cargo

<img src="assets/demo.svg" alt="SearchDeadCode Demo" width="600"/

</div

Why SearchDeadCode

  • Fast. Parse 1 000 files in under 1 second; 10 000 files in under 5 seconds.
  • Android-aware. Activities, Fragments, Compose, AndroidManifest, layout XMLs, DI annotations all auto-retained as entry points.
  • Hybrid analysis. Combine static analysis with JaCoCo / Kover / LCOV coverage and R8 usage.txt for confirmed findings.
  • Safe delete. Interactive, batch, and dry-run modes, with restore script generation.
  • Pairs well with kotlin-jump for editor-side navigation.

Comparison with alternatives

| Feature | SearchDeadCode | Android Lint | R8 / ProGuard | Detekt | IntelliJ | |---|:---:|:---:|:---:|:---:|:---:| | Speed | <1s/1k files | Slow | Build-time | Medium | Medium | | Kotlin-first | ✅ | Partial | ✅ | ✅ | ✅ | | Java support | ✅ | ✅ | ✅ | ❌ | ✅ | | Safe delete | ✅ Interactive | ❌ | ❌ | ❌ | IDE only | | CI / CD ready | ✅ SARIF, JSON | ✅ XML | ❌ | ✅ SARIF | ❌ | | Coverage integration | ✅ JaCoCo, Kover, LCOV | ❌ | ❌ | ❌ | ❌ | | Cycle detection | ✅ Zombie code | ❌ | ❌ | ❌ | ❌ | | Resource detection | ✅ | ✅ | ❌ | ❌ | ✅ | | Standalone (no build) | ✅ | ❌ | ❌ | ❌ | ❌ | | License | MIT | Apache | Proprietary | Apache | Proprietary |

When to reach for each: SearchDeadCode for fast CI feedback and project audits. Android Lint for broader Android-specific checks. R8 for production-build accuracy. Detekt for style and complexity. IntelliJ for interactive refactoring inside the IDE.

Quick start

# Analyze your Android project
searchdeadcode ./my-android-app

# Preview what would be deleted (no changes)
searchdeadcode ./my-android-app --delete --dry-run

# High-confidence findings only
searchdeadcode ./my-android-app --min-confidence high

Every command with its real output: docs/cli-tour.md.

Sample output