A minimal, modular iOS app (Swift + SwiftUI) demonstrating an internal developer debug menu for QA and engineering workflows.
- Built with Swift and SwiftUI (iOS 15+)
- Reveal the debug menu with the device Shake gesture (simulator: use
Hardware β Shake Gestureor trigger via code) - Includes feature flags, device diagnostics, and feedback JSON export
- Small, clean codebase that is easy to extend and integrate into other apps
- π Shake to reveal an in-app Debug Menu
- βοΈ Feature flag toggle(s) (demo)
- π± Device & OS diagnostics (printable to console)
- π Export feedback as JSON (printed in MVP β extendable to file upload)
- π§© Modular file layout for quick onboarding and extension
- Launch the app in Simulator or on a device.
- Trigger a Shake (Simulator:
Device β Shakeor menuHardware β Shake Gesture) β the debug menu appears. - Use toggles to enable demo feature flags, print device info, or
Send Feedback JSONwhich prints a JSON payload to the console (MVP behaviour).
The debug menu is implemented as a SwiftUI view and is toggled via a
NotificationCenterevent published by an overriddenUIWindow.motionEndedhandler inShakeGesture.swift. This keeps the UI declarative and the event handling platform-friendly.
- DebugApp.swift β App entrypoint (
@main) that launchesContentView. - ContentView.swift β Main screen and the
@Statethat controls debug menu visibility. Attaches.onShakemodifier. - DebugMenuView.swift β Debug UI: toggles, device info button, feedback action.
- ShakeGesture.swift β
UIWindowoverride to post.deviceShakenNotification andView.onShake(_:)modifier to observe it.
The repo includes a small test target with example tests using XCTest. Suggested test cases:
- Verify feature flag default state and toggle behavior.
- Verify feedback JSON formatting utility (if moved into a helper).
- Verify debug visibility state toggles when receiving the
.deviceShakennotification (unit-testable by posting the notification).
Run tests in Xcode with:
β + U
- Clone the repo:
git clone https://github.com/umaidshahid/debug-app
cd DebugApp
Open the Xcode project/workspace (e.g., DebugApp.xcodeproj) in Xcode 15+.
Select a Simulator or a connected device.
Build & run (β + R). To reveal the Debug Menu in Simulator: Device β Shake (or Hardware β Shake Gesture).