Core Feature Comparison and Collaboration
After this chapter you will be able to sit next to a colleague who only knows Xcode and explain, feature by feature, what changes when a project moves to Expo. You will know which parts of your daily loop get faster, which get slower, how to reach native code when you need it, and how the two toolchains cooperate on the same project.
Xcode is Apple’s integrated development environment. It compiles your source code, packages it into an application bundle, signs it, and installs it on a device. Everything about the app’s relationship to iOS is expressed inside Xcode.
Expo is a React Native development environment. It bundles your JavaScript and assets into a native application, wires in a set of native modules, and adds a development server, a cloud build service and an over-the-air update channel.
Neither one replaces the other. Xcode still compiles the native code inside an Expo app; Expo just decides how that code is generated, configured and shipped.
The loop you repeat all day is where the two feel most different.
Xcode:
- Edit a Swift or SwiftUI file.
- Press Run.
- Wait for the compiler and the linker.
- The app launches on the simulator or the device.
- Set a breakpoint, relaunch, and repeat.
Expo:
- Edit a JavaScript or TypeScript file.
- Save.
- The bundler sends the new module to the running app.
- Fast Refresh applies the change in place, usually keeping the current screen state.
- Reload only when you change native code or the app configuration.
The practical difference is not that Expo is “instant” - the first bundle of a large app still takes time to download and parse. The difference is the iteration cost of a change. Changing a colour in Xcode means another compile and relaunch; in Expo it means a file save.
That advantage disappears the moment you touch native code. Adding a native module means the app must be rebuilt, and with Expo the rebuild is either local (npx expo run:ios) or in the cloud (eas build).
| Concern | Xcode and native iOS | Expo and React Native |
|---|---|---|
| Interface language | Swift, Objective-C, SwiftUI | JavaScript or TypeScript with React Native components |
| Build | Xcode compiles and links | The Metro bundler produces JavaScript; the native shell is prebuilt or generated |
| Run on device | Xcode installs and launches | npx expo start serves the bundle; npx expo run:ios builds and installs a development build |
| Iteration | Recompile and relaunch | Fast Refresh, usually without losing screen state |
| Dependencies | CocoaPods, Carthage, Swift Package Manager | npm packages, with native ones configured by config plugins |
| Networking and data | Native frameworks such as URLSession and Core Data | fetch, plus modules such as expo-sqlite and expo-secure-store |
| Permissions | Info.plist usage strings, requested at runtime | The same usage strings, configured in app.json, requested through the module’s permission API |
| Background work | BGTaskScheduler, background modes | Expo background task and background fetch modules, or a custom native module |
| Push notifications | APNs directly | expo-notifications, which wraps APNs and FCM |
| In-app purchases | StoreKit 2 | expo-in-app-purchases or a custom native module |
| Release | Archive, validate, upload in Xcode | eas build then eas submit |
| Hot fixes | Not possible | eas update pushes JavaScript changes to installed apps |
| Access to native code | Total | Total, through the Expo Modules API |
Native iOS uses a dependency manager that resolves binary and source targets, and the resolution ends in a workspace file that Xcode opens.
# Podfile
platform :ios, '15.1'
target 'FieldNotes' do
use_frameworks!
pod 'Alamofire', '~> 5.9'
end
Expo uses npm, and the native side of a package is activated by a config plugin. The plugin is a small JavaScript function that edits the generated Xcode project and Info.plist during prebuild.
// app.config.js
import { Camera } from 'expo-camera';
export default {
expo: {
plugins: [
[
Camera,
{
cameraPermission: 'Allow Field Notes to take photos of equipment.',
},
],
],
},
};
The difference in practice: npm resolution is fast and familiar, but the native side of the change is invisible until you run prebuild and rebuild. CocoaPods makes the native change visible in the project file, but resolution is slower.
The question every native developer asks is “can I still write Swift?” The answer is yes, and the mechanism is the Expo Modules API.
A native module written in Swift looks like this:
import ExpoModulesCore
public class BatteryModule: Module {
public func definition() -> ModuleDefinition {
Name("Battery")
Function("getLevel") { () -> Double in
UIDevice.current.isBatteryMonitoringEnabled = true
let level = UIDevice.current.batteryLevel
return level < 0 ? 1.0 : Double(level)
}
}
}
It is reached from JavaScript through the module registry:
import { requireNativeModule } from 'expo-modules-core';
const Battery = requireNativeModule('Battery');
const level = await Battery.getLevel();
The same pattern works for native views, where a SwiftUI or UIKit view is exposed as a React Native component. This is what makes a hybrid project practical: the interface is React Native, and the difficult parts stay in the language where they belong.
Xcode’s debugger attaches to the process, gives you a full symbol table and lets you step through Swift line by line. That capability is unchanged inside an Expo app, because the app is still a native binary.
The JavaScript side has its own tooling. Flip the developer menu with d in the Metro terminal, or press j in the simulator, and you get an inspector that behaves like Chrome DevTools: a console, a network tab, and the React DevTools panel with the component tree and its props.
| Problem | Where you look |
|---|---|
| JavaScript error | Metro console and the in-app developer menu |
| Layout and styling | React DevTools, and the layout inspector |
| Native crash or Swift bug | Xcode debugger, attached to the running app |
| Network traffic | The inspector’s network tab, or a proxy such as Charles |
| State that is wrong | React DevTools’ component tree |
The practical outcome is that you need both tools, which is the same situation as any hybrid native application.
prebuild is the command that makes the two worlds meet. It generates a complete native Xcode project from your configuration.
# Generate the ios/ and android/ directories from app.json.
npx expo prebuild
# Delete the generated directories and build them again from scratch.
npx expo prebuild --clean
After prebuild, the project contains an ordinary ios/ directory with an .xcodeproj that Xcode opens without complaint. You can open it, set a scheme, add a target, or attach the debugger.
The workflow that follows from this is the one most teams settle on:
- Keep the configuration file as the source of truth for everything cross-platform.
- Run
prebuildwhenever the configuration changes. - Open the generated
ios/directory in Xcode for native debugging and native-only work. - Commit the generated project if your team wants native changes to survive a regeneration, and remember that
prebuild --cleanwill discard manual edits to it.
A realistic day for a team using Expo on an iOS-first product:
- Feature work happens in JavaScript, with Fast Refresh, in the simulator.
- A third-party library needs a native tweak. The team writes a config plugin or a local Expo Module in Swift, runs
prebuild, and builds a development client withnpx expo run:ios. - The QA build for the week is produced in the cloud with
eas build --platform ios --profile preview, so nobody needs a Mac to cut a build. - A critical bug in the JavaScript layer ships as an over-the-air update with
eas update, and the native binary is untouched. - A release candidate goes to TestFlight with
eas build --platform ios --profile productionfollowed byeas submit --platform ios.
Xcode is still in the loop for the native steps. Expo just stopped it from being the tool you use for everything.
- You are writing a native module, or a view that React Native cannot express.
- You need to profile with Instruments, or to debug a native crash with the full symbol table.
- You need to add an app extension, a widget, or an App Clip target to the generated project.
- You need a capability that only the Xcode project can configure, such as a specific entitlement or a background mode.
A team has an Expo app with a React Native interface and a native Swift module that reads a barcode scanner connected over Bluetooth. The module works in debug builds but the app crashes in TestFlight builds. The team has never shipped an Expo app before.
List the steps that would find the cause, and say which tool you would use for each.
Approach:
Split the problem into the JavaScript layer and the native layer, because the two have different diagnostics. A crash that appears only in TestFlight builds is, by definition, a difference between the debug build and the release build - so the investigation is about enumerating those differences rather than about the code itself.
Steps:
- Read the crash report. TestFlight builds that crash report to App Store Connect under the build’s activity, and the symbolicated stack trace is attached. The first question is whether the top frames are JavaScript or native. If the stack is native, the problem is in the Swift module; if it is JavaScript, the bundling differs.
- Reproduce a release build locally. Run
eas build --platform ios --profile production --localto produce a release binary on the developer’s machine, then install it withnpx expo install. A crash that reproduces locally can be debugged with the Xcode debugger and Instruments, which a TestFlight build on a colleague’s device cannot. - Compare the two builds. The usual differences are: the production build is minified and hermetic, so a stack trace is mangled and the bundle is different; the production build has different native flags; and the TestFlight build may use a different native module version if the dependency was not pinned.
eas build --profile productionuses the same dependencies, so an unpinned package that resolves differently is a real possibility. - Check the native module’s own configuration. A Bluetooth scanner usually needs a usage description and, on iOS, a
UIBackgroundModesentry for certain connection types. Config plugins add these duringprebuild, and a manual edit to the generated Xcode project is lost the next time someone regenerates it. The fix belongs in the config plugin. - Check the release-only code paths. Debug builds frequently enable verbose logging and extra permission prompts. A
console.logthat assumes a permission was granted, or an__DEV__-only guard around an initialisation step, is a classic cause of a release-only crash. - Attach the debugger. With the locally built release binary installed, open the generated
ios/directory in Xcode, attach to the process, and get the native stack trace. This is the step the team cannot do with the TestFlight build alone, which is why step 2 comes first.
Answer:
| Step | Tool | What it gives you |
|---|---|---|
| Read the symbolicated crash report | App Store Connect | Tells you whether the failure is in Swift or in JavaScript |
| Build the production profile locally | eas build --profile production --local, then npx expo install | A reproducible release build on a device you control |
| Attach and step through the crash | Xcode debugger | The native stack trace and the ability to inspect memory |
| Inspect native configuration | The generated ios/ project and your config plugin | Missing usage descriptions or background modes |
| Profile if the crash is a hang or a leak | Instruments | Where the time or the memory is going |
The most likely outcome is that a manual change to the generated Xcode project was lost during a prebuild, or that a debug-only code path masked an initialisation error. Both are found by comparing a locally built production binary with the TestFlight build, which is why reproducing a release build locally is the step that unblocks everything else.
