Developer-first HTTP interception and mocking for iOS.
Capture, inspect, debug, and mock network requests with zero configuration and zero dependencies.
Inspectly is a lightweight HTTP inspector and API stubbing toolkit for iOS.
It automatically captures network traffic, provides an in-app inspector, and allows you to create and manage mocked API responses directly from live requests.
Built on top of the Foundation networking stack, Inspectly works seamlessly with URLSession, Alamofire, AFNetworking, and any networking layer powered by Foundation.
- Automatic request interception with zero setup
- Zero external dependencies
- In-app inspector UI with Requests, Statistics, Stubs, Settings, and Dismiss tabs
- Uses the standard system
TabViewand supports Dark Mode - Request and response inspection including headers, bodies, timing, and metadata
- Rich HTML Rendering — interactive preview for HTML responses
- Smart Content Detection — automatic content-type sniffing when server headers are misleading
- Sensitive Header Masking —
Authorization,Cookie,X-Api-Keyand other sensitive headers are hidden by default with a per-header reveal toggle
- Search, filter, sort, favorite, pin, and tag captured requests
- Paginated request list with auto-load-more
- Copy as cURL — swipe action on any request to copy a shell-escaped cURL command
- Request Replay — re-run a captured request with optional edits and see real status/duration/body
- Generate Swift Model — convert a JSON response into a Codable Swift model, ready to copy or share
- Export logs as JSON directly from the app
- Create stubs directly from any captured request in one tap
- Method-Only Matching — stubs match by HTTP method; no complex URL rules needed
- Response defined by status code + body only
- Endpoint URL is shown on each stub for reference
- Enable, disable, duplicate, group, and manage stubs
- Export stubs as JSON for sharing or version control
- Slow Request Detection — configurable threshold highlights slow requests with visual indicator
- Network Throttling — simulate Edge, 3G, LTE, or custom bandwidth/delay conditions
- Performance Heatmap — top 5 slowest endpoints with color-coded average response time bars
- Performance Timeline — interactive waterfall with zoom, time ruler, blocking detection, and tap-to-detail
- Security Scanner — auto-detects HTTP traffic, missing security headers, exposed secrets, and sensitive query parameters
- Duplicate Detector — surfaces endpoints called multiple times with a repeat count badge
- Large Response Warning — flags responses over 1 MB in Statistics and the request list
- Timeline view for DNS, connect, TLS, TTFB, and transfer phases
- cURL export with correct shell escaping for all requests
- Local alerts for slow requests, error responses, and traffic to specific hosts
- Foreground banner support with tap-to-open request detail
- Response Body Search — full-text search inside JSON/plain-text responses with next/prev highlight navigation
- Full-Text Search — search across URL, method, host, status code, request body, response body, and error messages
- Configure max stored requests (100–2500)
- Ignore specific hosts from being captured
- Light / Dark / System theme override
- Auto-prettify JSON responses
- Notification controls for slow/error/host alerts
- Data management: export logs/stubs, clear all logs
- iOS 15.0+
- Swift 5.9+
- Xcode 15+
The inspector UI, request capture, and stubbing all run on iOS 15.0 and later.
dependencies: [
.package(url: "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/balitax/Inspectly.git", from: "1.4.0")
]Then add Inspectly to your target dependencies.
import Inspectly
@main
struct MyApp: App {
init() {
Inspectly.enable()
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}Inspectly.presentInspector()import Inspectly
@main
struct MyApp: App {
init() {
#if DEBUG
Inspectly.enable()
#endif
}
var body: some Scene {
WindowGroup {
ContentView()
}
}
}import Inspectly
let configuration = Inspectly.Configuration(
isStubEnabled: true,
ignoredHosts: ["example.com"],
isShakeGestureEnabled: true,
ignoreLocalhost: true
)
Inspectly.enable(with: configuration)Note: Request logging is always enabled once Inspectly is integrated. There is no logging toggle.
| Option | Type | Default | Description |
|---|---|---|---|
isStubEnabled |
Bool |
true |
Enable or disable request stubbing globally |
networkThrottlingPreset |
NetworkThrottlingPreset |
.off |
Simulate network conditions (Edge, 3G, LTE, Custom) |
ignoredHosts |
[String] |
[] |
Hosts to exclude from capture |
isShakeGestureEnabled |
Bool |
true |
Open the inspector by shaking the device |
ignoreLocalhost |
Bool |
true |
Ignore localhost and 127.0.0.1 |
stubRepository |
StubRepositoryProtocol? |
nil |
Provide a custom stub repository |
Inspectly.enable(isEnabled:with:)Inspectly.disable()Inspectly.presentInspector(rootView:)Inspectly.isEnabledInspectly.container
Inspectly works with:
URLSession- Alamofire
- AFNetworking
- Any networking library built on top of Foundation
No custom interceptor setup is required for common use cases.
A standalone Demo app is included under Demo/. It is not part of the Swift Package, so users who install Inspectly do not get the demo app.
To run it:
cd Demo
xcodegen generate
xcodebuild -project InspectlyDemo.xcodeproj -scheme DemoApp -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.5' build| Demo App | Requests | Request Detail |
|---|---|---|
![]() |
![]() |
![]() |
| Statistics | Stubs | Settings |
|---|---|---|
![]() |
![]() |
![]() |
- Enable Inspectly in your app
- Trigger real API calls
- Open the inspector using
Inspectly.presentInspector()or shake gesture (if enabled via configuration) - Browse captured requests
- Copy any request as cURL, replay it, or generate a Swift model from its response
- Create a stub from an existing request
- Adjust the mocked response in the Stubs tab
- Re-run the flow with stubs enabled
- iOS 15 minimum deployment target — raised from iOS 13 to support a single consistent codebase for capture, stubbing, and the inspector UI
- Inspector UI refresh — standard system
TabViewwith Requests, Statistics, Stubs, Settings, and Dismiss tabs; full dark mode support - Logging always on — removed the
isLoggingEnabledtoggle; capture starts as soon as Inspectly is enabled - Simplified stubbing — stubs now match by HTTP method only; removed URL/header/body match rules and connection-error simulation
- Stub endpoint reference — each stub displays the URL endpoint it was created from
- Copy as cURL — swipe action on any request in the list
- Request Replay — re-run requests with optional edits and inspect real responses
- Performance Timeline — interactive waterfall with zoom, time ruler, and blocking detection
- Security Scanner — automatic detection of HTTP traffic, missing headers, exposed secrets, and sensitive query parameters
- Generate Swift Model — turn JSON responses into Codable Swift models with Copy + Share
- Local Notifications — alerts for slow requests, error responses, and specific hosts, with tap-to-detail
- Demo app moved —
DemoApp/relocated toDemo/so the package itself no longer includes the example app
- Security — masked sensitive headers in JSON export/share (previously only
curlCommandand the UI masked them), excluded stored request data from device backups and added file protection, and hardenedHTMLPreviewView's WKWebView against navigating away from a malicious/MITM'd response body. - Cleanup — removed the dead
NetworkObserverServicesubsystem, a stale commented-out UI block, and an unused property. - Refactor — split
SettingsView,StatisticsView,RequestListView, andInspectlyURLProtocolinto smaller per-section/per-responsibility files with no behavior change.
- Restored iOS 13.0 minimum deployment target —
Package.swiftis SPM-installable again from iOS 13. The inspector UI still requires iOS 16.0+ (all Views/ViewModels are@available(iOS 16.0, *)); on iOS 13–15,presentInspector()shows an alert instead of crashing or silently no-op'ing, while request capture and stubbing keep running viaenable().
- Performance Heatmap — top 5 slowest endpoints visualized as color-coded bars (green < 500ms, orange < 2s, red ≥ 2s)
- Duplicate Detector — groups requests by method + URL and surfaces repeated calls with a count badge
- Large Response Warning — responses over 1 MB are flagged in the Statistics view and marked with a warning indicator in the request list
- Response Body Search — full-text search inside JSON and plain-text responses with next/prev highlight navigation and a fixed search bar
- Floating tab bar now hides automatically when entering Request Detail
- Dismiss tab added for quick close
- Fixed next/prev highlight scroll in response body search
- Settings: removed Shake to Open toggle from UI (still configurable via
Inspectly.Configuration)
- iOS 16.0 minimum — dropped iOS 13–15 support
- Liquid glass-inspired floating tab bar for iOS 16–25
- Inspector now presents fullscreen
- Revamped DemoApp with card layout and response console
- Fixed dark mode statistics cards visibility
- Converted
StorageManagertoactor(eliminates Sendable warnings) - Removed all redundant
@availableannotations
- Flexible stub URL matching: Exact, Contains, Prefix, Suffix, Regex
- Batch-mark all matching URL requests as stubbed when a stub is saved
- Clearing all requests now also clears all stubs
- Configurable slow request detection threshold (Settings → Performance)
- Search covers response body, request body, and error messages
- Sensitive header masking with per-header reveal toggle
- Paginated request list with auto-load-more
- Configurable max stored requests (100–2500)
- cURL export with correct shell escaping
- Full UI revamp: Request Detail, Request List, Statistics, Stubs, Settings
- Initial release
Contributions are always welcome.
If you would like to improve the UI, add new features, improve performance, or fix bugs, feel free to open an issue or submit a pull request.
Inspectly is available under the MIT license. See LICENSE for more information.
Made with ❤️ by Agus Cahyono






