This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Build lifecycle hooks
Edit page
Learn how to use the EAS Build lifecycle hooks with npm to customize your build process.
EAS Build lifecycle npm hooks allows you to customize your build process by running scripts before or after the build process.
For better understanding, see the Android build process and the iOS build process.
The lifecycle hooks are not executed by the build process in custom builds. They need to be manually extracted and called by the build steps during the process.
EAS Build lifecycle hooks
There are six EAS Build lifecycle npm hooks available. To use, them, you can set them in your package.json.
An example of how a package.json can look when using one or more lifecycle hooks:
Platform-specific hook behavior
To run a script (or some part of a script) only for Android or iOS builds, you can fork the behavior depending on the platform within the script. See the following common examples to do this through a shell script or a Node script.
Examples
package.json and shell script
Example: Pre-install script that installs git-lfs on macOS workers
The following script installs git-lfs if it is not yet installed. This is useful in some cases where git-lfs is required to install certain CocoaPods.