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

Building for Specific Hardware Tiers

Customize build outputs based on device capability detection and legacy support requirements.

In this lesson, you will learn how to tailor your Expo application’s build configuration to support different performance tiers, ensuring your app runs smoothly on both flagship devices and legacy hardware.

Why Hardware Tiers Matter

Not every smartphone is built the same. While one user might have the latest high-end device with a massive GPU, another might be running your app on a budget-friendly phone from five years ago. If you push high-resolution textures or complex animations to the lower-tier device, it will likely lag or crash.

Customizing Builds with EAS

Since you are already using eas.json for your build pipelines, you can define specific build profiles that target different hardware capabilities. Instead of building one massive binary, you can split your output requirements.

For example, you can create a "legacy" profile that flags the build to exclude high-resource assets, or uses expo-device to conditionally load lower-resolution imagery at runtime:

{
  "build": {
    "production": { "channel": "main" },
    "legacy-support": {
      "env": {
        "APP_ASSET_QUALITY": "low",
        "ENABLE_GPU_ACCELERATION": "false"
      }
    }
  }
}

Strategy: Detection vs. Configuration

There are two ways to handle this:

  1. Build-time Configuration: Use the eas.json profiles above to set environment variables. During your build process, your code can read these variables (via process.env) to swap out asset bundles or toggle feature flags.
  2. Runtime Detection: Use the expo-device and expo-screen-orientation libraries to check the user's hardware capabilities once the app launches. If the device is detected as "low-tier" (based on Device.totalMemory), you can programmatically disable heavy features like background blur or high-frame-rate animations.

By combining EAS build profiles with runtime checks, you ensure that your app remains responsive on older devices while still offering a premium experience on modern hardware.

Key Takeaway: Use EAS build profiles to manage environment-specific configurations and combine them with runtime hardware detection to deliver optimized experiences tailored to your user's specific device capabilities.