Course contentsShow
← React Native
Lesson 119 of 1,5552. Project Scaffolding with ExpoFree lesson

Refactoring Managed Apps to Bare Workflows

Execute a controlled migration from a managed Expo project to a custom native implementation.

In this lesson, you will learn how to transition your project from the managed Expo workflow to a "bare" workflow, granting you full control over your native Android and iOS source code.

Why Move to Bare?

Up until now, you have relied on Expo’s abstraction layer to handle native configurations. This is efficient for 99% of development, but sometimes you need to touch the native AppDelegate (iOS) or MainActivity (Android) to integrate a specific SDK or perform custom native compilation. Moving to the bare workflow means you are essentially "ejecting" from the managed layer to manage the ios/ and android/ folders yourself.

The Migration Strategy: npx expo run

In the modern Expo ecosystem, we don't think of this as a permanent "ejection" anymore. Instead, we use the prebuild process to generate the native directories. To transition your workflow, you execute the following command:

npx expo prebuild

This command inspects your app.json and package.json and generates the ios and android folders inside your project root. Once these folders exist, you are technically in a bare workflow. From this point forward, you are responsible for maintaining those folders, keeping them in sync with your native dependencies, and managing their build configurations.

The Core Shift

When you move to a bare workflow, the project structure changes:

  1. Code Access: You now have direct access to ios/YourProjectName/ and android/app/src/main/. You can open these in Xcode or Android Studio.
  2. Native Dependencies: You must now link native libraries manually or rely on the Expo CLI to update the native projects whenever you run npx expo install.
  3. Build Responsibility: You lose the ability to rely solely on "Expo Go" to run your app. You must now compile the native code locally using:
    • npx expo run:ios
    • npx expo run:android

This transition is a major step. It gives you total ownership of your native binary, but it also increases your maintenance burden, as you must now handle native versioning and platform-specific debugging directly in the IDEs.

Key Takeaway: Moving to a bare workflow via npx expo prebuild unlocks full native customization by generating project directories that you must now maintain and compile independently of the Expo Go app.