This guide will help you set up your development environment for GutenbergKit.
In order to build GutenbergKit, the following tools must be installed on your development machine:
- Node.js - Required for building the web app; recommend using Node Version Manager.
- Xcode - Required if building the iOS demo app.
- Android Studio - Required if building the Android demo app.
To see all available development commands, run make help (or simply make) in your terminal. This will display a list of all available build, test, and development commands.
Install the GutenbergKit dependencies and start the development server by running the following command in your terminal:
make serve-devOnce finished, the web app can now be accessed in your browser by visiting the URL logged in your terminal. However, it is recommended to use a native host app for testing changes made to the editor for a more realistic experience. A demo app is included in the GutenbergKit project, along with instructions on how to use it below.
This demo app is useful for quickly testing changes made to the editor.
The iOS demo app loads the development server by default.
- Start the development server by running
make serve-dev. - Launch Xcode and open the
ios/Demo-iOS/Gutenberg.xcodeprojproject. - Select the
Gutenbergtarget. - Run the app.
Alternatively, you can load a production build of the web app bundled with the GutenbergKit package by running make build and disabling the GUTENBERG_EDITOR_URL environment variable by navigating to Product → Scheme → Edit Scheme in Xcode.
Debug builds of the Android demo app load the development server at http://10.0.2.2:5173/ by default.
- Start the development server by running
make serve-dev. - Launch Android Studio and open the
androidproject. - Run the app on an emulator.
To load a different URL, set GUTENBERG_EDITOR_URL in the android/local.properties file. To load the production build of the web app bundled with the GutenbergKit package instead, run make build and set the variable to an empty value. Removing or commenting out the line restores the default, so only an empty value selects the bundled build. Rebuild the app after changing it.
Example Android local.properties
# Load the bundled production build
GUTENBERG_EDITOR_URL=
Release builds, and host apps that include a local GutenbergKit checkout, load the bundled build unless GUTENBERG_EDITOR_URL is set.
Note
Android emulators route http://10.0.2.2 to the host machine's IP address, allowing easy access to the development server from the emulator. For iOS simulators, the localhost URL is http://localhost. Appending the correct Vite development server port is required, which Vite logs when starting the server.
To run the demo app on a physical device, see the physical device setup guide.
Note
The development server serves only the translations fetched into src/translations/, so the editor renders in English until translations are fetched. To test translations, run make fetch-translations, then rebuild the app.
To build GutenbergKit for production run the following command in your terminal:
make build