Version 1.4.0 (current)
Generate standalone apps on the phone
Have an agent write full business code, then separately verify preview, APK, and callable interfaces.
Reproduce the app-generation experiment on a prepared device. An APK is an Android installation package. Verify code preview, independent installation and business interfaces as separate results.
For a step-by-step native Java path, use Develop a native APK on the device. This page continues with React/WebView.
Choose the generation path
Follow this page for the React/WebView scoring experiment. WebView embeds web content inside an app; this path writes App.jsx and api.mjs, then packages them using the prepared preview host and APK shell.
For native Java, use the separate tutorial. The agent writes MainActivity/Manifest on the device and uses ECJ/D8/aapt (Java compilation, bytecode conversion and resource packaging) to compile, sign and install an APK. A same-signature update preserves data; ContentProvider and UI share state, and invalid parameters and unauthorized calls are rejected. This path is verified on an emulator and not yet on physical devices. It uses no precompiled business shell or web assets, but its toolchain must be provisioned separately and does not ship with the system. See Current progress; the commands below do not reproduce that native path.
Prerequisites
The prepared experimental device has Codex, native Android Node, esbuild, React, a precompiled APK shell, Android packaging/signing tools, and an app API service. They are not provisioned automatically. This path is not computer-free first-time setup or an offline model.
The model writes complete core code in App.jsx and api.mjs, not just template configuration. Arbitrary native hardware permissions still require an extended shell or system interfaces. Arbitrary JSX does not imply arbitrary Android APIs.
All commands below run in the same prepared device shell, not in a terminal at the computer’s repository checkout. This example uses app ID my_score, package org.agentos.myscore, and a Chinese display name meaning “My score” (shown in the packaging command). Keep these identifiers separate; the next API tutorial continues with my_score.
Run the experiment
Provide an app request
Run the following in the prepared device shell. Use a new experimental appId to avoid confusing old data:
cd /data/local/agentos/light-app-lab/free-app-kit
cat > /data/local/tmp/my-score-request.txt <<'REQUEST'
做一个双队计分应用。界面有两队分数、加分、减分、历史和撤销。
API 自行定义 score.state、score.add、score.undo;界面与外部调用共享状态。
拒绝未知队伍、零分变更及非安全整数。要写完整业务代码。
REQUEST
sh generate.sh my_score /data/local/tmp/my-score-request.txtThe reproducible request above is preserved in Chinese: create a two-team score app with scores, increment/decrement, history, undo, and shared-state score.state, score.add, and score.undo APIs; reject unknown teams, zero changes, and non-safe integers; write full business code.
The generator calls the model configured on the phone, writes core code, builds, and starts preview. Output records generation time, and total time from the start of generation until the preview command returns. Neither is a visible-first-frame or complete-install time.
Preview quickly after editing code
sh build.sh my_scoreThis re-bundles JSX rather than rebuilding the full ROM. Business-module entry changes reload according to current app-service rules. Hot updates across the dependency-file graph are not implemented.
Generate and open a standalone APK
sh package-app.sh my_score org.agentos.myscore 我的计分
pm path org.agentos.myscoreThe script packages, verifies signing, installs, and launches the app. Confirm the independent package, launcher, actual window, and business result together. A host-page preview alone is not sufficient.
Verify the result
In the two-team scoring example verified on an emulator, the model generated complete JSX and business modules, the standalone APK installed and opened, and external API score changes appeared in the UI. APK packaging took 770 ms in that run, excluding the model, installation, and first frame. This is not a general performance guarantee.
Limits and troubleshooting
Missing preview hosts, unprovisioned toolchains, signing errors, or an unavailable API service cause failure. API-using APKs still depend on the experimental Node backend; not every app is a self-contained offline native app.
Next steps
Call app interfaces, then check the UI, APK and API of the new version separately.
Research preview · Current availability
Report an issue or give feedback
Delivery to the maintenance queue does not mean it has been handled. Feedback is retained for 90 days.
Built with Fumadocs