https://github.com/getsentry/Reaper-iOS
A tool for detecting unused code
https://github.com/getsentry/Reaper-iOS
tag-to-be-production-20250623
Last synced: 5 months ago
JSON representation
A tool for detecting unused code
- Host: GitHub
- URL: https://github.com/getsentry/Reaper-iOS
- Owner: getsentry
- License: mit
- Created: 2022-06-07T14:23:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-08T18:55:04.000Z (6 months ago)
- Last Synced: 2025-07-08T19:48:56.534Z (6 months ago)
- Topics: tag-to-be-production-20250623
- Language: TypeScript
- Size: 181 KB
- Stars: 36
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reaper
A framework for detecting dead code at runtime - Reaper is an SDK added to your app to report which Swift and Objective-C types were used for each user session. It supports all classes written in Objective-C, most non-generic Swift classes, and some Swift structs/enums.
The framework detects the set of classes that are used, and the `Scripts` directory in this repo contains a program to determine the set of all possible types that reaper can detect.
The difference of these sets are the unused types.
See additional [resources](#resources) below.
## Installation
### Swift Package Manager
Add Reaper as a dependency with Swift package manager using the URL https://github.com/getsentry/Reaper-iOS.git
### CocoaPods
Add Reaper to your Podfile:
```Ruby
target 'MyApp' do
pod 'Reaper', '~> 1.6'
end
```
### XCFramework
Download the latest XCFramework from [Github releases](https://github.com/EmergeTools/Reaper/releases).
## Setup
Start the SDK at app launch by adding the following code:
```Swift
import Reaper
...
EMGReaper.sharedInstance().start { types in
// Handle list of used types
}
```
## Determining all types
Run `tsc ./Scripts/main.ts` then `node ./Scripts/main.ts PATH_TO_YOUR_APP.app`
## Resources
- [Example backend](https://github.com/getsentry/reaper-server)
- [Performance & Size Impact](https://docs.emergetools.com/docs/reaper#performance-impact)
- [Open sourcing Reaper](https://blog.sentry.io/an-open-source-sdk-for-finding-dead-code/)
- [Launch Blog Post](https://www.emergetools.com/blog/posts/dead-code-detection-with-reaper).
- [Reaper for Android](https://github.com/EmergeTools/emerge-android/tree/main/reaper)