Package: ufbt
uFBT - micro Flipper Build TooluFBT is a cross-platform tool for building applications forFlipper Zero. It is a simplified version ofFlipper Build Tool (FBT).uFBT has anofficial GitHub Action. With it, you can automate building and publishing your application using GitHub workflows.uFBT enables basic development tasks for Flipper Zero, such as building and debugging applications, flashing firmware, creating VSCode development configurations. It uses prebuilt binaries and libraries, so you don't need to buildthe whole firmwareto compile and debug your application for Flipper.InstallationLinux & macOS:python3 -m pip install --upgrade ufbtWindows:py -m pip install --upgrade ufbtuFBT uses your system's Python for running bootstrap code. Minimal supported version isPython 3.8. For executing actual build tasks, uFBT will download and use its own Python binaries and a toolchain built for your platform.On first run, uFBT will download and install required SDK components fromreleaseupdate channel of official firmware. For more information on how to switch to a different version of the SDK, seeManaging the SDKsection.Using pyenvIf you are usingpyenvto manage python versions, after installation you may need to runpyenv rehashto generateshimforufbtcommand.UsageBuilding & running your applicationRunufbtin the root directory of your application (the one withapplication.famfile in it). It will build your application and place the resulting binary indistsubdirectory.You can upload and start your application on Flipper attached over  USB usingufbt launch.To see other available commands and options, runufbt -h.DebuggingIn order to debug your application, you need to be running the firmware distributed alongside with current SDK version. You can flash it to your Flipper usingufbt flash(using a supported SWD probe),ufbt flash_usb(over USB).For other flashing and debugging options, seeufbt -h.VSCode integrationuFBT provides a configuration for VSCode that allows you to build and debug your application directly from the IDE. To deploy it, runufbt vscode_distin the root directory of your application. Then you can open the project in VSCode (File-Open Folder...) and use the provided launch (ctrl+shift+b) & debugging (ctrl+shift+d) configurations.Application templateuFBT can create a template for your application. To do this, runufbt create APPID=<app_id>in the directory where you want to create your application. It will create an application manifest and its main source file. You can then build and debug your application using the instructions above.Application manifests are explained in theFBT documentation.Otherufbt clistarts a CLI session with the device;ufbt lint,ufbt formatrun clang-format on application's sources;You can temporarily add toolchain binaries (compiler, linter, OpenOCD and others) to your PATH. Seeufbt --helpfor more information.Managing the SDKTo update the SDK, runufbt update. This will download and install all required SDK components from previously used source.To switch to SDK for a differentrelease channel, runufbt update --channel=[dev|rc|release].uFBT also supports 3rd-party update indexers, following the same schema asofficial firmware. To use them, runufbt update --index-url=<url>, where<url>is a URL to the index file, e.g.https://update.flipperzero.one/firmware/directory.json.To use SDK for acertain releaseor a not-yet-mergedbranchfrom official repo, runufbt update --branch=0.81.1orufbt update --branch=owner/my-awesome-feature.You can also use branches from other repos, where build artifacts are available from an indexed directory, by specifying--index-url=<url>.uFBT can also download and update the SDK from anyfixed URL. To do this, runufbt update --url=<url>.To use alocal copyof the SDK, runufbt update --local=<path>. This will use the SDK located in<path>instead of downloading it. Useful for testing local builds of the SDK.Global and per-project SDK managementBy default, uFBT stores its state - SDK and toolchain - in.ufbtsubfolder of your home directory. You can override this location by settingUFBT_HOMEenvironment variable.uFBT also supports dotenv (.env) files, containing environment variable overrides for the project in current directory. Most commonly, you will want to use this to override the default state directory to a local one, so that your project could use a specific version and/or hardware target of the SDK.You can enable dotenv mode for current directory by runningufbt dotenv_create. This will create.envfile in current directory with default values, linking SDK state to.ufbtsubfolder in current directory, and creating a symlink for toolchain to.ufbt/toolchainin your home directory. You can then edit.envfile to further customize the environment.You can also specify additional options when creating the.envfile. Seeufbt dotenv_create --helpfor more information.ufbt-bootstrapUpdating the SDK is handled by uFBT component calledbootstrap. It has a dedicated entry point,ufbt-bootstrap, with additional options that might be useful in certain scenarios. Runufbt-bootstrap --helpto see them.TroubleshootingIf something goes wrong and uFBT state becomes corrupted, you can reset it by runningufbt clean. If that doesn't work, you can try removing.ufbtsubfolder manually from your home folder.ufbt-bootstrapand SDK-relatedufbtsubcommands accept--verboseoption that will print additional debug information.ContributinguFBT is a small tool and does not contain the actual implementation of build system, project templates or toolchain. It functions as a downloader and manager of SDK components that are packagedalongside with Flipper firmware.Issues and pull requests regardingufbt-bootstrapfeatures like SDK management should be reported to this project, and the rest - related to actual application development - toFlipper firmware repo.