If you want to do code level compilation and simulation, you can use the local simulator.
There are two ways to set it up: let the desktop app create and build the simulator for you, or download a template and build it manually as described below.
Setup build environment
The local simulator needs a build toolchain and the SDL2 library.
Windows
Build toolchain
We provide a toolchain that you can download from tools-for-windows. Double click
launch-tools-shell.batto open a command prompt, it'd auto configure the environment variables. In the same command prompt window,cdto go to the simulator project directory to run the simulator.SDL2 We package the
SDL2library directly in the simulator project directory, so you don't need to install it separately.
macOS
Build toolchain You need to install C/C++ compiler to compile the simulator code. As macOS already has
clanginstalled, you can skip this step.SDL2 You can install
SDL2by executing the following command:brew install sdl2
Linux
Build toolchain You need to install C/C++ compiler to compile the simulator code. Install them from your distribution's package manager.
SDL2 You can install
SDL2on Linux by executing the following command:Ubuntu/Debian
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-ttf-devFedora
sudo dnf install SDL2-devel SDL2_image-devel SDL2_ttf-develOther Linux distributions Search your distribution's package manager to install
SDL2.
Get a simulator project template
Desktop app
When you create a project in the desktop app and choose a project path, the app copies the simulator template that matches the target version into the folder. Templates are included for every supported version: 8.3.7, 9.2.2, 9.3.0, 9.4.0, 9.5.0, and 9.6.0.
Manual download
You can also download the template from Simulator Project Template. The template directories are named after the LVGL version, such as v8.3.7 and v9.2.2.
Add the generated code
- With the desktop app, set the project's export folder for the target version in Settings, export, then use Build and run in the toolbar. The app writes the generated sources in place and shows the build log in the bottom panel.
- Manually, download the generated code from
anyui-LIVE, extract it, and copy thegenerateddirectory into the downloaded simulator template's version directory.
After that, you can run the simulator manually by executing the following command under the matching version directory:
cd v9.2.2
make && make run
Use the directory name that matches your project's target version, for example v8.3.7 or v9.6.0.