Skip to main content
Glama
local-builds.md3.98 kB
--- title: Run EAS Build locally with local flag sidebar_title: Run EAS Build locally description: Learn how to use EAS Build locally on your machine or a custom infrastructure using the --local flag. --- You can run the same build process that is typically run on the EAS Build servers directly on your machine by using the `eas build --local` flag. This is a useful way to debug build failures that are happening on your cloud builds, which you may not be able to reproduce without running the same set of steps. ## Prerequisites You need to be authenticated with Expo: - Run `eas login` - Alternatively, set `EXPO_TOKEN` [using token-based authentication](/accounts/programmatic-access) ## Use cases for local builds - [Debugging](#use-local-builds-for-debugging) build failures on EAS servers. - Company policies that restrict the use of third-party CI/CD services. With local builds, the entire process runs on your infrastructure and the only communication with EAS servers is: - to make sure project `@account/slug` exists - if you are using managed credentials to download them ## Use local builds for debugging If you encounter build failures on EAS servers and you're unable to determine the cause from inspecting the logs, you may find it helpful to debug the issue locally. To simplify that process we support several environment variables to configure the local build process. - `EAS_LOCAL_BUILD_SKIP_CLEANUP=1` - Set this to disable cleaning up the working directory after the build process is finished. - `EAS_LOCAL_BUILD_WORKINGDIR` - Specify the working directory for the build process, by default it's somewhere (it's platform dependent) in **/tmp** directory. - `EAS_LOCAL_BUILD_ARTIFACTS_DIR` - The directory where artifacts are copied after a successful build. By default, these files are copied to the current directory, which may be undesirable if you are running many consecutive builds. If you use `EAS_LOCAL_BUILD_SKIP_CLEANUP` and `EAS_LOCAL_BUILD_WORKINGDIR` for iOS builds you should be able to inspect the contents of the `logs` subdirectory of the working directory to read your Xcode logs. ## Limitations Some of the options available for cloud builds are not available locally. Limitations you should be aware of: - You can only build for a specific platform (option `all` is disabled). - Customizing versions of software is not supported, fields `node`, `yarn`, `fastlane`, `cocoapods`, `ndk`, `image` in **eas.json** are ignored. - Caching is not supported. - EAS environment variables with ["Secret" visibility](/eas/environment-variables/#visibility-settings-for-environment-variables) are not supported (set them in your local environment instead). - You are responsible for making sure that the environment has all the necessary tools installed: - Node.js/Yarn/npm - fastlane (iOS only) - CocoaPods (iOS only) - Android SDK and NDK - On Windows, you can use [WSL](https://docs.microsoft.com/en-us/windows/wsl/install) for local EAS Builds. However, we do not officially test against this platform and do not support Windows for local builds (macOS and Linux are supported). ## App compilation for development and production builds locally To compile your app locally for development with Expo CLI, use `npx expo run:android` or `npx expo run:ios` commands instead. If you use [Continuous Native Generation](/workflow/continuous-native-generation), you can also run [prebuild](/workflow/prebuild) to generate your **android** and **ios** directories and then proceed to open the projects in the respective IDEs and build them like any native project. For more details, see: To create a production build locally, you need Android Studio and Xcode installed on your computer. See the following guide for more information: With any of the above approaches, you'll be following procedures which are different from creating a build on the cloud with EAS Build — that is what the `eas build --local` flag is for.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jaksm/expo-docs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server