Skip to main content

devhub sync

Downloads each finished EAS dev client build of the project in the current folder that the store does not have.

devhub sync [options]
OptionWhat it does
--allSync each project folder that devhub sync saw before.
--profile <name>Also sync this build profile. Give it again for each other profile.
--dry-runShow what the sync downloads. Download nothing.
--jsonPrint the result as JSON. See JSON output.
-h, --helpShow the help.

Example​

devhub sync
/Users/me/projects/my-app
Profiles: development (android, ios), development-simulator (android, ios)
Downloaded b8d0f2a4 android development 1.5.0 214.8 MB
1 downloaded (214.8 MB), 1 already stored, 1 build expired before sync.

The progress lines, for example Downloading the build …, go to stderr.

Which builds DevHub keeps​

DevHub reads eas.json and syncs each build profile with "developmentClient": true. It reads the file the same as eas-cli:

  • It follows extends, so a profile can get developmentClient from another profile.
  • It reads the android and ios blocks. A profile that is a dev client only on iOS gives only its iOS builds.
  • It accepts comments and trailing commas in eas.json.

--profile <name> adds a profile that is not a dev client profile, for both platforms. When eas.json has no dev client profile and you give no --profile, the sync of the project fails, and tells you how to fix it.

DevHub looks for eas.json in the current folder, and then in each parent folder. So you can run the sync from a folder inside the project.

DevHub keeps each type of build file:

FileBuild
.apkAndroid
.aabAndroid App Bundle. DevHub keeps it, but cannot install it.
.tar.gziOS simulator build
.ipaiOS device build. DevHub keeps it, but cannot install it.

An .ipa cannot install after its provisioning profile expires, but it stays in your build history.

note

A dev client is a debug build. Its JavaScript runs in development mode, so it does not show the real speed of your app in production.

The result of each build​

The text output lists only the builds that changed or failed. Stored and expired builds show as a count, because they repeat on each daily sync. --json lists each build.

StatusMeaning
DownloadedDevHub downloaded the build, and stored it.
Would downloadA dry run. DevHub downloads this build on the next sync.
StoredThe store already has the build.
ExpiredEAS deleted the build before the first sync. DevHub cannot get it back.
No fileEAS has no file for the build.
Invalid IDThe build ID from EAS is not a valid folder name. DevHub skipped it.
FailedThe download failed. The next sync tries again.

A daily sync prevents an expired build: it downloads each new build before EAS deletes it.

How DevHub runs eas-cli​

DevHub runs eas whoami first, to find eas-cli and to check the login:

  1. DevHub runs eas when it is on your PATH.
  2. When eas is not on your PATH, DevHub runs npx --yes eas-cli. npx uses the eas-cli of the project when the project has one.
  3. When eas-cli has no login, DevHub stops, and gives the command to run.

Then DevHub runs eas build:list --json --non-interactive --status finished for each profile. It downloads each file from the URL in the EAS record. DevHub never reads, asks for, or stores a token.

Sync all your projects​

Each sync that is not a dry run records the project folder in the store. Then devhub sync --all syncs each of these projects, from any folder:

devhub sync --all

Run it once a day, so you keep the builds of the projects that you do not work on now. See Sync every day.

  • A project folder that does not exist anymore gets a warning, and the sync skips it.
  • A project that fails does not stop the other projects.

One sync at a time​

Two syncs cannot run at the same time, because each sync removes the incomplete build folders. When a sync starts while another sync runs, it stops with a message that names the process of the first sync. When a sync stops before its end, for example after a crash, the next sync takes its place, and downloads the incomplete builds again. A dry run changes nothing, so it can run while another sync runs.

Exit codes​

CodeMeaning
0Each project synced.
1A project failed, eas-cli did not start, or another sync runs now.
2A usage error, for example an unknown option.