|
1 | 1 | ## Running on desktop |
2 | 2 |
|
3 | | -Desktop builds of MicroPythonOS can run without a local source checkout. The `internal_filesystem/` is frozen into the binary at build time, so a single pre-built executable is enough to try the OS. |
| 3 | +MicroPythonOS runs on Linux, macOS and Raspberry Pi desktops. The desktop build is a single executable that contains the whole OS, so you usually do not need to compile anything. |
4 | 4 |
|
5 | | -### Download a pre-built binary |
| 5 | +Pick the level that matches what you want to do. |
6 | 6 |
|
7 | | -1. Go to the [releases page](https://github.com/MicroPythonOS/MicroPythonOS/releases). |
8 | | -2. Download the binary for your platform: |
9 | | - - Linux / WSL2 on Windows: `lvgl_micropy_unix` |
10 | | - - macOS (Apple Silicon or Intel): `lvgl_micropy_macOS` |
11 | | -3. Make it executable: |
| 7 | +--- |
12 | 8 |
|
13 | | -``` |
| 9 | +### Level 1: Just want to run it? |
| 10 | + |
| 11 | +Grab a pre-built binary and launch it. |
| 12 | + |
| 13 | +1. Download the binary for your platform from the [releases page](https://github.com/MicroPythonOS/MicroPythonOS/releases): |
| 14 | + - **Linux, Raspberry Pi, WSL2 on Windows:** `lvgl_micropy_unix` |
| 15 | + - **macOS (Apple Silicon or Intel):** `lvgl_micropy_macOS` |
| 16 | +2. Make it executable: |
| 17 | + |
| 18 | +```bash |
14 | 19 | chmod +x lvgl_micropy_unix |
15 | 20 | ``` |
16 | 21 |
|
17 | | -4. Place it where `scripts/run_desktop.sh` expects it. The script looks for: |
18 | | - - `lvgl_micropython/build/lvgl_micropy_unix` on Linux |
19 | | - - `lvgl_micropython/build/lvgl_micropy_macOS` on macOS |
| 22 | +3. Run it. From a terminal: |
| 23 | + |
| 24 | +```bash |
| 25 | +./lvgl_micropy_unix |
| 26 | +``` |
| 27 | + |
| 28 | +Or double-click it in your file manager. You may want to rename it to `MicroPythonOS` first. |
| 29 | + |
| 30 | +--- |
| 31 | + |
| 32 | +### Level 2: Want to develop an app but use a prebuilt OS? |
20 | 33 |
|
21 | | -You can create that folder and copy the binary there: |
| 34 | +You can use a downloaded OS binary with a full source checkout so you can edit apps and see changes immediately. |
22 | 35 |
|
| 36 | +1. Clone the repository: |
| 37 | + |
| 38 | +```bash |
| 39 | +git clone --recurse-submodules https://github.com/MicroPythonOS/MicroPythonOS.git |
| 40 | +cd MicroPythonOS |
23 | 41 | ``` |
| 42 | + |
| 43 | +2. Download the binary for your platform from the [releases page](https://github.com/MicroPythonOS/MicroPythonOS/releases). Rename it and put it where the runner script expects it: |
| 44 | + - Linux / Raspberry Pi / WSL2 → `lvgl_micropython/build/lvgl_micropy_unix` |
| 45 | + - macOS → `lvgl_micropython/build/lvgl_micropy_macOS` |
| 46 | + |
| 47 | +```bash |
24 | 48 | mkdir -p lvgl_micropython/build |
25 | | -cp /path/to/downloaded/lvgl_micropy_unix lvgl_micropython/build/lvgl_micropy_unix |
| 49 | +cp /path/to/downloaded/binary lvgl_micropython/build/lvgl_micropy_unix |
| 50 | +chmod +x lvgl_micropython/build/lvgl_micropy_unix |
26 | 51 | ``` |
27 | 52 |
|
28 | | -5. Run it: |
| 53 | +3. Run it with the helper script: |
29 | 54 |
|
30 | | -``` |
| 55 | +```bash |
31 | 56 | ./scripts/run_desktop.sh |
32 | 57 | ``` |
33 | 58 |
|
34 | | -### Build from source |
| 59 | +`scripts/run_desktop.sh` launches the OS using the Python files in `internal_filesystem/` directly, so any edit you make there appears the next time you restart the app. No rebuild is needed. |
35 | 60 |
|
36 | | -If you want to modify the OS itself or run the very latest code, you can [build it from source](compiling.md). The built binary will already be in `lvgl_micropython/build/lvgl_micropy_XXX` where `XXX` is `unix` or `macOS`. |
| 61 | +**Try it:** |
37 | 62 |
|
38 | | -### Notes on MacOS |
| 63 | +1. Edit `internal_filesystem/builtin/apps/com.micropythonos.about/assets/about.py` |
| 64 | +2. Run `./scripts/run_desktop.sh` |
| 65 | +3. Open the About app |
| 66 | +4. See your change immediately |
39 | 67 |
|
40 | | -If you get an error about a missing `/opt/homebrew/opt/libffi/lib/libffi.8.dylib` then fix that with: `brew install libffi` |
| 68 | +Once your app works on desktop, deploy it to a physical device with [Installing on ESP32](installing-on-esp32.md). |
41 | 69 |
|
42 | | -If you get an error about the code being unsigned, then allow it like this: |
| 70 | +--- |
43 | 71 |
|
44 | | - |
| 72 | +### Level 3: Want to build the OS yourself? |
45 | 73 |
|
| 74 | +If you need to change the OS itself, add C extensions, modify MicroPython/LVGL bindings, or run the very latest code, build from source. The binary will already land in `lvgl_micropython/build/lvgl_micropy_XXX` where `XXX` is `unix` or `macOS`. |
46 | 75 |
|
47 | | -## Making Changes on Desktop |
| 76 | +```bash |
| 77 | +./scripts/build_mpos.sh unix # Linux, Raspberry Pi, WSL2 |
| 78 | +./scripts/build_mpos.sh macOS # macOS |
| 79 | +``` |
48 | 80 |
|
49 | | -If you do have a source checkout, you can still run the OS directly from `internal_filesystem/`. When you run `./scripts/run_desktop.sh`, the OS runs the MicroPythonOS scripts **directly from `internal_filesystem/`**. This means: |
| 81 | +See [Compiling](compiling.md) for the full instructions, including cloning and dependencies. |
50 | 82 |
|
51 | | -- **All changes to Python files are immediately active** - no build or install needed |
52 | | -- **Instant testing** - edit a file, restart the app, see the changes |
53 | | -- **Fast iteration cycle** - the recommended way to develop and test |
| 83 | +--- |
54 | 84 |
|
55 | | -**Try it yourself:** |
| 85 | +## Known issues and fixes |
56 | 86 |
|
57 | | -1. Edit `internal_filesystem/builtin/apps/com.micropythonos.about/assets/about.py` |
58 | | -2. Run `./scripts/run_desktop.sh` |
59 | | -3. Open the About app |
60 | | -4. See your changes immediately! |
| 87 | +### Linux: "No such file or directory" when running the binary |
| 88 | + |
| 89 | +Make sure it is executable: |
| 90 | + |
| 91 | +```bash |
| 92 | +chmod +x lvgl_micropy_unix |
| 93 | +``` |
| 94 | + |
| 95 | +### macOS: missing `libffi.8.dylib` |
| 96 | + |
| 97 | +Install libffi: |
| 98 | + |
| 99 | +```bash |
| 100 | +brew install libffi |
| 101 | +``` |
| 102 | + |
| 103 | +### macOS: "cannot be opened because the developer cannot be verified" |
| 104 | + |
| 105 | +The prebuilt binary is not signed. Open **System Settings → Privacy & Security** and click **Allow Anyway** next to the blocked item, then run it again. |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +### Windows |
| 110 | + |
| 111 | +Native Windows builds are not supported. [Users report](https://github.com/MicroPythonOS/MicroPythonOS/issues/31) that the Linux desktop binary works under WSL2 on Windows 11. Alternatively, you can try the [web port](../web-port/using.md), which runs a desktop build in the browser. |
61 | 112 |
|
| 113 | +--- |
62 | 114 |
|
63 | | -## Making Changes on ESP32 |
| 115 | +## Deploying to hardware |
64 | 116 |
|
65 | | -Once you've tested your changes on desktop and they work correctly, or you're doing things you can't test on desktop, then you can deploy to physical hardware. |
| 117 | +Once your app works on desktop, install it on a supported ESP32 device. |
66 | 118 |
|
67 | 119 | {!os-development/installing-on-esp32.md!} |
68 | 120 |
|
0 commit comments