In this tutorial, you'll learn how to set up your development environment and generate an app template using uFBT. You'll also learn how to create simple apps and implement basic functionality using the GUI. Lastly, we'll explain how to build and run your app on Flipper Zero.
To develop applications for Flipper Zero, you'll need the device itself and a USB cable to connect it to your computer. You'll also need to install the following software on your Windows/MacOS/Linux system:
test_app.ufbt create APPID=test_app. uFBT will generate the file structure required for the app.ufbt vscode_dist. This will configure VS Code to allow building and debugging your Flipper Zero application directly from the IDE.APPID can only contain letters a-z, numbers 0-9, and the symbol _.In the app folder, the file structure will looks as follows:
Here is a breakdown of the structure:
images/.gitkeep— a placeholder file used to ensure that theimages/directory is tracked by Git, even if it's empty.images/— the folder for storing images..github/workflows/build.yml— GitHub Actions configuration. Learn more.test_app.png— the app icon.test_app.c— the app main file, containing the app entry point.application.fam— the app manifest that uFBT reads to find out how to build your app. Learn more about FAM.
Here is a breakdown:
#include <furi.h>— Includes the main header file for FURI, a core component of the Flipper Zero firmware.#include <test_app_icons.h>— Needed if the app uses images. uFBT automatically converts PNG files into Flipper’s internal image format and generates this file. All you need to do is add your PNG files to theimages/directory.int32_t— You'd typically use this return type for the app's main function.UNUSED(p);— A macro that silences compiler warnings about the unusedpparameter.FURI_LOG_I— A function that logs aninfolevel message to the Flipper console. You can see these messages by opening the console (ufbt cli), then running thelog infocommand.return 0;— A return value of0indicates successful program termination (convention in C).
Open the application folder in Visual Studio Code (File → Open Folder...).
Let's make the app a bit more advanced and display two lines on the screen: Hello world and I'm test_app!. Open the test_app.c file and replace its contents with the code below:
This code utilizes the
DialogsGUI service that provides a system API. Learn more: GUI in Apps.
ufbt launch command. It will build, upload, and start your app on Flipper.Alternatively, you can manually build and transfer your app to Flipper Zero:
Shift+Ctrl+B on Win/Linux or Shift+Cmd+B on Mac. Your app with all the resources will be built into a self-contained FAP file.ufbt flash_usbIf you used the log output method (FURI_LOG_I), you can see the logs by opening the console (ufbt cli), then running the log command. If you changed the default log level, use log info instead.
Congrats on completing your first app!
If you feel your C programming skills are a bit rusty, we recommend referring to The C Programming Language by B. Kernighan and D. Ritchie, along with other resources listed on the main page of this section.
Next step: Debugging FAPs