We present NetScope, a native macOS network scanner built from the ground up with Swift 5.9 and SwiftUI. Unlike Electron-wrapped or web-based alternatives, NetScope leverages Apple’s Network.framework, CoreWLAN, BSD sockets, and SystemConfiguration to deliver high-performance network discovery, TCP port scanning, ICMP diagnostics, continuous monitoring, and multi-format reporting — all within a privacy-respecting, sandboxed application. The tool integrates six modules (My Device, Discovery, Port Scanner, Ping & Traceroute, Monitor, Reports) into a NavigationSplitView three-column interface with SwiftData persistence, Swift Charts visualization, and XPC-based privileged helper for raw socket operations. NetScope supports macOS 14+ (Sonoma) on both Apple Silicon and Intel architectures, requires no external dependencies, collects no telemetry, and operates entirely offline after installation. Distributed as a native .dmg under the MIT license.
Network scanning and device discovery are fundamental tasks for system administrators, security professionals, and developers managing local infrastructure. While command-line tools such as nmap, arp-scan, and ping remain powerful, they require terminal proficiency and often lack visual feedback for non-technical stakeholders. Existing GUI alternatives on macOS frequently rely on Electron wrappers, introducing significant memory overhead and non-native user experiences.
NetScope addresses this gap by providing a fully native macOS application built exclusively with Swift and SwiftUI. By leveraging Apple’s first-party frameworks — Network.framework for TCP/UDP connections, CoreWLAN for wireless metadata, SystemConfiguration for network interface enumeration, and BSD sockets via an XPC privileged helper for ICMP operations — NetScope achieves performance characteristics unattainable by cross-platform wrappers while maintaining the visual polish and accessibility standards expected of macOS applications.
The primary contributions of this work are:
NetScope follows a layered MVVM (Model-View-ViewModel) architecture that cleanly separates concerns across five distinct layers:
The UI is built entirely with SwiftUI, utilizing NavigationSplitView for a three-column layout: sidebar navigation, device/result list, and detail inspector. Each module occupies its own view hierarchy, enabling independent state management and lazy loading. The dark-mode-first design adapts automatically to system appearance settings.
ViewModels are annotated with @MainActor and conform to ObservableObject, publishing state changes to SwiftUI views via @Published properties. Each module has a dedicated ViewModel that orchestrates its service layer interactions and manages UI state (loading indicators, error presentation, result sorting).
Network operations are encapsulated in Swift Actors, ensuring thread-safe concurrent access without explicit locking. Services expose AsyncStream interfaces for real-time result streaming — enabling the UI to display discovered devices and scan results as they arrive rather than waiting for batch completion.
The network layer integrates multiple Apple frameworks:
| Framework | Purpose | Module |
|---|---|---|
| Network.framework | TCP connections, TLS inspection, NWBrowser | Discovery, Port Scanner |
| CoreWLAN | Wi-Fi SSID, BSSID, channel, RSSI | My Device |
| SystemConfiguration | Interface enumeration, gateway detection | My Device, Discovery |
| BSD Sockets (via XPC) | Raw ICMP packets for ping/traceroute | Ping & Traceroute |
| dnssd / NWBrowser | Bonjour/mDNS service browsing | Discovery |
SwiftData provides local persistence for scan history, device profiles, monitoring events, and user preferences. The schema supports versioned migrations, ensuring data integrity across application updates. All data remains on-device with no cloud synchronization.
Displays comprehensive local system information: all network interfaces (en0, en1, utun*, bridge*) with IPv4/IPv6 addresses, subnet masks, and MAC addresses; default gateway and DNS servers; Wi-Fi details (SSID, BSSID, channel, band, RSSI, noise, PHY mode); and system metadata (hostname, macOS version, hardware model, uptime). Data is refreshed on-demand or automatically when network configuration changes via SCDynamicStore notifications.
Network-wide device scanning combines three complementary techniques:
NWConnection instances with short timeouts.sysctl to identify recently-seen MAC addresses and their IP mappings.Discovered devices are enriched with OUI vendor lookup (IEEE MA-L database), reverse DNS resolution, and fingerprinting heuristics based on open ports and service advertisements. Results are displayed in a sortable, filterable table with device type icons.
TCP connection scanning with configurable port ranges: Top 100, Top 1000 (IANA), or custom ranges. The scanner utilizes over 100 concurrent NWConnection probes with adaptive timeout scaling. For open ports, NetScope performs:
ICMP echo request/reply via the XPC privileged helper, which holds the necessary raw socket entitlements. Features include configurable packet count, payload size, interval, and TTL. Traceroute implements incremental TTL probing with three probes per hop, displaying RTT statistics and intermediate router addresses. The DNS query tool supports A, AAAA, MX, NS, CNAME, TXT, and SRV record types using dnssd APIs.
Continuous device polling with configurable intervals (default 30 seconds). Tracks device reachability state transitions (online/offline) and triggers macOS notifications via UserNotifications framework. Maintains a 24-hour rolling event history with Swift Charts visualization showing availability timelines. Supports threshold-based alerts for latency degradation and packet loss.
Multi-format export engine supporting:
| Format | Implementation | Use Case |
|---|---|---|
| CSV | Native String formatting | Spreadsheet analysis |
| JSON | Codable + JSONEncoder | API integration, archival |
| HTML | Template-based rendering | Browser viewing, email |
| Core Graphics + PDFKit | Professional reports, printing |
Reports include scan metadata (timestamp, duration, scope), device summaries, port details, and latency statistics. The print functionality integrates with macOS system print dialog for direct printer output.
NetScope implements defense-in-depth security:
SMJobBless. The main application communicates with the helper through a validated XPC connection with code signing requirements.NetScope leverages Swift’s structured concurrency throughout:
| Layer | Technology | Version |
|---|---|---|
| Language | Swift | 5.9 |
| UI Framework | SwiftUI | macOS 14+ |
| Persistence | SwiftData | 1.0 |
| Visualization | Swift Charts | 1.0 |
| Networking | Network.framework | macOS 14+ |
| Wireless | CoreWLAN | macOS 14+ |
| Configuration | SystemConfiguration | macOS 14+ |
| Privileged Ops | XPC + SMJobBless | macOS 14+ |
| Build System | XcodeGen | 2.38+ |
| Localization | String Catalogs | Xcode 15+ |
The project uses XcodeGen with a declarative project.yml configuration, eliminating Xcode project file merge conflicts in version control. The build pipeline produces a universal binary (arm64 + x86_64) distributed as a signed .dmg disk image. Installation follows the standard macOS drag-to-Applications pattern.
System requirements are minimal: macOS 14.0 (Sonoma) or later. The application consumes approximately 15–25 MB of RAM at idle and scales linearly with active scan scope. No external runtime dependencies are required — all functionality ships within the application bundle.
NetScope provides comprehensive keyboard shortcuts for all major operations:
| Shortcut | Action |
|---|---|
| Cmd+1 through Cmd+6 | Switch between modules |
| Cmd+R | Start/refresh scan |
| Cmd+. | Stop current operation |
| Cmd+E | Export results |
| Cmd+F | Filter/search results |
| Cmd+, | Preferences |
| Feature | NetScope | nmap (CLI) | Angry IP Scanner | LanScan |
|---|---|---|---|---|
| Native macOS UI | Yes (SwiftUI) | No (Terminal) | No (Java) | Yes (AppKit) |
| Zero Dependencies | Yes | No (libpcap) | No (JRE) | Yes |
| Port Scanning | Yes + TLS inspect | Yes (advanced) | Basic | No |
| Continuous Monitor | Yes (alerts) | No | No | No |
| Report Export | CSV/JSON/HTML/PDF | XML/text | CSV/TXT | CSV |
| ICMP Ping/Trace | Yes | Yes | Yes (ping only) | No |
| Privacy (No Telemetry) | Yes | Yes | No (updates) | Unknown |
| App Sandbox | Yes | N/A | No | Yes |
| Localization | EN + ID | EN only | Multi | EN only |
Several enhancements are planned for subsequent releases:
NetScope demonstrates that native macOS development with Swift and SwiftUI can deliver professional-grade network analysis tools without sacrificing performance for cross-platform compatibility. By leveraging Apple’s Network.framework, structured concurrency, and XPC privilege separation, NetScope achieves the responsiveness of command-line tools with the accessibility of a modern graphical interface. The zero-dependency, zero-telemetry architecture ensures that network professionals can trust the tool with sensitive infrastructure data while maintaining full App Sandbox security guarantees.
The application is open-source under the MIT license, inviting community contributions for additional protocol support, platform-specific optimizations, and localization expansions.