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.

Two tools, one sentence each

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 development loop, side by side

The loop you repeat all day is where the two feel most different.

Xcode:

  1. Edit a Swift or SwiftUI file.
  2. Press Run.
  3. Wait for the compiler and the linker.
  4. The app launches on the simulator or the device.
  5. Set a breakpoint, relaunch, and repeat.

Expo:

  1. Edit a JavaScript or TypeScript file.
  2. Save.
  3. The bundler sends the new module to the running app.
  4. Fast Refresh applies the change in place, usually keeping the current screen state.
  5. 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).

Feature-by-feature comparison

ConcernXcode and native iOSExpo and React Native
Interface languageSwift, Objective-C, SwiftUIJavaScript or TypeScript with React Native components
BuildXcode compiles and linksThe Metro bundler produces JavaScript; the native shell is prebuilt or generated
Run on deviceXcode installs and launchesnpx expo start serves the bundle; npx expo run:ios builds and installs a development build
IterationRecompile and relaunchFast Refresh, usually without losing screen state
DependenciesCocoaPods, Carthage, Swift Package Managernpm packages, with native ones configured by config plugins
Networking and dataNative frameworks such as URLSession and Core Datafetch, plus modules such as expo-sqlite and expo-secure-store
PermissionsInfo.plist usage strings, requested at runtimeThe same usage strings, configured in app.json, requested through the module’s permission API
Background workBGTaskScheduler, background modesExpo background task and background fetch modules, or a custom native module
Push notificationsAPNs directlyexpo-notifications, which wraps APNs and FCM
In-app purchasesStoreKit 2expo-in-app-purchases or a custom native module
ReleaseArchive, validate, upload in Xcodeeas build then eas submit
Hot fixesNot possibleeas update pushes JavaScript changes to installed apps
Access to native codeTotalTotal, through the Expo Modules API

Dependencies compared

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 native escape hatch

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.

Debugging compared

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.

ProblemWhere you look
JavaScript errorMetro console and the in-app developer menu
Layout and stylingReact DevTools, and the layout inspector
Native crash or Swift bugXcode debugger, attached to the running app
Network trafficThe inspector’s network tab, or a proxy such as Charles
State that is wrongReact DevTools’ component tree

The practical outcome is that you need both tools, which is the same situation as any hybrid native application.

The bridge between the two: expo prebuild

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:

  1. Keep the configuration file as the source of truth for everything cross-platform.
  2. Run prebuild whenever the configuration changes.
  3. Open the generated ios/ directory in Xcode for native debugging and native-only work.
  4. Commit the generated project if your team wants native changes to survive a regeneration, and remember that prebuild --clean will discard manual edits to it.

How they work together in practice

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 with npx 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 production followed by eas 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.

When to step back into Xcode

  • 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.

Practice

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.

ExpoXcodeDebuggingTestFlightWorkflow

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:

  1. 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.
  2. Reproduce a release build locally. Run eas build --platform ios --profile production --local to produce a release binary on the developer’s machine, then install it with npx 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.
  3. 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 production uses the same dependencies, so an unpinned package that resolves differently is a real possibility.
  4. Check the native module’s own configuration. A Bluetooth scanner usually needs a usage description and, on iOS, a UIBackgroundModes entry for certain connection types. Config plugins add these during prebuild, and a manual edit to the generated Xcode project is lost the next time someone regenerates it. The fix belongs in the config plugin.
  5. Check the release-only code paths. Debug builds frequently enable verbose logging and extra permission prompts. A console.log that assumes a permission was granted, or an __DEV__-only guard around an initialisation step, is a classic cause of a release-only crash.
  6. 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:

StepToolWhat it gives you
Read the symbolicated crash reportApp Store ConnectTells you whether the failure is in Swift or in JavaScript
Build the production profile locallyeas build --profile production --local, then npx expo installA reproducible release build on a device you control
Attach and step through the crashXcode debuggerThe native stack trace and the ability to inspect memory
Inspect native configurationThe generated ios/ project and your config pluginMissing usage descriptions or background modes
Profile if the crash is a hang or a leakInstrumentsWhere 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.

Found an issue with this content?

Tell us what could be improved.