All ESP32 iPhone Agent notes
These instructions concern ESP32 iPhone Agent by Henry Yuan. Other projects in this index use different firmware, apps and protocols.
View the project profileFlash the ESP32-S3 firmware
Choose a matching firmware channel or build and flash from source.
Flash the board while it is connected to your Mac. Use a USB data cable; a charge-only cable can supply power without exposing a serial device.
Confirm the target, supply its port when multiple devices are connected, and avoid connecting or disconnecting other serial devices during flashing. Upstream merged port-selection fix #21 into main on October 19, 2026, as commit 133ead5. Older scripts could switch to the first board after reset. If your source does not contain the fix, disconnect other matching devices and leave only the intended board connected. This review covers the source and upstream simulated-port tests; this site has not repeated a hardware flash.
Choose the firmware channel first
Use the desktop Chrome/Edge installer and choose the board, channel and input mode. Downloads checked December 3:
| Target | Version / pinned source |
|---|---|
| Official XIAO USB | 0.2.6 / d4d34c0 |
| TestFlight XIAO, regular and dual factory files | 0.2.16 / 4786f42 |
| Experimental StopWatch | 0.2.8 / 612f494, no matching tag |
All four factory images match the index size and SHA-256; none was flashed. Choosing Bluetooth writes over USB and then changes input mode; wait for confirmation before unplugging. Bluetooth input needs App 1.0.8+, or 1.0.9+ on iPhone 8 / X.
The new updater accepts a unified USB/Bluetooth board when it reports ota: 1, enables its listener with ota on, and uses the normal XIAO channel. Earliest dual images without that capability still need one USB reinstall. 0.2.11 was published for App 1.0.13+; match the app and channel and wait until no task or recording is active. The general update page still says dual images cannot update in-app; that blanket statement is older than the reviewed implementation. A grey update button alone does not identify the cause. Web reinstall erases pairing, hotspot credentials and network settings; forget the old iOS device and pair again. The two factory files remain distinct; use the installer’s selected target.
Install the toolchain
Install arduino-cli and configure Espressif’s board package index. The project specifies the ESP32 3.3.x core; do not silently replace it with another major release.
arduino-cli config add board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
arduino-cli core update-index
arduino-cli core install esp32:esp32@3.3.12
arduino-cli lib install "NimBLE-Arduino@2.5.1"
If that package-index URL is already configured, you do not need to add it a second time. Version 3.3.12 matches the reviewed upstream CI configuration; follow changes in the project README when updating your checkout.
Build and write
From the cloned project’s root, run:
hardware/flash.sh
The script compiles the firmware, looks for a serial port, switches an already-running bridge into its bootloader, and uploads the result. Wait for a successful upload before disconnecting the board.
The default build targets 8 MB flash, OPI PSRAM, and native USB. Check hardware compatibility if you are using a different board.
Default hardware/flash.sh builds unified USB/Bluetooth HID; --dual-hid is now an alias. --usb-only is the fallback USB-only target. Deprecated --abs builds USB-only absolute input; the unified image offers that choice in Settings › Board › Pointer instead. Do not combine incompatible targets such as --stopwatch and --dual-hid. --no-audio is a source option that stops advertising AirPlay audio; it is not a verified property of every browser download.
Select a port explicitly
List devices and pass the intended board’s actual port. Without an argument, the script still chooses the first matching device as its initial target:
arduino-cli board list
hardware/flash.sh /dev/cu.usbmodemYOUR_PORT
YOUR_PORT is a placeholder, not a literal device name. If no device appears, reconnect the cable, check whether it carries data, and consult the board vendor’s bootloader instructions.
The fixed script snapshots ports before reset. It uses the single newly appeared port, or retains the original port if none appeared and it still exists. It reports no board found when no device is detected, and stops if the original port disappears without a replacement or several new ports appear. For several ports appeared after the reset, not guessing, disconnect other devices, identify the target again, and retry.
Why the script is required
flash.sh force-includes hardware/hid_bridge/nimble_cfg.h in the build. Those BLE buffer settings support BLE control and CLI transport; app video in 1.0 uses Wi-Fi TCP. Compiling the sketch with otherwise similar Arduino defaults can leave the board running with unsuitable buffers.
Keep your source path free of spaces: the script checks this because of the forced-include compiler flag.
Optional diagnostics
hardware/flash.sh --build-only
hardware/flash.sh --debug
--build-only compiles without uploading. --debug includes USB-serial diagnostics. These are diagnostic options, not extra steps required for ordinary setup.
An optional --sta test build joins your router instead of opening a hotspot. Prepare the credentials file and check the LAN test-mode requirements before flashing it; the ordinary setup above does not need that option.
Verify the next connection
Move the flashed board to the iPhone and open ESP32 Agent. A successful firmware upload does not prove Bluetooth pairing or screen mirroring works. Verify those separately in Connect the board and screen.
New board identity and video diagnostics
Firmware 0.2.10 uses USB product Manina AI board, manufacturer Manina AI, VID:PID 303A:841F, with the same VID/PID in BLE HID’s PnP identity; ROM download mode keeps its own identity. It fixes long pointer moves restarting the board and records app phones for Bluetooth HID targeting. 0.2.9 adds vage, a larger board-log tail and drops unreferenced video frames before freezing a full GOP. These diagnostics do not prove every video stall fixed. Use flash.sh, which also applies the required USB identity linker configuration.