Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

InfiniSim

> 编程语言
Open source

Simulator for InfiniTime user interface without needing a PineTime

195 stars0 likes1 views
WebsiteGitHub

About

Simulator for InfiniTime user interface without needing a PineTime

InfiniSim

Simulator for InfiniTime project.

Experience the InfiniTime user interface directly on your PC, to shorten the time until you get your hands on a real PineTime smartwatch. Or use it to develop new Watchfaces, new Screens, or quickly iterate on the user interface.

For a history on how this simulator started and the challenges on its way visit the original PR.

Get the Sources

Clone this repository and tell git to recursively download the submodules as well

bash
git clone --recursive https://github.com/InfiniTimeOrg/InfiniSim.git

If you've already cloned the repository without the submodules (or you want to update them to the latest checked in version) run the following command:

bash
git submodule update --init --recursive

Build dependencies

  • CMake
  • SDL2 (provides the simulator window, handles mouse and keyboard input)
  • Compiler (g++ or clang++)
  • lv_font_conv (for font.c generation since InfiniTime#1097)
    • Note: requires Node.js v14.0.0 or later
  • Pillow (for resource.zip generation when BUILD_RESOURCES=ON, which is the default)
  • optional: libpng, see -DWITH_PNG=ON cmake setting below for more info

On Ubuntu/Debian install the following packages:

bash
sudo apt install -y cmake libsdl2-dev g++ npm libpng-dev

On Arch Linux the following packages are needed:

bash
sudo pacman -S cmake sdl2 gcc npm libpng

On Fedora the following packages are needed:

bash
sudo dnf install cmake SDL2-devel g++ npm patch perl libpng-devel

On OpenSUSE (Tumbleweed) the following packages are needed:

bash
sudo zypper install cmake libSDL2-devel gcc-c++ gcc npm libpng16-devel patch

Then install the lv_font_conv executable to the InfiniSim source directory (will be installed at node_modules/.bin/lv_font_conv)

bash
npm install [email protected]

When you want to create a resource.zip file then install the pillow Python library to the InfiniSim source directory (will be installed in .venv/)

bash
python3 -m venv .venv
source .venv/bin/activate
pip install wheel Pillow

Optionally, depending on your distro, it may also serve the Pip package as official native installation packages:

On Ubuntu/Debian

bash
sudo apt install python3-pil

On OpenSUSE (Tumbleweed)

bash
sudo zypper install python311-Pillow

Configure and Build

In the most basic configuration tell cmake to configure the project and build it with the following two commands:

bash
cmake -S . -B build
cmake --build build -j4

The following configuration settings can be added to the first cmake -S . -B build call

  • -DInfiniTime_DIR=InfiniTime: a full path to an existing InfiniTime repository checked out. Inside that directory the src/libs/lvgl submodule must be checked out as well. The default value points to the InfiniTime submodule in this repository.
  • -DMONITOR_ZOOM=1: scale simulator window by this factor
  • -DBUILD_RESOURCES=ON: enable/disable resource.zip creation, will be created in the /resources folder
  • -DWITH_PNG=ON: enable/disable the screenshot to PNG support. Per default InfiniSim tries to use libpng to create screenshots in PNG format. This requires libpng development libraries as build and runtime dependency. Can be disabled with cmake config setting -DWITH_PNG=OFF.
  • -DENABLE_USERAPPS: ordered list of user applications to build into InfiniTime. Values must be fields from the enumeration Pinetime::Applications::Apps and must be separated by a comma. Ex: -DENABLE_USERAPPS="Apps::Timer, Apps::Alarm". The default list of user applications will be selected if this variable is not set.

Build with Docker

You can also build the simulator using Docker. This is useful if you don't want to install all the dependencies on your system. First build the Docker image:

bash
docker build -t infinisim-build .devcontainer

Afterwards you can build the simulator with:

bash
docker run --rm -it -v ${PWD}:/sources --user $(id -u):$(id -g) infinisim-build

Note: when using rootless podman instead of docker the --user part can be left out. The command to build the simulator using podman is:

bash
podman run --rm -it -v ${PWD}:/sources infinisim-build

By default this builds the simulator using the InfiniTime files from the submodule in your ${PWD}. If you want to use a different repository, the easiest way is to mount over the default submodule location in the container at /sources/InfiniTime:

bash
docker run --rm -it -v ${PWD}:/sources -v ${PWD}/../InfiniTime:/sources/InfiniTime --user $(id -u):$(id -g) infinisim-build

Other CMake generation and build arguments can be passed to the GENERATE_ARGS and BUILD_ARGS variables:

bash
docker run --rm -it -v ${PWD}:/sources -e GENERATE_ARGS=-DENABLE_USERAPPS="Apps::Timer,Apps::Alarm" -e BUILD_ARGS=-j16 --user $(id -u):$(id -g)  infinisim-build

Run Simulator

When the build was successful the simulator binary can be started with

bash
./build/infinisim

To hide the second simulator-status-window start the binary with the --hide-status option

bash
./build/infinisim --hide-status
  • Left mouse button: simulates your finger, just click to tap, click and drag to swipe
  • Right mouse button: simulates the hardware button (for example turn the screen off or on again)

Using the keyboard the following events can be triggered:

  • r ... enable ringing
  • R ... disable ringing
  • m ... let motor run for 100 ms
  • M ... let motor run for 255 ms
  • n ... send notification
  • N ... clear new notification flag
  • b ... connect Bluetooth
  • B ... disconnect Bluetooth
  • v ... increase battery voltage and percentage
  • V ... decrease battery voltage and percentage
  • c ... charging,
  • C ... not charging
  • l ... increase brightness level
  • L ... lower brightness level
  • p ... enable print lvgl memory usage to terminal
  • P ... disable print memory usage
  • s ... increase step count by 500 steps
  • S ... decrease step count by 500 steps
  • h ... set heartrate running, and on further presses increase by 10 bpm
  • H ... stop heartrate
  • i ... take screenshot
  • I ... start/stop Gif screen capture
  • w ... generate weather data
  • W ... clear weather data

Additionally using the arrow keys the respective swipe gesture can be triggered. For example pressing the UP key triggers a SwipeUp gesture.

Littlefs-do helper

To help working with the SPI-raw file the tool littlefs-do is provided (in the build directory). The SPI-raw file emulates the persistent 4MB storage available over the SPI bus on the PineTime.

…

Resource loading

To load resource zip files into the SPI raw file for the simulator to use the res load command can be used.

bash
$ ./littlefs-do res --help
Usage: ./littlefs-do res  [options]
actions:
  load res.zip         load zip file into SPI memory
Options:
  -h, --help           show this help message for the selected command and exit

Licenses

This project is released under the GNU General Public License version 3 or, at your option, any later version. The same license as InfiniTime.

The simulator is based on lv_sim_eclipse_sdl project under the MIT license.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++hacktoberfesthacktoberfest2022

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言