An iOS app integrating Sentry to demo its various product features. See Empower: How to Contribute for more information.
- macOS with Xcode 15.0 or later
- Homebrew (will be installed automatically if not present)
- Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/sentry-demos/ios.git cd ios
-
Run the automated setup:
make init
This command will:
- Install Homebrew (if not already installed)
- Install required tools via
brew bundle
(sentry-cli, gh) - Create a
.env
file with placeholder values - Set up Xcode first launch (fixes CoreSimulator issues)
- Download iOS platform images if needed
-
Configure Sentry authentication:
sentry-cli login
Use an org-level auth token from your Sentry organization. See
sentry-cli
docs for more information. -
Update environment configuration: Edit the
.env
file and provide valid values:SENTRY_ORG=<your-org-slug> SENTRY_PROJECT=<your-project-slug>
Default values (for demo purposes):
SENTRY_ORG=demo SENTRY_PROJECT=ios
-
Optional - Use custom Sentry DSN: If you want to send events to a different org/project than the default, update the DSN in
EmpowerPlant/AppDelegate.swift
:options.dsn = "https://[email protected]/project-id"
-
Open the project in Xcode:
open EmpowerPlant.xcodeproj
-
Run the app:
- Click the "Play" button (
▶️ ) in Xcode, or - Press
⌘R
, or - Select Product > Run from the menu
- Click the "Play" button (
-
Choose your target:
- iOS Simulator (recommended for development)
- Physical device (requires Apple Developer account)
Run the test suite:
make test
This will:
- Run unit tests on the latest iOS Simulator
- Generate code coverage reports using Slather
CoreSimulator out of date error:
make init # This runs xcodebuild -runFirstLaunch to fix the issue
Missing iOS SDK:
xcodebuild -downloadPlatform iOS
Build failures:
- Ensure you have the latest Xcode version
- Clean build folder:
⌘+Shift+K
in Xcode - Reset package cache:
File > Packages > Reset Package Caches
Sentry authentication issues:
- Verify your auth token has the correct permissions
- Check that your org/project slugs in
.env
match your Sentry setup - Run
sentry-cli login
again if needed
EmpowerPlant/
├── AppDelegate.swift # Sentry configuration
├── Views/ # UI Controllers
├── Models/ # Core Data models
├── Helpers/ # Utility classes
└── Resources/ # Assets and data files
- Ensure
Info.plist
has the correct version number - Commit changes to the
master
branch (recommended)
-
Go to GitHub Actions:
- Navigate to the repo's Actions page
- Find the Release workflow
-
Trigger the release:
- Click "Run workflow" dropdown
- Enter the version number (e.g.,
0.0.43
) - Click "Run workflow" to start the build
-
What happens:
- Builds the iOS app with the specified version
- Uploads debug symbols to Sentry
- Creates a GitHub release with the app binary
- Uses configured secrets for authentication
Note: TDA (Test Data Automation) must be restarted to pick up new versions.
See sample release for reference.
The command that runs this in TDA can be found here: https://github.com/sentry-demos/empower/blob/a77428aec6cb8e6563caf3d9671419461946db2e/tda/conftest.py#L480-L514