new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Expo & React Native · all subjects

development-builds

94 notes in this subject, read out of this brain and free to use. This is page 1 of 2.

Install expo-dev-client in bare React Native project

To add expo-dev-client to an existing React Native project created with npx @react-native-community/cli@latest init, use npx expo install expo-dev-client (or yarn expo install, pnpm expo install, or bun create expo depending on your package manager). If your project has an ios directory on disk, run npx pod-install (or yarn dlx pod-install, pnpm dlx pod-install, or bunx pod-install) to fully install the native code.

expo-dev-client requires deep link scheme configuration

Expo CLI uses a deep link to launch your project. If you haven't configured a scheme for your app yet to support deep linking, use the uri-scheme library to add one. You can list existing schemes with npx uri-scheme list and add a new scheme with npx uri-scheme add your-scheme.

Create development build with CNG using expo-dev-client

To use expo-dev-client in a project that uses Continuous Native Generation (CNG), refer to the Create a development build guide at /develop/development-builds/introduction/#how-would-you-like-to-build-your-development-build.

New project template with expo-dev-client

When creating a new project, you can use the with-dev-client template to create it pre-configured with expo-dev-client. Use npx create-expo-app -e with-dev-client (or yarn create expo-app -e with-dev-client, pnpm create expo-app -e with-dev-client, or bun create expo -e with-dev-client depending on your package manager).

Build and install debug app after expo-dev-client setup

After installing and configuring expo-dev-client with deep link schemes, create a debug build of your app using your choice of tools. You can build locally with Expo CLI or in the cloud with EAS Build.

Dev tools plugins overview and two-way communication

Dev tools plugins consist of a small amount of code added to a project that enables two-way communication between the app and an external Chrome window. They are similar to Flipper plugins available in Development builds and Expo Go. Dev tools plugins only require JavaScript code and do not require adding native modules or config plugins to your project.

Dev tools plugin hook no-ops in production

All Expo dev tools plugin hooks will only enable the plugin in development mode and do not affect your production bundle.

How to install and use a dev tools plugin

To add a dev tools plugin to your app, install it as a package and add the plugin hook to your app's root component to establish two-way communication. After adding the connecting code, start the dev server with `npx expo start`. Then press Shift+M to open the list of available dev tools plugins. Select the plugin you want to use, and it will open in a new Chrome window.

Dev tools plugin compatibility with Expo Go and Development builds

Dev tools plugins should only include JavaScript code and are generally compatible with Expo Go and Development builds without requiring a new development build. However, if a plugin inspects a package with native code not included in Expo Go, a new development build is required to use both the component and the plugin. For example, a dev tools plugin for React Native Firebase will not work with Expo Go since React Native Firebase includes native code not part of Expo Go.

useDevToolsPluginClient for direct plugin interaction

All plugins communicate through exports from `expo/devtools`. To interact with a plugin directly, use `useDevToolsPluginClient` by passing the same plugin name to it as is used by the plugin's web user interface. The client supports `addMessageListener` to receive messages and `sendMessage` to send messages. Example: `const client = useDevToolsPluginClient('my-devtools-plugin'); client?.addMessageListener("ping", (data) => { alert(`Received ping from ${data.from}`); }); client?.sendMessage("ping", { from: "app" });`

React Navigation dev tools plugin installation and usage

Install with: `npx expo install @dev-plugins/react-navigation`. Pass the navigation root to the plugin using `useReactNavigationDevTools(navigationRef)` in your app's entry point. For Expo Router, use `useNavigationContainerRef()` in `app/_layout.js`. For React Navigation, use `useNavigationContainerRef()` in your App.js and wrap with `NavigationContainer`. The plugin allows seeing the history of React Navigation actions and state, rewinding to previous points in navigation history, and sending deep links to your app. It is fully compatible with Expo Router.

Apollo Client dev tools plugin installation and usage

Install with: `npx expo install @dev-plugins/apollo-client`. Pass your client instance to the plugin using `useApolloClientDevTools(client)` in your app's root component or where you wrap the app in `ApolloProvider`. The plugin allows inspecting cache, query, and mutation for Apollo Client and displays query history, cache, and mutations as the app performs Apollo Client operations.

React Query dev tools plugin installation and usage

Install with: `npx expo install @dev-plugins/react-query`. Pass your client instance to the plugin using `useReactQueryDevTools(queryClient)` in your app's root component or where you wrap the app in `QueryClientProvider`. The plugin lets you explore data and queries, cache status, and refetch and remove queries from the cache from TanStack Query. It displays queries as they are used in your app.

Redux dev tools plugin installation and usage

Install with: `npx expo install redux-devtools-expo-dev-plugin`. For @reduxjs/toolkit, modify the `configureStore` call to disable built-in dev tools by passing `devTools: false`, then add the Expo DevTools plugin enhancer: `import devToolsEnhancer from 'redux-devtools-expo-dev-plugin'; const store = configureStore({ reducer: rootReducer, devTools: false, enhancers: getDefaultEnhancers => getDefaultEnhancers().concat(devToolsEnhancer()), });`. The plugin is based on Redux DevTools and provides a live list of actions and how they affect the state, plus the ability to rewind, replay, and dispatch actions from DevTools.

TinyBase dev tools plugin installation and usage

Install with: `npx expo install @dev-plugins/tinybase`. Pass your store instance to the plugin using `useTinyBaseDevTools(store)` in your app's root component or where you wrap the app with the store's `Provider`. The plugin connects the TinyBase Store Inspector to your app, allowing you to view and update the contents of your app's store.

Keyboard shortcut to open dev tools plugins menu

In the terminal, after running `npx expo start`, press Shift+M to open the list of available dev tools plugins. You can also press ? to show all commands, which includes an option to open more tools where dev tools plugins can also be selected.

npx expo start --tunnel flag for restrictive networks

The npx expo start command can be run with the --tunnel flag to expose the development server on a publicly available URL that is accessible through firewalls from around the globe. This is helpful when you cannot connect to your development server with the default LAN option or when you want to get feedback on your implementation while developing.

EAS Update in development builds

EAS CLI's eas update command bundles the current state of your JavaScript and asset files into an optimized update that is stored on a hosting service by Expo. A development build can load published updates without needing to check out a particular commit or leave a development machine running.

Manually entering update URL in development build

When a development build launches, it exposes UI to load a development server or to enter a URL manually to launch a specific branch. The URL pattern is: https://u.expo.dev/[your-project-id]?channel-name=[channel-name]. To get your project's ID, use the URL in the app config's expo.updates.url field. To see a list of channels, run eas channel:list.

Deep linking to update URL in development build

You can load your app on a device with a compatible custom client by opening a URL of the form {scheme}://expo-development-client/?url={manifestUrl}. The scheme parameter is the URL scheme of your client (defaults to exp+{slug} where slug is the value set in the app config). The manifestUrl parameter is a URL-encoded URL of an update manifest to load, typically https://u.expo.dev/[your-project-id]?channel-name=[channel-name].

Deep linking example for development build with update

Example deep link URL for a development build: exp+app-slug://expo-development-client/?url=https%3A%2F%2Fu.expo.dev%2F767ADF57-B487-4D8F-9522-85549C39F43F%2F%3Fchannel-name%3Dmain. The scheme is exp+app-slug and the manifestUrl points to a project with ID F767ADF57-B487-4D8F-9522-85549C39F43F and channel main.

disableOnboarding query parameter for automation

When launching an update URL in a development build on an emulator or simulator using automation (such as in CI/CD workflows), you can add the disableOnboarding=1 query parameter to the URL to skip the onboarding screen that appears on the first launch of a development build after installation.

App-specific deep links in development build limitations

When testing deep links in a development build (such as navigating to a specific screen in an Expo Router app or testing OAuth login flow redirection), construct the URL exactly as you would for a standalone build (for example, myscheme://path/to/screen). Your project must already be open in the development build for an app-specific deep link to work. Cold-launching a development build with an app-specific deep link is not currently supported. Avoid using expo-development-client in your app-specific deep links in the path, as it is a reserved path.

QR code generation endpoint for development client

Requests to https://qr.expo.dev/development-client with query parameters appScheme and url will receive a response with an SVG image containing a QR code that can be scanned to load a version of your project in your development build.

QR code endpoint parameters

The QR code endpoint https://qr.expo.dev/development-client accepts the following parameters: appScheme (URL-encoded deeplinking scheme of your development build, defaults to exp+{slug} where slug is set in app config) and url (URL-encoded URL of an update manifest to load, typically https://u.expo.dev/[your-project-id]?channel-name=[channel-name]).

QR code endpoint example

Example QR code URL: https://qr.expo.dev/development-client?appScheme=exp%2Bapps-slug&url=https%3A%2F%2Fu.expo.dev%2FF767ADF57-B487-4D8F-9522-85549C39F43F0%3Fchannel-name%3Dmain. The scheme is exp+app-slug and the url points to a project with ID F767ADF57-B487-4D8F-9522-85549C39F43F and channel main.

PR preview workflow with EAS Update and QR codes

You can set up your CI process to publish an EAS Update whenever a pull request is updated and add a QR code that is used to view the change in a compatible development build. Instructions are available for implementing this workflow using GitHub Actions, which can also serve as a template for other CI systems.

registerDevMenuItems API for extending dev menu

The registerDevMenuItems API from expo-dev-menu allows you to extend the dev menu with additional buttons. Import registerDevMenuItems from expo-dev-menu and pass an array of objects with name and callback properties. Each call to registerDevMenuItems will override all previous entries.

registerDevMenuItems code example

Example of extending the dev menu: import { registerDevMenuItems } from 'expo-dev-menu'; const devMenuItems = [ { name: 'My Custom Button', callback: () => console.log('Hello world!'), }, ]; registerDevMenuItems(devMenuItems);

EAS Update extension in development client

The EAS Update extension provides the ability to view and load published updates in your development client. To install it, install the most recent versions of expo-dev-client and expo-updates using npx expo install expo-dev-client expo-updates. After configuring EAS Updates, you can view and load updates via the Extensions panel in your development build.

runtimeVersion in app config for development builds

When creating a development build, you get a stable environment to load changes defined in JavaScript or other assets. Changes defined in android and ios directories or by installed packages will require a new build. To enforce an API contract between JavaScript and native layers, set the runtimeVersion value in the app config. Each build will have this value embedded and will only load bundles with the same runtimeVersion, in both development and production.

Development build definition and purpose

A development build is your own version of Expo Go where you are free to use any native libraries and change any native configuration. It is recommended when you want to create your own app and release to app stores. A development build includes the expo-dev-client library, which augments the built-in React Native development tooling.

Development build tooling features

The development build tooling includes support for inspecting network requests and a launcher UI that lets you switch between different development servers (such as between a server running on your machine or a teammate's machine) and deployments of your app (such as published updates with EAS Update).

Development build methods are equivalent

All three methods of building a development build produce the same development build. They differ in where the app compiles and what you need to have installed on your machine.

Development build launcher screen

The launcher screen lets you switch between different development servers and deployments of your app without rebuilding. From the device's Home screen, launch the development build and connect to a development server from the launcher screen to start working on your app.

Relationship between create-expo-app and development builds

When you create a new Expo app with create-expo-app, you start with a project where you update TypeScript/JavaScript code on your local machine and view the changes in the Expo Go app. A development build is an alternative that allows you to use any native libraries and change any native configuration.

Development build shareable URL generation

When a development build is ready, a unique shareable URL is automatically generated for the build. This URL can be shared with teammates or sent to test devices to install the build directly. The URL is unique to the build for your project.

Download development build from EAS dashboard

Teammates can download the development build artifact directly on their device from the build page in the EAS dashboard.

eas build:run command to install development build

A teammate can download and install a development build using the EAS CLI command 'eas build:run --profile development'. They must be signed in from the Expo account associated with the development build. If the profile name differs from 'development', use the actual profile name instead with the --profile flag.

iOS device registration and development builds

If new iOS devices are registered after creating a development build, a new development build must be created to install it on those devices. For more information, see the internal distribution documentation.

Open project in development build on Android or iOS

After starting the development server, press A or I keys to open your project on an Android Emulator or iOS Simulator respectively. On a physical device, scan the QR code from your system's camera or a QR code reader to open the project.

Development build launcher screen connectivity

When launching a development build from your device's Home screen, you see a launcher screen. If a bundler is detected on your local network, or if you have signed in to an Expo account in both Expo CLI and your development build, you can connect directly from this screen. Otherwise, connect by scanning the QR code displayed by Expo CLI.

Rebuild development build when adding native code libraries

If you add a library containing native code APIs to your project (such as expo-secure-store), you must rebuild the development client. The native code of the library is not included automatically when installing the library as a dependency.

Access development build menu with keyboard shortcut

Press Cmd ⌘ + D on macOS or Ctrl + D on other platforms in Expo CLI to access the development build menu. Alternatively, shake your phone or tablet to open the menu. The menu provides access to all development build functions, debugging functionality, and allows you to switch to a different version of your app.

No native rebuild required for JavaScript changes

With a development build installed on your device or emulator/simulator, you do not have to wait for the native build process for JavaScript changes. You only need to rebuild when you change the underlying native code that powers your app.

expo-system-ui required for Android development builds

When creating a development build, you must install expo-system-ui to support appearance styles for Android. Otherwise, the userInterfaceStyle property is ignored. Install it with: npx expo install expo-system-ui

Enable Developer Mode directly on iOS device - step-by-step

To enable Developer Mode directly on an iOS device: (1) Install the development build on the device first. Once installed, press the app icon to open an alert asking to enable Developer Mode and press OK. (2) Go to Settings app, navigate to Privacy & Security > Developer Mode. (3) Enable the toggle; iOS will prompt to restart the device. Press Restart. (4) After restart, unlock the device. A system alert will appear; press Turn On and enter the device's passcode when prompted. Developer Mode is now enabled. You can turn off Developer Mode at any time, but must repeat the process to re-enable it.

Enable Developer Mode via Mac with Xcode

To enable Developer Mode by connecting an iOS device to a Mac: Xcode must be installed on the Mac first. (1) Connect the iOS device to a Mac using a USB cable. Press Trust on the iOS device when the 'Trust This Computer?' alert appears. (2) Open Xcode, navigate to Window > Devices and Simulators. Under Devices, you will see a warning 'Previous preparation error: Developer Mode disabled' with instructions. (3) On the iOS device, open Settings > Privacy & Security > Developer Mode. Enable the toggle; iOS will prompt to restart. Press Restart. (4) After restart, unlock the device. A system alert will appear; press Turn On and enter the device's passcode when prompted. Developer Mode is now enabled. You can turn off Developer Mode at any time, but must repeat the process to re-enable it.

Installing expo-dev-client for development builds

If you install expo-dev-client to your project, a debug build of your project will include the expo-dev-client UI and tooling, and these are called development builds. You can install it with npx expo install expo-dev-client.

Accessing development server in browser during Expo development

While the development server is running in the terminal, press W to open the app in a web browser. This allows testing the same project on web alongside native development.

Development build vs Expo Go comparison table

Development builds offer web-like iteration speed for mobile app development and full support for any third-party library including those requiring custom native code. They facilitate team testing with shared native runtime and enable extensive customization with config plugins and direct native code access. They are ideal for full-fledged app development aimed at store deployment. In contrast, Expo Go allows quick iteration and testing of Expo SDK projects via client app with easy project sharing via QR codes, but only supports libraries within the Expo SDK, not custom native dependencies, and offers limited customization. Expo Go is ideal for learning, prototyping, and experimenting, not recommended for production apps.

Install expo-dev-client to initialize development build

To initialize a project for a development build, run npx expo install expo-dev-client (npm), yarn expo install expo-dev-client (yarn), pnpm expo install expo-dev-client (pnpm), or bun expo install expo-dev-client (bun).

Development server changes when expo-dev-client is installed

After installing expo-dev-client, when running npx expo start, the manifest URL contains expo-development-client along with the app scheme. The development server now operates for a development build instead of Expo Go.

Development build vs Expo Go comparison use cases

Development builds are ideal for full-fledged app development aimed at store deployment, offering a complete development environment and tools. Expo Go is ideal for learning, prototyping, and experimenting, and is not recommended for production apps. Think of a development build as a customizable version of Expo Go that is unique to the requirements of a specific project.

When to use development builds vs building Expo Go from source

If you need to make native code changes to your Expo project such as adding custom native modules, create a development build instead of building Expo Go from source.

device-transformer.js is a generated on-device Babel transpiler

device-transformer.js is a generated payload (~11 MB) that bundles @babel/core and babel-preset-expo into a standalone Hermes JSI runtime (EXOnDeviceTransformer.mm). It runs in the source explorer to transpile edited files for published projects. The transpiler exposes a transformModule(source, filename, moduleId, depIds) -> { code, depNames } function. It must not be edited by hand as it is a build artifact.

Regenerating device-transformer.js payload

The device-transformer.js payload is regenerated using build tools located in apps/expo-go/tools/device-transformer. Run node build-slim.js to bundle and apply Hermes-safety passes, then copy the minified result to the Resources directory. Run node baseline-slim.js for Node fidelity checks and node test-extraction.js for AST require-extraction and unsupported-construct validation. Regeneration is needed when @babel/core, babel-preset-expo, or SDK version changes.

device-transformer.js build artifact committed like snack-runtime.hbc

device-transformer.js is committed to the repository as a build artifact, similar to how Exponent/Supporting/SnackRuntime/snack-runtime.hbc is committed. It is not regenerated on every build.

Re-signing iOS builds with eas build:resign

The command 'eas build:resign' can codesign an existing .ipa file for iOS to a new ad hoc provisioning profile. This eliminates the need for a full rebuild, reducing time when distributing with your team. For example, to add a new test device to an existing build, use this command to update the provisioning profile to include the device without rebuilding the entire app. For more information, see the Re-signing new credentials guide.

bare-expo project recommended over Expo Go for SDK development

The bare-expo project in apps/bare-expo is recommended for SDK development instead of Expo Go (apps/expo-go) because Expo Go is difficult to set up and requires API tokens. The bare-expo project includes most of the Expo SDK and runs JavaScript code from apps/test-suite and apps/native-component-list, allowing you to browse SDK components and APIs and easily write and run E2E tests for iOS and Android.

Give your agent this brain