Installation
To start building with Zynth, you need to set up the CLI and the native development environments for the platforms you wish to target. Zynth supports iOS, Android, and Web platforms.
Platform Setup
Common Prerequisites
Before installing Zynth, ensure you have the following tools installed on your development machine:
- Node.js: Version 18 or higher is required.
- Yarn: Used for package and dependency management across the framework.
[!NOTE] Linux/Windows Users: If you encounter installation issues during
yarn install(typically due toxcodegenpostscripts), you can run the installation with the--ignore-platformflag:$ yarn install --ignore-platform
Zynth CLI
The zynth CLI is the primary entry point for managing Zynth applications. It handles project scaffolding, native project generation (bootstrapping), and launching build tools.
To create and initialize a new Zynth project:
$ npx zynth new my-app
Enter the directory and install dependencies:
$ cd my-app
$ yarn install
iOS Setup
[!IMPORTANT] macOS Only: iOS development, including Xcode and simulator support, is only available on macOS.
To build and run Zynth applications on iOS, you will need a Mac with the latest version of Xcode and its command-line tools.
Requirements
- Xcode: Install the latest stable version from the Mac App Store.
- CocoaPods: Required for managing native iOS dependencies.
$ sudo gem install cocoapods - xcodegen: Used by Zynth to generate Xcode projects dynamically.
$ brew install xcodegen
Launching the App
- Open the iOS Simulator via Xcode: Xcode > Open Developer Tool > Simulator.
- In your project directory, run the development command. If this is your first time running the app, include the
--bootstrapflag to generate the native project files:
# First time / Regenerate native files
$ npx zynth dev ios --bootstrap
# Subsequent runs
$ npx zynth dev ios
Android Setup
Zynth supports Android devices running Android 7.0 (API 24) or newer.
Requirements
- Android Studio: Download and install the latest stable version (Ladybug or newer recommended).
- Android SDK: Using the SDK Manager within Android Studio, ensure you have the following installed:
- Android SDK Platform 35 (or newer)
- Android SDK Build-Tools 35.0.0 (or newer)
- Android SDK API 24 (Minimum supported version)
Environment Variables
Configure your environment so the CLI can locate the Android SDK and Java tools. Add the following to your shell profile (e.g., ~/.zshrc or ~/.bash_profile):
# Android SDK location
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
# Java Home (macOS example)
export JAVA_HOME=$(/usr/libexec/java_home)
Launching the App
- Open an Android Virtual Device (AVD) from the Android Studio Device Manager.
- In your project directory, run the development command. Use the
--bootstrapflag for the initial setup:
# First time / Regenerate native files
$ npx zynth dev android --bootstrap
# Subsequent runs
$ npx zynth dev android
Web Setup
Zynth targets the web using Rsbuild, ensuring high-performance bundles and a modern developer experience.
No additional native tools or environment variables are required for web development. Simply run the following command to start the development server:
$ npx zynth dev web