CLI reference
One command for the whole workflow. Run pyxpo --help or pyxpo <command> --help for the same information in your terminal.
pyxpo create demo
pyxpo run ios
pyxpo build android --releasepyxpo create
Create a new project with a root layout, a home screen, a dynamic route and a not-found screen.
pyxpo create <name> [--dir PATH]pyxpo run
Build and start the app with hot reload. The target defaults to desktop: a native Mac app (Mac Catalyst) on macOS, a native WinUI 3 app on Windows. web starts a dev server and opens the app in your browser.
pyxpo run [desktop|android|ios|web]| Option | Meaning |
|---|---|
--no-reload | Turn hot reload off. |
--port N | Port for the hot reload server (default 8765, or dev_port in the config). For web: the dev server port (default 8000). |
--preview | Desktop only: show the app in a browser window instead of building the native Mac or Windows app. |
--base PATH | Web only: the path the site is served under, such as /myapp. |
--no-open | Web only: do not open a browser. |
--no-devtools | Web only: hide the dev tools button (device preview, breakpoints). |
--dir PATH | Project folder, if it is not the current one. |
pyxpo build
Build an installable app. Android release builds use R8 when build_properties turn minify on. desktop builds the Mac .app or the Windows .exe. web writes a static site to build/web/ that any static host can serve.
pyxpo build {android|ios|desktop|web} [--release]| Option | Meaning |
|---|---|
--release | Make a release build instead of a debug build. |
--base PATH | Web only: the path the site is served under, such as /myapp. |
pyxpo prebuild
Generate editable android/ and ios/ projects that you can open in Android Studio or Xcode. Running it again keeps your edits; changed generated files are written next to them with a .pyxpo-new suffix.
pyxpo prebuild [all|android|ios]| Option | Meaning |
|---|---|
--clean | Delete the native folders first. Your edits in them are lost. |
--yes | Skip the confirmation for --clean. |
pyxpo stage
Copy your Python app into a prebuilt native project. Gradle and Xcode run this for you, so you rarely call it by hand.
pyxpo stage {android|ios} [--release] [--kind simulator|device]pyxpo runtime
Manage the cached CPython runtime in ~/.cache/pyxpo.
pyxpo runtime {fetch|path|clean}| Option | Meaning |
|---|---|
--platform ios|android | Only this platform. |
--abi ABI | Only this Android ABI. |
--from DIR | Install from local .tar.gz files, for offline machines. |
--all | With clean: remove every cached runtime version. |
pyxpo doctor
Check Python, Xcode, the Android SDK, the JDK and Gradle, and say how to fix what is missing.
pyxpo doctorpyxpo config
Validate [tool.pyxpo] and print the resolved config. --schema prints the JSON Schema for editor completion.
pyxpo config [--platform ios|android] [--schema]pyxpo add-lib
Check that a PyPI package works on iOS and Android, then add it to your dependencies.
pyxpo add-lib <package>