…ugging)
iOS on-device debugging (cn1:ios-on-device-debugging) only worked for local
Mac builds. The translator wrote cn1-symbols.txt into the build output, which
for a cloud build is produced server-side and never reaches the developer's
target/ — so the proxy's autodetect always failed with "No cn1-symbols.txt
found" (issue #5333). And because the proxy never started, the device's
connect retry timed out after ~10s and booted the app anyway, so the
waitForAttach block appeared to do nothing.
Fix: the proxy now downloads the symbol table from the device over the wire —
no local file. The translator embeds the table (gzip-compressed) as a
generated C source that links into the app; the device serves it via a new
CMD_GET_SYMBOLS / EVT_SYMBOLS wire pair; the proxy fetches, inflates, and
builds its SymbolTable on connect. This works identically for cloud builds on
Windows/Linux.
Also make waitForAttach blocking never time out: the device retries the
connect forever (and reconnects if the proxy drops before the IDE attaches)
when waitForAttach is set; the bounded ~10s give-up now applies only when not
waiting.
- WireProtocol/cn1_debugger: CMD_GET_SYMBOLS 0x11, EVT_SYMBOLS 0x90 (chunked)
- Parser: emit cn1_debug_symbols.c (gzipped blob + accessors) instead of the
.txt sidecar; #include "cn1_globals.h" so the CN1_ON_DEVICE_DEBUG guard sees
the macro. Picked up by the pbxproj source glob and compiled into the binary
- cn1_debugger: serve the blob; weak-import the accessors; never-timeout connect
- Proxy: SymbolTable.load(InputStream); DeviceConnection fetches+inflates on
HELLO then fires onSymbols->onHello; JdwpServer late-binds symbols and gates
VM_START on their arrival; sendVmStart made idempotent; --symbols flag removed
- IosOnDeviceDebuggingMojo: drop the cn1-symbols.txt autodetect
Verified: proxy, plugin and translator compile; gzip<->SymbolTable round-trip
and clang-compiled C-blob gunzip round-trip both pass. Not verified: a real
on-device build (needs cloud/Xcode). Cloud rollout needs the bundled
ByteCodeTranslator.jar rebuilt from this change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Problem (issue #5333)
iOS on-device debugging (
cn1:ios-on-device-debugging) only worked for local Mac builds. The translator wrotecn1-symbols.txtinto the build output; for a cloud build that file is produced server-side and never reaches the developer'starget/, so the proxy's autodetect always failed:The reporter is on Windows, where a cloud build is the only option — so the feature was simply unusable for them. As a secondary symptom, because the proxy never started, the device's connect retry timed out after ~10s and booted the app anyway, so
waitForAttachappeared to do nothing.Fix
Symbols are now downloaded from the device over the wire — never a local file.
cn1_debug_symbols.cthat links into the app binary.CMD_GET_SYMBOLS/EVT_SYMBOLSwire pair (chunked, 256 KB).SymbolTableon connect (EVT_HELLO).This works identically for cloud builds on Windows/Linux — the symbols travel inside the app, so wherever the app runs, the proxy can get them.
waitForAttachblocking now never times out. The device retries the connect forever (and reconnects if the proxy drops before the IDE attaches) whenwaitForAttachis set; the bounded ~10s give-up applies only when not waiting.How the blob reaches the binary
Parser.writeOutput(srcRoot)writescn1_debug_symbols.calongside the translated per-class.cfiles.ByteCodeTranslatorthen globssrcRoot(srcRoot.list(...), run afterwriteOutput) to build the pbxproj source list, so the file is added to thePBXSourcesBuildPhaseand compiled/linked like any other translated source. Its strongcn1_debug_symbols_data()/_length()symbols satisfy the weak externs incn1_debugger.m.Changes
CMD_GET_SYMBOLS0x11,EVT_SYMBOLS0x90(chunked).cn1_debug_symbols.c(blob + accessors) instead of the.txtsidecar;#include "cn1_globals.h"so theCN1_ON_DEVICE_DEBUGguard sees the macro (it's a header#define, not a project macro).SymbolTable.load(InputStream);DeviceConnectionfetches+inflates on HELLO then firesonSymbols→onHello;JdwpServerlate-binds symbols and gatesVM_STARTon their arrival (JDWP clients wait forVM_STARTbefore enumerating classes, so no null table);sendVmStartmade idempotent per session;--symbolsflag removed.cn1-symbols.txtautodetect.Docs are intentionally unchanged (they never referenced the sidecar file).
Verification
cn1-debug-proxy,codenameone-maven-plugin, andByteCodeTranslatorall compile.SymbolTable.loadround-trip passes.clang(with the header guard) and gunzips back to the exact original payload.Deployment note
Cloud rollout requires the bundled
ByteCodeTranslator.jarin the build server to be rebuilt from this translator change; the BuildDaemon itself needs no source edit (it already passes-Dcn1.onDeviceDebug=trueand compiles the whole translated dir).🤖 Generated with Claude Code