Running an application
The Run button (F5) launches the application you are designing, so you can try it right away, on your computer, on a phone or in the browser.
What happens
- Khnoum checks the project: as long as it contains errors, the bottom bar counts them and nothing is launched.
- It generates the application's code in the project's
codefolder (the Generate button does only this step). - It compiles this code; the Console shows the progress.
- It launches the application on the chosen target.
The first build takes a few minutes; the following ones, a few seconds, because the build folder is shared between all your projects. The button becomes Stop while the application is running.
Choosing the target
When several targets are checked in the Project tab, the Desktop / Mobile / Web selector in the top bar chooses the one that is launched.
| Target | Where the application opens |
|---|---|
| Desktop | in a window on your computer; the console shows its exit code |
| Web | the server starts on your computer and the browser opens on the application |
| Mobile | on the connected Android phone or the emulator; otherwise, on a Mac, in the iOS simulator; otherwise, in a phone-sized window |
For mobile, Khnoum tells you in the console what is missing (device, tool, Rust target) when it falls back to the preview.
What your computer needs
Khnoum never installs anything on its own: it tells you what is missing and how to get it.
| To… | You need |
|---|---|
| run an application (all targets) | Rust, free: rustup.rs |
| an Android phone | Android Studio (SDK, NDK, Java) and the phone's Rust target: rustup target add aarch64-linux-android |
| the iOS simulator | a Mac with Xcode and the aarch64-apple-ios-sim target (x86_64-apple-ios on an Intel Mac) |
To produce the installers for each system, see Export.
The produced code
The project's code folder is an ordinary Cargo workspace: you can open it, read it, and build it yourself with cargo build. The "Generated code" button of the Project tab opens it. It is regenerated at each run: change the project in Khnoum, not this folder.