How 0-blu/stikjit works
1. Project shape
- StikDebug is a single iOS app target built in Xcode with SwiftUI.
- The app is entirely device-side/local: there is no backend service in the repo. Its “system boundary” is the connected iPhone/iPad plus a pairing file used to authorize device communication.
2. App shell and navigation
- StikJIT/StikJITApp.swift is the entry point.
- Views/MainTabView.swift likely hosts the primary navigation, with feature screens split into focused tabs/pages such as Home, Tools, Settings, Console Logs, Installed Apps, Process Inspector, Map Selection, and Profile.
3. Core device-communication layer
- The most important architectural boundary is the native device bridge in Utilities/IdeviceFFIBridge.swift plus the bundled idevice/libidevice_ffi.a and idevice/module.modulemap.
- This layer wraps the underlying idevice library and is the app’s gateway to pairing, device queries, process control, app launching, and JIT-related device operations.
4. Device session and connection state
- Utilities/DeviceConnectionContext.swift and related managers appear to hold the active session state with the device.
- Utilities/Security.swift and the pairing-file flow described in the README suggest that the app depends on imported pairing material to establish a trusted connection before any advanced action can happen.
5. JIT enablement pipeline
- The central feature is JIT enabling for sideloaded apps.
- Utilities/JITEnableContext.swift, Utilities/mountDDI.swift, and Utilities/Intents.swift indicate a multi-step orchestration around enabling developer capabilities, mounting the Developer Disk Image when needed, and then targeting a chosen installed app.
- The UI path is likely: user selects an app in InstalledAppsListView or HomeView, then the JIT context performs the device-side enablement.
6. Installed app and process management
- Views/InstalledAppsListView.swift and Views/ProcessInspectorView.swift are the main user-facing views for enumerating installed apps and running processes.
- Supporting utilities like DeviceInfoManager.swift and the device bridge provide the metadata and control operations needed to launch apps or terminate processes.
- This is a direct app-to-device control path, not a server-mediated workflow.
7. Logging and console streaming
- Views/ConsoleLogsView.swift is backed by Utilities/LogManager.swift, Utilities/LogManagerBridge.swift, and Utilities/SystemLogStream.swift.
- This subsystem likely aggregates both live system logs and app-specific logs, then streams them into the console UI.
- The data flow is one-way from device/system sources into the app’s log manager and then into the SwiftUI view.
8. Script automation subsystem
- The JSSupport folder (ScriptEditorView.swift, ScriptListView.swift, RunJSView.swift, JSDebugSupport.swift) is a separate automation surface inside the app.
- The bundled JavaScript files under Scripts/ (Geode.js, UTM-Dolphin.js, attachDetach.js, maciOS.js, manic.js, universal.js) are prebuilt workflows, likely used to automate JIT-related or device-specific actions.
- This subsystem is distinct from the main SwiftUI/device-bridge path: user selects or edits scripts, then JS support drives scripted device interactions.
9. Location simulation and background helpers
- Views/MapSelectionView.swift and Utilities/BackgroundLocationManager.swift indicate a location-spoofing or location-simulation feature.
- Utilities/BackgroundAudioManager.swift suggests the app uses iOS background modes to keep certain workflows alive or stable while device interaction is in progress.
- These helpers are supporting infrastructure, not primary features, but they affect runtime behavior and background execution.
10. App metadata, UI polish, and auxiliary utilities
- Utilities/DeviceInfoManager.swift, AppStoreIconFetcher.swift, HapticFeedbackHelper.swift, Localization.swift, TabConfiguration.swift, and Extensions.swift are cross-cutting support code.
- These modules feed richer UI state, device metadata, icons, localization, and convenience behavior into the main screens.
11. State boundaries and flow
- The main data flow is: user action in SwiftUI view → context/manager in Utilities → native device bridge / system APIs → device response or log stream → updated UI state.
- The app’s architecture is therefore “UI + orchestration layer + native device bridge,” with separate subfeatures for logs, scripts, process/app management, and location simulation.
12. Build and distribution
- The repository is Xcode-centric (StikDebug.xcodeproj) with GitHub Actions workflows for building an IPA and updating the source distribution metadata.
- That means the repo supports both local development/debugging in Xcode and packaged release distribution, but the runtime architecture remains entirely client-side on iOS.
Main entry points: MainTabView.swift Main tabs · IdeviceFFIBridge.swift iDevice bridge · JITEnableContext.swift JIT pipeline · LogManager.swift Log manager
Components 22
App shell
SwiftUI entry point and primary navigation
Device control
Native device bridge, session state, and JIT orchestration
- Device session · Active connection and device-session state
StikJIT/Utilities/DeviceConnectionContext.swift - iDevice bridge · Native wrapper around libidevice for pairing and control
StikJIT/Utilities/IdeviceFFIBridge.swift - JIT pipeline · Coordinates enablement flow for targeted apps
StikJIT/Utilities/JITEnableContext.swift - Mount DDI · Developer Disk Image mounting step
StikJIT/Utilities/mountDDI.swift - Intents · Device-side commands and intent helpers
StikJIT/Utilities/Intents.swift - Log manager · Collects and prepares logs for the console
StikJIT/Utilities/LogManager.swift - Security · Pairing-file and trust handling for device access
StikJIT/Utilities/Security.swift
Feature surfaces
User-facing tools built on top of the device layer
- Home · Landing surface for the app's main actions
StikJIT/Views/HomeView.swift - Tools · General-purpose control and utilities screen
StikJIT/Views/ToolsView.swift - Settings · Configuration and app options
StikJIT/Views/SettingsView.swift - Profile · Device or user profile surface
StikJIT/Views/ProfileView.swift - Installed apps · Lists installed apps for JIT and launch actions
StikJIT/Views/InstalledAppsListView.swift - Process inspector · Shows running processes and control actions
StikJIT/Views/ProcessInspectorView.swift - Console logs · Live log console for streamed device output
StikJIT/Views/ConsoleLogsView.swift - Map selection · Location simulation or map-based selection UI
StikJIT/Views/MapSelectionView.swift - JS support · JavaScript editing and execution surface
StikJIT/JSSupport/JSDebugSupport.swift
Support systems
Shared helpers, scripts, and distribution/build plumbing
- Scripts · Bundled automation workflows for device actions
StikJIT/Scripts/universal.js - Device info · Fetches device and app metadata for UI and actions
StikJIT/Utilities/DeviceInfoManager.swift - Background helpers · Background audio and location support
StikJIT/Utilities/BackgroundAudioManager.swift - UI support · Icons, haptics, localization, and tab config
StikJIT/Utilities/TabConfiguration.swift
Connections 27
- App entry → Main tabs: launches · App entry loads the main navigation shell
- Main tabs → Home: shows · Main tabs include the home dashboard
- Main tabs → Tools: shows · Main tabs include tools
- Main tabs → Settings: shows · Main tabs include settings
- Main tabs → Profile: shows · Main tabs include profile
- Main tabs → Installed apps: shows · Main tabs include installed apps
- Main tabs → Process inspector: shows · Main tabs include process inspection
- Main tabs → Console logs: shows · Main tabs include console logs
- Main tabs → Map selection: shows · Main tabs include map selection
- Home → JIT pipeline: starts · Home can trigger the JIT enablement flow
- Installed apps → JIT pipeline: targets · Selected installed apps feed the JIT pipeline
- Process inspector → Intents: controls · Process actions route through device intents
- JIT pipeline → Mount DDI: mounts · JIT flow may mount the developer disk image
- JIT pipeline → iDevice bridge: uses · JIT flow delegates device operations to the native bridge
- iDevice bridge → Device session: updates · Bridge operations depend on the active device session
- Device session → Security: requires · Trusted connection depends on pairing and security material
- iDevice bridge → Device info: queries · Bridge and session use device metadata
- Console logs → Log manager: reads · Console view consumes aggregated log state
- Log manager → iDevice bridge: streams · Log manager receives device-side output through the bridge
- Log manager → Console logs: renders · Managed logs are presented in the console UI
- JS support → Scripts: runs · JS support executes bundled scripts
- JS support → iDevice bridge: drives · Script runtime can invoke device bridge actions
- Map selection → Background helpers: uses · Location UI depends on background helpers
- Tools → UI support: uses · Tooling screens rely on shared UI helpers
- Home → UI support: uses · Home shares icons, haptics, and localization
- Installed apps → Device info: uses · Installed-app listing needs app and device metadata
- Process inspector → Device info: uses · Process inspection uses device metadata