---
title: Generating a Wearable Apps using AI with OpenAI Codex
url: https://calvin.my/posts/generating-a-wearable-apps-using-ai-with-openai-codex
published: 2025-04-18
updated: 2026-09-17
category: AI
tags:
- vibe coding
- OpenAI
- wearable
- codex
- Android
summary: The post demonstrates using OpenAI Codex as a command-line coding agent to build an Android Wear mini-game from a natural-language prompt. After creating a blank wearable project, the author asks Codex to implement timed tap gameplay, then supplies a build error for correction and requests revised colors with a contrasting dot. The resulting app runs on an emulator and physical watch, though Codex remains unstable and may require iterative fixes.
---

# Generating a Wearable Apps using AI with OpenAI Codex

[Codex](https://github.com/openai/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

1. Install globally via NPM.

   ```bash
   npm i -g @openai/codex
   ```

2. Attach an OpenAI API key.

   ```bash
   ~/.zshrc

   export OPENAI_API_KEY="your-api-key-here"
   ```

* * *

## In Android Studio

1. Create a blank wearable project.

* * *

## In your Terminal

1. Go to the project directory.

2. Run Codex with a prompt, and describe what you want to build.

   ```bash
   $ 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."
   ```

3. After about 7 minutes of waiting, the draft version is created.

   ![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/17b9e15c-cfd3-4319-be27-106f5d7bc899.png)

4. Trying to build the project results in an error. We sent the error to Codex, and it was fixed.

   ```markup
   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.
   ```

5. Now the game runs successfully on the watch emulator.

6. Next, we get it to update the background colors and request it to propose a suitable foreground color.

   ```markup
   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
   ```

7. Finally, the app is ready.

* * *

## Test our App

1. In a watch emulator.

   <iframe title="Wearable app created by OpenAI Codex" src="https://www.youtube.com/embed/Qh2egS1m3Qs" width="395" height="702" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen" referrerpolicy="strict-origin-when-cross-origin"></iframe>

2. On an actual watch

   ![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/53abac63-f8a6-4d5e-b034-ff13dae91340.png)

* * *

## Notes

1. Codex can run in full auto mode.

   ```bash
   codex --approval-mode full-auto "your prompt"
   ```

2. Codex logs are available in JSON.

   ```bash
   cd ~/.codex/sessions
   ```

3. "System Prompt" can be supplied.

   ```bash
   cat ~/.codex/instructions.md
   ```

4. As of today (18th April 2025), it is still unstable with several bugs. But good enough just for fun.
