Codex is an experimental tool developed by OpenAI to provide a coding agent ability on the CLI. In this demo, we try to use Codex to generate an Android wearable app without writing any code ourselves.
Steps to install
-
Install globally via NPM.
npm i -g @openai/codex -
Attach an OpenAI API key.
~/.zshrc export OPENAI_API_KEY="your-api-key-here"
In Android Studio
- Create a blank wearable project.
In your Terminal
-
Go to the project directory.
-
Run Codex with a prompt, and describe what you want to build.
$ codex "Use the android studio project in this folder, create a wearable android app that runs a mini game. Each round, the screen is divided into 4 partitions, each has a different background color. a white dot appear randomly within 1 of the partition. user has to tap on the partition with the white dot to proceed to the next round. if user does not tap within 3 seconds, or tapping on a wrong partition, the game ends. otherwise, the game continues to up to 1 minute and print total correct tapping when it ends." -
After about 7 minutes of waiting, the draft version is created.

-
Trying to build the project results in an error. We sent the error to Codex, and it was fixed.
I have this error when build. e: MainActivity.kt:133:14 Expression 'weight' of type 'kotlin.Float' cannot be invoked as a function. Function 'invoke()' is not found. -
Now the game runs successfully on the watch emulator.
-
Next, we get it to update the background colors and request it to propose a suitable foreground color.
change the partition colors to #328E6E, #67AE6E, #90C67C, #E1EEBC, and find a suitable color for the dot so it has enough contrast over the background colors -
Finally, the app is ready.
Test our App
-
In a watch emulator.
-
On an actual watch

Notes
-
Codex can run in full auto mode.
codex --approval-mode full-auto "your prompt" -
Codex logs are available in JSON.
cd ~/.codex/sessions -
"System Prompt" can be supplied.
cat ~/.codex/instructions.md -
As of today (18th April 2025), it is still unstable with several bugs. But good enough just for fun.