Prerequisites
Before installing Expo Apple Targets, ensure your development environment meets these requirements:Required versions
- CocoaPods 1.16.2 or higher (requires Ruby 3.2.0+)
- Xcode 16 or higher (requires macOS Sequoia 15+)
- Expo SDK 53 or higher
Check your versions
Verify your current versions:Upgrade CocoaPods
If you need to upgrade CocoaPods:Upgrade Expo SDK
To upgrade to Expo SDK 53+:Installation
Install the package
The easiest way to install Expo Apple Targets is using the Select a target type (we recommend starting with
create-target CLI, which automatically installs dependencies:widget) and the CLI will:- Install
@bacons/apple-targets - Add the Config Plugin to your
app.json - Generate a
/targetsdirectory with template files - Create an
expo-target.config.jsfile
You can also specify the target type directly:
npx create-target widgetManual installation (alternative)
If you prefer to install manually:Then add the plugin to your You’ll still need to create target directories and configuration files manually.
app.json:app.json
Configure bundle identifier and Team ID
In your
app.json, set your iOS bundle identifier and Apple Team ID:app.json
You can find your Apple Team ID in Xcode:
- Open any iOS project in Xcode
- Select your target
- Go to Signing & Capabilities
- Your Team ID appears next to your team name
Generate the iOS project
Run prebuild to generate your iOS project:This creates the
ios/ directory with your Xcode project and links any targets from /targets.Project structure
After installation, your project will have this structure:The
/targets directory is not git-ignored and should be committed to your repository. The ios/ directory is generated and should remain git-ignored.Target configuration
Each target requires anexpo-target.config.js or expo-target.config.json file:
targets/widget/expo-target.config.js
Dynamic configuration
You can also export a function to access the Expo config:targets/widget/expo-target.config.js
Special colors
Certain color names map to Xcode build settings:| Color Name | Build Setting | Purpose |
|---|---|---|
$accent | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME | Global accent color (button tints, etc.) |
$widgetBackground | ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME | Widget background color |
Advanced: CocoaPods customization
To customize CocoaPods settings for a target, add apods.rb file in the target directory:
targets/clip/pods.rb
Sharing files between targets
To share files between targets and the main app:- Target-specific shared files: Add a
_shared/directory inside a target (e.g.,targets/widget/_shared/) - Global shared files: Add a
targets/_shared/directory at the root level
_shared/ directories are automatically linked to both the target and the main app.
You must run
npx expo prebuild --clean whenever you add, rename, or remove files in _shared/ directories.Verify installation
To verify everything is set up correctly:Check target appears in Xcode
Open your project in Xcode (
xed ios) and verify:- Your target appears in the expo:targets folder
- The target appears in the scheme dropdown
Build the target
In Xcode:
- Select your target from the scheme dropdown
- Select a simulator
- Press ⌘R to build and run
Next steps
Quickstart
Build your first widget in minutes
Target configuration
Learn about all configuration options
Supported targets
View all 40+ supported target types
Troubleshooting
Common issues and solutions
Common issues
CocoaPods version too old
Error:[!] CocoaPods 1.16.2 or higher is required
Solution: Upgrade CocoaPods and Ruby:
Xcode version too old
Error: Build failures with Widget or SwiftUI code Solution: Upgrade to Xcode 16 or higher (requires macOS Sequoia). Download from the Mac App Store or Apple Developer.Target not appearing in Xcode
Solution:- Ensure you ran
npx expo prebuild -p ios --clean - Close and reopen Xcode
- Check that the target directory has an
expo-target.config.jsfile
Changes not persisting
Problem: Edits in Xcode are lost after running prebuild Solution: Only edit files inside theexpo:targets/ virtual folder. Changes elsewhere in the Xcode project will be overwritten.