Skip to content

Latest commit

Β 

History

History
106 lines (79 loc) Β· 4.44 KB

File metadata and controls

106 lines (79 loc) Β· 4.44 KB

AGENTS.md

This file provides guidance to AI agents when working with code in this repository.

Project Overview

Wire iOS is a secure messaging app built as a monorepo (wire-ios-mono.xcworkspace). The codebase combines modern Swift Package Manager modules with legacy Carthage/Xcode framework projects. The primary workspace file is wire-ios-mono.xcworkspace.

Prerequisites & Setup

  • Xcode: version specified in .xcode-version
  • Carthage: 0.39.1+
  • Ruby: version in .ruby-version, managed via rbenv
  • Git LFS: required for binary files

Initial setup:

./setup.sh

To update or rebuild dependencies, just re-run the setup.sh script when needed.

Build

Open wire-ios-mono.xcworkspace in Xcode and select the Wire-iOS scheme.

Testing

All the commands for testing are used via fastlane. This is what the CI executes. See fastlane/README.md for the common commands.

Note that the simulator model and OS version can be read in fastlane/.env

Run security tests from the command line:

xcodebuild test \
  -workspace wire-ios-mono.xcworkspace \
  -scheme Wire-iOS \
  -testPlan SecurityTests \
  -destination 'platform=iOS Simulator,name=iPhone 14,OS=26.0.1'

Available test plans in wire-ios/Tests/TestPlans/:

  • AllTests.xctestplan β€” all tests
  • UnitTests.xctestplan β€” unit tests only
  • UITests.xctestplan β€” UI tests only
  • SecurityTests.xctestplan β€” security-specific tests
  • GermanLocaleTests.xctestplan β€” German locale tests

The same -testPlan flag applies to the WireSyncEngine and WireDataModel schemes.

UI test methods must include a Testiny TC ID suffix, e.g. testLogin_TC_1234. UITests require a special env, that is filled by 1password command. See wire-ios/WireUITests/README for more information

Linting & Formatting

Both tools are distributed as SPM binary targets in scripts/Package.swift.

./scripts/run-swiftlint.sh    # lint
./scripts/run-swiftformat.sh  # format

Key rules enforced:

  • SwiftLint: TODOs must reference a JIRA ticket β€” // TODO: [WPB-123] description
  • SwiftFormat: max line width 120 chars, 4-space indent, imports sorted (testable-last)
  • Every Swift file must begin with the GPL v3 license header (year 2026)

Architecture

The app is layered. Data flows upward:

UI Layer          WireUI (SwiftUI) β€” WireDesign, WireConversationListUI, WireMainNavigationUI, etc.
                      ↑
Domain Layer      WireDomain β€” business logic, use cases, entity models
                      ↑
Sync Engine       wire-ios-sync-engine β€” network sync, push notifications, client-side logic
                      ↑
Data/Model        wire-ios-data-model (Core Data) + WireData (modern SPM layer)
                      ↑
Transport/Network wire-ios-transport + wire-ios-request-strategy + WireNetwork

Supporting modules (all SPM packages unless noted):

  • WireAuthentication β€” login flows, SSO
  • WireCalling β€” VoIP via AVS (open-source audio/video signaling)
  • WireCoreCrypto β€” Proteus/MLS end-to-end encryption
  • WireMessaging β€” messaging logic
  • WireBackup β€” import/export
  • WireAnalytics β€” analytics
  • WireLogging β€” structured logging
  • WireFoundation β€” shared utilities and test helpers
  • WireDebug β€” debug-only tooling

Legacy Xcode projects (in their own subdirectories): wire-ios-sync-engine/, wire-ios-data-model/, wire-ios-request-strategy/, wire-ios-transport/, wire-ios-system/, wire-ios-utilities/, wire-ios-testing/, wire-ios-images/, wire-ios-share-engine/, wire-ios-link-preview/, wire-ios-ziphy/, wire-ios-canvas/.

Code generation: Sourcery generates mocks (AutoMockable), SwiftGen generates string/asset accessors. Run via scripts/run-sourcery.sh and scripts/run-swiftgen.sh.

Conventions

  • Commits and PR titles must reference a JIRA issue: fix: description - WPB-XXXXX - see Conventional Commits
  • Code review uses conventional comments
  • Cherry-picked commits are marked with πŸ’
  • All colors in UI code must come from WireDesign.ColorTheme or WireDesign.BaseColorPalette
  • New UI elements require accessibilityLabel for VoiceOver / accessibilityIdentifier for UI tests
  • UI elements that display text must use the API that supports dynamic type / large fonts
  • Push notifications only work with the App Store-signed build (Apple security restriction)