create-expo-updates-server 0.1.6 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/template/.dockerignore +16 -0
- package/dist/template/Dockerfile +5 -0
- package/dist/template/README.md +51 -660
- package/dist/template/app/api/admin/device-targets/route.test.ts +43 -0
- package/dist/template/app/api/admin/device-targets/route.ts +91 -0
- package/dist/template/app/api/admin/devices/route.test.ts +41 -0
- package/dist/template/app/api/admin/devices/route.ts +15 -0
- package/dist/template/app/api/admin/updates/[encodedKey]/audience/route.ts +75 -0
- package/dist/template/app/api/device-heartbeat/route.ts +2 -0
- package/dist/template/app/globals.css +114 -15
- package/dist/template/app/layout.tsx +12 -4
- package/dist/template/app/login/page.tsx +22 -18
- package/dist/template/app/updates/[encodedKey]/page.tsx +112 -88
- package/dist/template/app/updates/devices/page.tsx +264 -0
- package/dist/template/app/updates/embedded/page.tsx +102 -68
- package/dist/template/app/updates/emergency-redirects/page.tsx +144 -111
- package/dist/template/app/updates/layout.tsx +6 -1
- package/dist/template/app/updates/page.tsx +262 -212
- package/dist/template/components/admin/admin-shell.tsx +196 -0
- package/dist/template/components/admin/language-switcher.tsx +25 -0
- package/dist/template/components/admin/theme-provider.tsx +15 -0
- package/dist/template/components/ui/alert.tsx +65 -0
- package/dist/template/components/ui/badge.tsx +47 -0
- package/dist/template/components/ui/button.tsx +63 -0
- package/dist/template/components/ui/card.tsx +91 -0
- package/dist/template/components/ui/chart.tsx +373 -0
- package/dist/template/components/ui/checkbox.tsx +31 -0
- package/dist/template/components/ui/dialog.tsx +158 -0
- package/dist/template/components/ui/dropdown-menu.tsx +256 -0
- package/dist/template/components/ui/input.tsx +20 -0
- package/dist/template/components/ui/label.tsx +23 -0
- package/dist/template/components/ui/native-select.tsx +61 -0
- package/dist/template/components/ui/popover.tsx +88 -0
- package/dist/template/components/ui/scroll-area.tsx +57 -0
- package/dist/template/components/ui/select.tsx +189 -0
- package/dist/template/components/ui/separator.tsx +27 -0
- package/dist/template/components/ui/sheet.tsx +142 -0
- package/dist/template/components/ui/sidebar.tsx +736 -0
- package/dist/template/components/ui/skeleton.tsx +13 -0
- package/dist/template/components/ui/switch.tsx +34 -0
- package/dist/template/components/ui/table.tsx +115 -0
- package/dist/template/components/ui/tabs.tsx +90 -0
- package/dist/template/components/ui/textarea.tsx +17 -0
- package/dist/template/components/ui/tooltip.tsx +56 -0
- package/dist/template/components.json +22 -0
- package/dist/template/docker/minio.Dockerfile +11 -0
- package/dist/template/docker-compose.yml +7 -9
- package/dist/template/docs/admin-ui.md +35 -0
- package/dist/template/docs/device-targeting.md +129 -0
- package/dist/template/docs/doctor.md +137 -0
- package/dist/template/docs/expo-app-setup.md +174 -47
- package/dist/template/docs/getting-started.md +109 -146
- package/dist/template/docs/getting-started.ru.md +110 -193
- package/dist/template/docs/index.md +14 -33
- package/dist/template/docs/installation-telemetry.md +233 -0
- package/dist/template/docs/migrations/2026-10-16-manifest-identity.sql +89 -0
- package/dist/template/docs/migrations/2026-10-19-device-heartbeat.sql +131 -0
- package/dist/template/docs/migrations/2026-10-22-device-analytics.sql +264 -0
- package/dist/template/docs/migrations/2026-10-22-device-targeting-activation.sql +108 -0
- package/dist/template/docs/migrations/2026-10-22-device-targeting.sql +130 -0
- package/dist/template/docs/migrations/2026-10-22-device-version-metadata.sql +154 -0
- package/dist/template/docs/migrations/schema.sql +868 -6
- package/dist/template/docs/npm-installer.md +15 -30
- package/dist/template/docs/operations-guide.md +87 -0
- package/dist/template/docs/ota-client-lifecycle.md +263 -0
- package/dist/template/docs/ota-update-policy.md +36 -2
- package/dist/template/docs/supabase-setup.md +4 -0
- package/dist/template/hooks/use-mobile.ts +21 -0
- package/dist/template/lib/utils.ts +6 -0
- package/dist/template/package-lock.json +2325 -101
- package/dist/template/package.json +13 -3
- package/dist/template/scripts/configure-expo-app.mjs +11 -15
- package/dist/template/scripts/doctor.mjs +51 -0
- package/dist/template/scripts/ensure-storage-bucket.mjs +25 -0
- package/dist/template/scripts/ensure-test-bucket.mjs +21 -0
- package/dist/template/scripts/lib/device-identity.test.ts +29 -0
- package/dist/template/scripts/lib/doctor-probes.mjs +139 -0
- package/dist/template/scripts/lib/doctor.mjs +208 -0
- package/dist/template/scripts/lib/doctor.test.mjs +262 -0
- package/dist/template/scripts/lib/expo-app-configurator.mjs +14 -9
- package/dist/template/scripts/lib/expo-app-configurator.test.ts +3 -2
- package/dist/template/scripts/lib/ota-client-configurator.mjs +69 -0
- package/dist/template/scripts/lib/ota-client-configurator.test.ts +88 -0
- package/dist/template/scripts/lib/ota-client.test.ts +55 -0
- package/dist/template/scripts/lib/ota-root-hook-patcher.mjs +173 -0
- package/dist/template/scripts/lib/ota-root-hook-patcher.test.ts +123 -0
- package/dist/template/scripts/lib/ota-update-controller.test.ts +231 -0
- package/dist/template/scripts/tests/device-analytics-migrations.mjs +80 -0
- package/dist/template/scripts/tests/device-analytics.mjs +126 -0
- package/dist/template/scripts/tests/device-heartbeat.mjs +86 -0
- package/dist/template/scripts/tests/device-targeting-activation.mjs +111 -0
- package/dist/template/scripts/tests/device-targeting.mjs +39 -0
- package/dist/template/scripts/tests/device-version-metadata.mjs +31 -0
- package/dist/template/scripts/tests/manifest-identity-concurrency.mjs +106 -0
- package/dist/template/scripts/tests/manifest-identity.sql +204 -0
- package/dist/template/src/client/admin-types.ts +1 -0
- package/dist/template/src/client/devices/analytics.tsx +429 -0
- package/dist/template/src/client/devices/device-name.tsx +82 -0
- package/dist/template/src/client/devices/registry.tsx +399 -0
- package/dist/template/src/client/devices/use-devices-report.ts +108 -0
- package/dist/template/src/client/devices/version-adoption-chart.tsx +269 -0
- package/dist/template/src/client/devices/version-groups.test.ts +57 -0
- package/dist/template/src/client/devices/version-groups.ts +101 -0
- package/dist/template/src/client/distribution-control.tsx +135 -81
- package/dist/template/src/client/guard-action-combobox.tsx +13 -24
- package/dist/template/src/client/i18n/en.json +286 -0
- package/dist/template/src/client/i18n/messages.test.ts +42 -0
- package/dist/template/src/client/i18n/messages.ts +31 -0
- package/dist/template/src/client/i18n/provider.tsx +55 -0
- package/dist/template/src/client/i18n/use-formatters.ts +38 -0
- package/dist/template/src/client/logout-button.tsx +3 -1
- package/dist/template/src/client/update-audience-editor.tsx +285 -0
- package/dist/template/src/client/update-policy-editor.tsx +53 -41
- package/dist/template/src/server/controllers/manifest.test.ts +250 -7
- package/dist/template/src/server/controllers/manifest.ts +39 -31
- package/dist/template/src/server/devices/audience.test.ts +48 -0
- package/dist/template/src/server/devices/audience.ts +86 -0
- package/dist/template/src/server/devices/heartbeat.test.ts +39 -0
- package/dist/template/src/server/devices/heartbeat.ts +75 -0
- package/dist/template/src/server/devices/report-types.ts +114 -0
- package/dist/template/src/server/devices/report.test.ts +29 -0
- package/dist/template/src/server/devices/report.ts +27 -0
- package/dist/template/src/server/lib/admin-audience-activation.test.ts +94 -0
- package/dist/template/src/server/lib/admin-updates.ts +32 -168
- package/dist/template/src/server/lib/supabase.js +10 -10
- package/dist/template/src/server/lib/supabase.test.ts +11 -0
- package/dist/template/src/server/manifest/manifest-identity.test.ts +30 -0
- package/dist/template/src/server/manifest/manifest-identity.ts +24 -0
- package/dist/template/src/server/manifest/manifest-repository.ts +31 -102
- package/dist/template/src/server/manifest/manifest-response.ts +1 -1
- package/dist/template/templates/expo-app/ota-client/README.md +59 -0
- package/dist/template/templates/expo-app/ota-client/controller.js +60 -0
- package/dist/template/templates/expo-app/ota-client/device-identity.js +26 -0
- package/dist/template/templates/expo-app/ota-client/docs/update-lifecycle.md +52 -0
- package/dist/template/templates/expo-app/ota-client/index.d.ts +47 -0
- package/dist/template/templates/expo-app/ota-client/index.js +3 -0
- package/dist/template/templates/expo-app/ota-client/model/hooks/useOtaUpdates.js +48 -0
- package/dist/template/templates/expo-app/ota-client/model/update-controller.js +182 -0
- package/dist/template/templates/expo-app/ota-client/runtime.js +112 -0
- package/dist/template/templates/expo-app/ota-client/ui/ota-update-gate.js +56 -0
- package/dist/template-manifest.json +592 -77
- package/lib/cli.mjs +4 -6
- package/package.json +1 -1
|
@@ -4,6 +4,23 @@ This guide takes you from an empty machine to a working OTA server and a
|
|
|
4
4
|
connected Expo application. Deep Docker, PostgreSQL or Supabase knowledge is
|
|
5
5
|
not required.
|
|
6
6
|
|
|
7
|
+
## Before you start
|
|
8
|
+
|
|
9
|
+
Use Node.js 24 and npm on the host (also for Docker-based setup), Docker Compose,
|
|
10
|
+
and OpenSSL. Building the app also needs the platform's native toolchain: Java/Android
|
|
11
|
+
SDK or macOS/Xcode. The server's Docker image does not provide the mobile toolchain.
|
|
12
|
+
|
|
13
|
+
Create the server files, or use an existing source checkout:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx create-expo-updates-server@latest my-server
|
|
17
|
+
cd my-server
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
NPX only creates files; Docker/Supabase determine where those files run.
|
|
21
|
+
Follow the Docker path below for a first test. Run server commands from this folder
|
|
22
|
+
until the guide explicitly switches to the application folder.
|
|
23
|
+
|
|
7
24
|
## What you will have
|
|
8
25
|
|
|
9
26
|
At the end you can:
|
|
@@ -58,7 +75,10 @@ POSTGRES_PASSWORD=choose-a-long-random-password
|
|
|
58
75
|
MINIO_ROOT_PASSWORD=choose-another-long-random-password
|
|
59
76
|
```
|
|
60
77
|
|
|
61
|
-
|
|
78
|
+
For this Docker setup, use separate random hexadecimal passwords, for example
|
|
79
|
+
values generated with `openssl rand -hex 32`. Compose embeds the database password
|
|
80
|
+
in a URL and the configurator copies storage values between env files; special
|
|
81
|
+
characters currently need additional handling. Do not publish `.env` to GitHub.
|
|
62
82
|
|
|
63
83
|
If port `3000` is busy:
|
|
64
84
|
|
|
@@ -105,7 +125,27 @@ docker compose up -d --build
|
|
|
105
125
|
docker compose ps
|
|
106
126
|
```
|
|
107
127
|
|
|
108
|
-
|
|
128
|
+
The first build compiles a pinned MinIO release from source and may take several
|
|
129
|
+
minutes. Go runs inside Docker; no host installation is needed. Subsequent starts
|
|
130
|
+
reuse the built image. Bucket creation is automatic; no `minio/mc` image is needed.
|
|
131
|
+
|
|
132
|
+
Wait until `postgres`, `minio` and `app` are `healthy`. `/api/health` currently
|
|
133
|
+
checks the database only. Verify that the app can also read a valid signing key:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
docker compose exec app node -e "require('node:crypto').createPrivateKey(require('node:fs').readFileSync('/run/secrets/ota/code-signing-private-key.pem')); console.log('Signing key OK')"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
On Linux bind mounts, a host-owned `chmod 600` key can be unreadable to the
|
|
140
|
+
container's UID/GID `1001`. If the check reports `EACCES`, grant that group read
|
|
141
|
+
access and rerun the check:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
sudo chgrp 1001 secrets/code-signing-private-key.pem
|
|
145
|
+
chmod 640 secrets/code-signing-private-key.pem
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The `secrets` directory must also allow traversal by the container user.
|
|
109
149
|
|
|
110
150
|
## Step 6. Database setup is automatic
|
|
111
151
|
|
|
@@ -254,6 +294,10 @@ role key is a backend secret. Never place it in the Expo application.
|
|
|
254
294
|
|
|
255
295
|
## Step 6. Configure the OTA server
|
|
256
296
|
|
|
297
|
+
Create a matching [signing key pair](#step-4-create-the-signing-key-pair) first.
|
|
298
|
+
Set the private-key path below to the actual server-readable file; retain the
|
|
299
|
+
public certificate for application configuration.
|
|
300
|
+
|
|
257
301
|
Create `.env.local`:
|
|
258
302
|
|
|
259
303
|
```env
|
|
@@ -291,186 +335,105 @@ Choose the `admin` role for the first user.
|
|
|
291
335
|
|
|
292
336
|
These steps are the same for Docker and Supabase.
|
|
293
337
|
|
|
294
|
-
##
|
|
338
|
+
## 1. Configure the application
|
|
295
339
|
|
|
296
|
-
|
|
297
|
-
server
|
|
340
|
+
Prerequisites: Node.js/npm on the host, a static `app.json` Expo project, the
|
|
341
|
+
public signing certificate, and the HTTPS server URL reachable from the phone.
|
|
342
|
+
Use the same URL for the server's `OTA_PUBLIC_BASE_URL`. The configurator runs
|
|
343
|
+
on the host even when the server runs in Docker.
|
|
298
344
|
|
|
299
|
-
|
|
300
|
-
npm run configure-app
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
The CLI asks for the application path, public certificate, server URL, channel,
|
|
304
|
-
runtime, platform and overwrite preference. It displays a summary and requires
|
|
305
|
-
confirmation before changing files or running `expo prebuild`.
|
|
306
|
-
|
|
307
|
-
For CI or advanced usage, pass the same values as flags:
|
|
345
|
+
From the **server directory**:
|
|
308
346
|
|
|
309
347
|
```bash
|
|
310
|
-
npm
|
|
311
|
-
|
|
312
|
-
--certificate /full/path/code-signing-certificate.pem \
|
|
313
|
-
--server-url https://updates.example.com \
|
|
314
|
-
--channel production \
|
|
315
|
-
--runtime-version 1.0.0
|
|
348
|
+
npm ci
|
|
349
|
+
npm run configure-app
|
|
316
350
|
```
|
|
317
351
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
3. configures URL, channel, runtime and code signing in `app.json`;
|
|
323
|
-
4. copies the public certificate;
|
|
324
|
-
5. installs a portable publish script;
|
|
325
|
-
6. creates `.env.ota.example`;
|
|
326
|
-
7. adds `npm run ota:publish`;
|
|
327
|
-
8. installs publisher dependencies;
|
|
328
|
-
9. installs Android, Xcode and Xcode Cloud embedded registration hooks;
|
|
329
|
-
10. runs `expo prebuild` to synchronize native projects.
|
|
330
|
-
|
|
331
|
-
Use `--platform ios` or `--platform android` to prebuild one platform. The
|
|
332
|
-
default is both platforms.
|
|
352
|
+
Select the app directory, certificate, public URL, channel, runtime and platform.
|
|
353
|
+
The CLI installs dependencies, configures native updates, generates the identity
|
|
354
|
+
and telemetry client, inserts the root hook/gate, installs publisher/registration
|
|
355
|
+
scripts and runs prebuild. Review its summary before applying changes.
|
|
333
356
|
|
|
334
|
-
|
|
335
|
-
|
|
357
|
+
For flags, supported root components and reruns, see
|
|
358
|
+
[automatic configuration](./expo-app-setup.md#automatic-configuration).
|
|
359
|
+
Dynamic `app.config.*` projects require [manual client integration](./ota-client-lifecycle.md#manual-integration);
|
|
360
|
+
the bundled publisher currently reads static `app.json` only.
|
|
336
361
|
|
|
337
|
-
|
|
338
|
-
`app.config.cjs` exists because dynamic Expo config overrides `app.json`.
|
|
362
|
+
## 2. Check publisher and build credentials
|
|
339
363
|
|
|
340
|
-
|
|
364
|
+
Switch to the **application directory**. For local Docker exposed through
|
|
365
|
+
localhost or `*.devtunnels.ms`, the configurator can create `.env.ota` from the
|
|
366
|
+
server's `.env`. Keep that generated file. If it does not exist, create it once:
|
|
341
367
|
|
|
342
368
|
```bash
|
|
343
369
|
cd /full/path/to/expo-application
|
|
344
|
-
cp .env.ota.example .env.ota
|
|
370
|
+
[ -f .env.ota ] || cp .env.ota.example .env.ota
|
|
345
371
|
```
|
|
346
372
|
|
|
347
|
-
Fill
|
|
373
|
+
Fill any missing database and storage credentials from your server setup. Keep
|
|
374
|
+
this file ignored by Git and out of application imports. The publisher needs
|
|
375
|
+
`OTA_DATABASE_URL` and S3 credentials; an admin access token does not replace them.
|
|
348
376
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
377
|
+
Embedded-build registration can use the same local `OTA_DATABASE_URL`. For
|
|
378
|
+
registration over HTTP, provide `OTA_SERVER_URL` and an `OTA_ACCESS_TOKEN` with
|
|
379
|
+
`updates:write`; create it with `docker compose exec app npm run create-access-token`
|
|
380
|
+
from the **server directory** for Docker, or `npm run create-access-token` for
|
|
381
|
+
a server running directly with npm. See [embedded registration](./expo-app-setup.md#_6-register-embedded-updates).
|
|
352
382
|
|
|
353
|
-
|
|
354
|
-
`.env.ota` automatically from the OTA server `.env`. Manual configuration is
|
|
355
|
-
only required for a remote server, Supabase or another storage provider.
|
|
356
|
-
Microsoft Dev Tunnel URLs (`*.devtunnels.ms`) are also recognized as local
|
|
357
|
-
Docker exposure: the public tunnel is used for `OTA_SERVER_URL`, while the
|
|
358
|
-
publisher connects directly to MinIO at `http://127.0.0.1:9000`.
|
|
383
|
+
## 3. Build and install a native release
|
|
359
384
|
|
|
360
|
-
|
|
361
|
-
review. The following sections describe the equivalent manual setup.
|
|
385
|
+
Before building, choose how the app will download and apply updates.
|
|
362
386
|
|
|
363
|
-
|
|
387
|
+
The generated root checks automatically, but defaults to manual download/restart.
|
|
388
|
+
Add the [manual controls example](./ota-client-lifecycle.md#_3-add-manual-update-controls)
|
|
389
|
+
to a test screen, or explicitly configure automation using the [hook options](./ota-client-lifecycle.md).
|
|
390
|
+
The generator does not add test buttons to your application's UI.
|
|
364
391
|
|
|
365
|
-
|
|
366
|
-
reliable rollback and emergency redirects. The configurator installs this flow
|
|
367
|
-
automatically.
|
|
368
|
-
|
|
369
|
-
For local Docker, build Android with:
|
|
392
|
+
From the **application directory**, with the Android toolchain installed:
|
|
370
393
|
|
|
371
394
|
```bash
|
|
372
395
|
npm run ota:build:android:apk
|
|
373
396
|
```
|
|
374
397
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
registers the embedded update.
|
|
378
|
-
Phase that invokes `scripts/ota-register-embedded/register-ios.sh`, so a
|
|
379
|
-
Release/Archive build in Xcode performs registration automatically.
|
|
380
|
-
The registrar uses an app version from the embedded manifest when available;
|
|
381
|
-
otherwise it falls back to the normalized `expo.version` in the project's
|
|
382
|
-
static `app.json`. A missing or invalid fallback remains `null` and does not
|
|
383
|
-
fail an otherwise valid registration.
|
|
398
|
+
Install `android/app/build/outputs/apk/release/app-release.apk` on the phone.
|
|
399
|
+
For iOS, build a signed Release/Archive in Xcode; the generated build phase
|
|
400
|
+
registers the embedded update. Registration must succeed before continuing.
|
|
384
401
|
|
|
385
|
-
|
|
386
|
-
|
|
402
|
+
URL, runtime, channel, certificate and added native modules require a new native
|
|
403
|
+
build. Expo Go and development mode do not test this lifecycle. Launch the release
|
|
404
|
+
and confirm it appears under `/updates/devices`; confirm its embedded update under
|
|
405
|
+
`/updates/embedded`.
|
|
387
406
|
|
|
388
|
-
|
|
389
|
-
docker compose exec app npm run create-access-token
|
|
390
|
-
```
|
|
407
|
+
## 4. Publish the first OTA
|
|
391
408
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
```env
|
|
396
|
-
OTA_SERVER_URL=https://updates.example.com
|
|
397
|
-
OTA_ACCESS_TOKEN=ota_...
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
The configurator also creates `ci_scripts/ci_post_xcodebuild.sh`, a thin Xcode
|
|
401
|
-
Cloud lifecycle adapter that invokes the same `register-ios.sh`. The token is
|
|
402
|
-
shown only once and must never be committed or included in the mobile binary.
|
|
403
|
-
Verify registered binaries at `/updates/embedded`.
|
|
404
|
-
|
|
405
|
-
## Step 1. Install Expo Updates
|
|
409
|
+
Make a visible JavaScript change **after building the binary**. Keep its compatible
|
|
410
|
+
runtime and channel; change `expo.version` if you want a distinct version label.
|
|
411
|
+
From the **application directory**:
|
|
406
412
|
|
|
407
413
|
```bash
|
|
408
|
-
|
|
414
|
+
npm run ota:publish -- --platform android --message "First OTA smoke test"
|
|
409
415
|
```
|
|
410
416
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
application. Never copy the private key into the mobile project.
|
|
415
|
-
|
|
416
|
-
## Step 3. Configure Expo
|
|
417
|
-
|
|
418
|
-
Use the `app.config.ts` example in
|
|
419
|
-
[`expo-app-setup.md`](https://github.com/tonichiga/expo-updates-server/blob/main/docs/expo-app-setup.md).
|
|
420
|
-
Set:
|
|
421
|
-
|
|
422
|
-
- `EXPO_OTA_SERVER_URL`;
|
|
423
|
-
- `EXPO_UPDATE_CHANNEL`;
|
|
424
|
-
- `EXPO_RUNTIME_VERSION`.
|
|
425
|
-
|
|
426
|
-
A physical device cannot reach the computer through `localhost`. Production
|
|
427
|
-
requires a public HTTPS URL. For local device testing, use the
|
|
428
|
-
[HTTPS Dev Tunnel setup](#recommended-use-an-https-tunnel-for-device-testing)
|
|
429
|
-
instead of a plain HTTP LAN address.
|
|
430
|
-
|
|
431
|
-
## Step 4. Build a new native binary
|
|
432
|
-
|
|
433
|
-
The OTA URL, channel, runtime and certificate are native settings. Build the
|
|
434
|
-
iOS or Android application again after changing them.
|
|
435
|
-
|
|
436
|
-
## Step 5. Publish an update
|
|
437
|
-
|
|
438
|
-
After automatic configuration, use:
|
|
439
|
-
|
|
440
|
-
```bash
|
|
441
|
-
npm run ota:publish -- --message "Describe the change"
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
The publisher exports JavaScript, uploads assets and inserts database records.
|
|
445
|
-
The new update remains inactive until you approve it.
|
|
446
|
-
|
|
447
|
-
## Step 6. Activate the update
|
|
448
|
-
|
|
449
|
-
1. Open `/updates` in the admin panel.
|
|
450
|
-
2. Find the new update.
|
|
451
|
-
3. Confirm its channel, runtime and platform.
|
|
452
|
-
4. Activate it manually.
|
|
417
|
+
Use `--platform ios` for iOS. The command exports and uploads the update as inactive.
|
|
418
|
+
In `/updates`, verify platform/runtime/channel, select the intended device audience,
|
|
419
|
+
then activate the update.
|
|
453
420
|
|
|
454
|
-
##
|
|
421
|
+
## 5. Download, restart and verify
|
|
455
422
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
[`checkForUpdateAsync`, `fetchUpdateAsync`, and `reloadAsync` flow](https://github.com/tonichiga/expo-updates-server/blob/main/docs/expo-app-setup.md#5-check-and-install-updates-in-the-application)
|
|
460
|
-
to a screen or startup flow in the application.
|
|
423
|
+
Check → download → restart. Confirm the visible change and the new running version
|
|
424
|
+
under `/updates/devices`. Download alone must not change the reported running version.
|
|
425
|
+
The Installation ID should stay unchanged across an OTA restart.
|
|
461
426
|
|
|
462
|
-
|
|
427
|
+
For a separate first-install test and idempotent configurator reruns, use
|
|
428
|
+
[fresh app verification](./expo-app-setup.md#verify-generation-in-a-fresh-application).
|
|
463
429
|
|
|
464
|
-
|
|
465
|
-
channel, and public certificate.
|
|
466
|
-
2. Publish an update with a visible test change.
|
|
467
|
-
3. Activate the update in the admin panel.
|
|
468
|
-
4. Open the release build and trigger the update check.
|
|
469
|
-
5. Download the update, reload the application, and confirm the test change.
|
|
430
|
+
## Diagnose the setup
|
|
470
431
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
432
|
+
From the **server directory**, run `npm run doctor -- --app /full/path/to/expo-application`.
|
|
433
|
+
This checks the running Docker stack and app source without changing them.
|
|
434
|
+
For npm/remote deployments add `--mode remote --server-env .env.local`.
|
|
435
|
+
Use `--offline` before starting services. See [doctor](./doctor.md) for custom
|
|
436
|
+
Compose projects, JSON output and the checks that still require a real device.
|
|
474
437
|
|
|
475
438
|
## Troubleshooting
|
|
476
439
|
|