1.. _simulator:
2
3===============
4Simulator on PC
5===============
6
7You can try out LVGL **using only your PC** (i.e. without any
8development boards). LVGL will run on a simulator environment on the PC
9where anyone can write and experiment with real LVGL applications.
10
11Using the simulator on a PC has the following advantages:
12
13- Hardware independent: Write code, run it on the PC and see the result on a monitor.
14- Cross-platform: Any Windows, Linux or macOS system can run the PC simulator.
15- Portability: The written code is portable, which means you can simply copy it when migrating to embedded hardware.
16- Easy Validation: The simulator is also very useful to report bugs because it
17  provides a common platform for every user.
18- Better developer experience: On PC Debuggers are usually faster and better, you can log to files,
19  add a lot of ``printf`` s, do profiling, and so on.
20
21
22Select an IDE
23-------------
24
25The simulator is ported to various IDEs (Integrated Development Environments).
26Choose your favorite IDE, read its README on GitHub, download the project, and load it to the IDE.
27
28- `Eclipse with SDL driver <https://github.com/lvgl/lv_sim_eclipse_sdl>`__: Recommended on Linux and Mac, supports CMake as well
29- `VisualStudio <https://github.com/lvgl/lv_port_pc_visual_studio>`__: Recommended on Windows
30- `VSCode with SDL driver <https://github.com/lvgl/lv_port_pc_vscode>`__: Recommended on Linux (SDL) and Mac (SDL)
31- `CodeBlocks <https://github.com/lvgl/lv_sim_codeblocks_win>`__: Recommended on Windows
32- `PlatformIO with SDL driver <https://github.com/lvgl/lv_platformio>`__: Recommended on Linux and Mac but has an STM32 environment as well
33- `Generic Linux <https://github.com/lvgl/lv_port_linux>`__: CMake based project where you can easily switch between fbdev, DRM, and SDL.
34- `MDK with FastModel <https://github.com/lvgl/lv_port_an547_cm55_sim>`__: For Windows
35
36External project not maintained by the LVGL organization:
37
38- `QT Creator <https://github.com/Varanda-Labs/lvgl-qt-sim>`__: Cross platform
39
40Built-in drivers
41----------------
42
43LVGL comes with several :ref:`built-in drivers <drivers>`.
44
45Even if a simulator project comes with e.g. SDL, you can easily replace it by enabling
46another driver in ``lv_conf.h`` and calling its ``create`` function.
47
48For example to use the Linux frame buffer device instead of SDL just enable ``LV_USE_LINUX_FBDEV``
49and call
50
51.. code-block:: c
52
53   lv_display_t *display = lv_linux_fbdev_create();
54   lv_linux_fbdev_set_file(display, "/dev/fb0")
55