xref: /expo/docs/pages/deploy/instant-updates.mdx (revision d7273661)
1---
2title: Instant updates
3description: Learn how to set up EAS Update to push critical bug fixes and improvements.
4---
5
6import { Terminal } from '~/ui/components/Snippet';
7import { BoxLink } from '~/ui/components/BoxLink';
8import { LayersTwo02Icon } from '@expo/styleguide-icons';
9
10**EAS Update** allows making small bug fixes and pushing quick improvements in a snap. It is a hosted service that uses the [`expo-updates`](/versions/latest/sdk/updates/) library to serve updates. It allows an end user's app to swap out the non-native parts of their app (for example, JS, styling, and image changes) with a new update that contains bug fixes and other updates. In this guide, you will learn how to set up EAS Update for your app.
11
12## Install `expo-updates`
13
14Start by installing the `expo-updates` library in your project. Run the following command:
15
16<Terminal cmd={['$ npx expo install expo-updates']} />
17
18## Configure the project with `eas update`
19
20You need to configure your project to use EAS Update. Run the following commands in the order they are specified:
21
22<Terminal
23  cmd={[
24    '# Initialize your project with EAS Update',
25    '$ eas update:configure',
26    '',
27    '# Set up the configuration file for builds',
28    '$ eas build:configure',
29  ]}
30  cmdCopy="expo install expo-updates && eas update:configure && eas build:configure"
31/>
32
33After running these commands, the **eas.json** file be modified in the root directory of your project. Inside it, you'll find that a `channel` property is added to the `development`, `preview` and `production` build profiles.
34
35{/* prettier-ignore */}
36```json eas.json
37{
38  "build": {
39    "development": {
40      "channel": "development"
41      /* @hide ... */ /* @end */
42    },
43    "preview": {
44      "channel": "preview"
45      /* @hide ... */ /* @end */
46    },
47    "production": {
48      "channel": "production"
49      /* @hide ... */ /* @end */
50    }
51  }
52}
53```
54
55The `channel` allows you to point updates at builds of that profile. For example, if you set up a GitHub Action to publish changes on merge, it will merge code into the `"production"` Git branch. Then, each commit will trigger a GitHub Action that will publish an update which will be available to build with the channel `"production"`.
56
57## Create a build for the project
58
59You need to [create a build](/develop/development-builds/create-a-build/#create-a-development-build-for-emulatorsimulator) for Android or iOS. We recommend creating a build with the `preview` build profile first. This will allow you to test your update before publishing it to the `production` channel.
60
61Once you have a build running on your device or a simulator, you are ready to iterate on the project. Make any desired changes to your project's JavaScript, styling, or image assets.
62
63## Publish an update
64
65To publish an update to the build, run the following command:
66
67<Terminal
68  cmd={[
69    '$ eas update --branch [branch] --message [message]',
70    '',
71    '# Example',
72    '$ eas update --branch preview --message "Updating the app"',
73  ]}
74  cmdCopy={null}
75/>
76
77Once the update is built and uploaded to EAS and the command completes, force close and reopen your app up to two times to download and view the update.
78
79## Next step
80
81<BoxLink
82  title="How EAS Update works"
83  description="A conceptual overview of how EAS Update works."
84  Icon={LayersTwo02Icon}
85  href="/eas-update/how-it-works/"
86/>
87