Skip to content

Blog: developer workflow (on-device debugging + JUnit 5)#5086

Merged
shai-almog merged 6 commits into
masterfrom
blog-developer-workflow
May 30, 2026
Merged

Blog: developer workflow (on-device debugging + JUnit 5)#5086
shai-almog merged 6 commits into
masterfrom
blog-developer-workflow

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

  • Consolidated May 30 follow-up to the May 29 weekly index (PR Blog: weekly format refresh, Metal default, new Build Cloud console #5074). Combines two previously planned posts into one themed post about how the dev iteration loop changes this release.
  • Covers the iOS and Android on-device debugging pipeline that shipped in PRs Add iOS on-device debugging support #4999 and Add Android on-device debugging support #5012: JDWP through to real devices and the simulators, two-click IntelliJ flow that the archetype now ships, the three iOS pieces (translator instrumentation, device runtime, JDWP proxy), and the smaller Android adb-orchestration story.
  • Covers the JUnit 5 work that shipped in PR Add JUnit 5 test support for the JavaSE simulator #5032: @CodenameOneTest, @RunOnEdt, @SimulatorProperty / @SimulatorProperties, and the visual-config annotations (@Theme, @DarkMode, @LargerText, @Orientation, @RTL); the junit-jupiter scope change so JUnit does not leak onto the simulator runtime for apps that do not opt in.
  • Closes with why the two pieces pair (tests give you a way to express what to run; the on-device debugger gives you a way to step through what actually happens when you run it on the device).

File

  • docs/website/content/blog/developer-workflow-debug-and-junit.md — single new file.

Sequencing

Branches off master; intended to publish the day after the weekly index (#5074). Front matter date is 2026-05-30.

Supersedes the closed PRs #5075 (on-device debugging) and #5079 (JUnit) which I had originally written as separate posts.

Test plan

  • Hugo build of docs/website succeeds.
  • Post renders correctly on the blog index and as a standalone page.
  • Header image is generated at /static/blog/developer-workflow-debug-and-junit.jpg.

Consolidated follow-up to the May 29 weekly index. Combines what
were previously two separate posts into one themed post about how
the dev iteration loop changes this release:

- On-device debugging (PRs #4999 iOS + #5012 Android): JDWP through
  to real devices and the iOS / Android simulators, so jdb,
  IntelliJ, VS Code, Eclipse, and NetBeans attach against Java
  source. The three iOS pieces (translator instrumentation, device
  runtime, JDWP proxy) and the smaller adb-orchestration Android
  half.
- JUnit 5 against the JavaSE simulator (PR #5032): @CodenameOneTest,
  @RunOnEdt, @SimulatorProperty, and the visual-config annotations
  (@theme, @DarkMode, @LargerText, @orientation, @rtl). junit-jupiter
  scope change so JUnit does not leak onto the simulator runtime for
  apps that do not opt in.

Both together push the dev loop on device closer to what it looks
like on a regular JVM application.
- "I" voice replaced with "we" or "Codename One"-flavoured phrasing
  throughout. Opening hook, "this is the Java code I wrote" line,
  the "thing that surprised me" section, the wrap-up.
- Heading and prose for "the thing that surprised me" reworked so
  the surprise is framed as something the team noticed rather than a
  personal anecdote.
- Wrap-up rephrased so the "two pieces of paving" sentence reads as
  a team observation rather than a personal opinion.
- New opening that does not start with the "Two things this post"
  fragment.
- Supported targets clarified: iOS = simulator or real iPhone over
  Wi-Fi from a Mac (the "USB pairing" language is gone). Android =
  USB, wireless adb, or the emulator (all three).
- New paragraph spelling out that iOS still needs a Mac in the
  pipeline because the bits come from Xcode (locally or via the
  build server).
- Dev-guide references go to the HTML version on the website
  (/developer-guide/#_on_device_debugging_ios etc.), not to the
  asciidoc source.
- Step-by-step IntelliJ tutorial for iOS: enable the four build
  hints (using the in-settings names, no codename1.arg. prefix),
  recommend leaving the block-on-load option on so the
  on-device-debug variant is visible, run the proxy, attach the
  debugger, launch the app.
- Same shape Android tutorial.
- Device-console behaviour and its caveat called out explicitly.
- Capability note up front: Android can step through native C/C++
  via Android Studio's LLDB alongside the JDWP attach; iOS cannot.
- "The thing that surprised us" section removed.
- "Why the two changes pair" section removed.
- JUnit section rewritten: explicit that it is standard JUnit 5
  (not a fork), com.codename1.testing.junit holds annotations +
  CodenameOneExtension, AbstractTest stays for on-device tests.
- Tutorial: file location, minimal example, plain-validator
  variant, visual-config variant, @SimulatorProperty variant.
- Testcontainers / WireMock no longer in the example list.
- Hero image lands at /blog/developer-workflow-debug-and-junit.jpg.
- IntelliJ debugger screenshot lands at
  /blog/developer-workflow-debug-and-junit/intellij-debugger-on-device.png.
- "Back to the weekly index" link to the intro post in the wrap-up.
@github-actions
Copy link
Copy Markdown
Contributor

Cloudflare Preview

Two reviewer-driven fixes.

1. The "iOS still needs a Mac somewhere in the pipeline" framing
   was technically true but misleading -- the build cloud has a Mac,
   so a developer working on Linux or Windows does not need a local
   one to debug a real iPhone. The supported-targets section now
   says that explicitly: the Mac is only required for the local
   Xcode build path and for the iOS Simulator. The Build Cloud
   handles the iOS build and the JDWP attach works over Wi-Fi from
   any OS.

2. The Android paragraph no longer talks about not-needing-a-Mac
   (redundant). It now talks about needing the Android SDK platform
   tools (adb) on the developer machine, and that those are
   available on macOS, Linux, and Windows.

3. Replaced both ASCII data-flow boxes with real Mermaid diagrams.
   New {{< mermaid >}} shortcode + an inline ESM loader (gated by
   window.__cn1MermaidLoaded so multiple diagrams on one page only
   initialise once).

The loader can't live in extend_footer.html because PaperMod calls
that partial via partialCached keyed on layout/kind, so any per-page
conditional content there ends up shared across every page sharing
the same cache key. Inlining the loader in the shortcode dodges
that completely; pages without a mermaid shortcode never see the
loader.

Verified locally with `hugo --buildFuture`: the developer-workflow
post is the only page on the site that emits the loader.
The Cloudflare PR preview build was hiding the new on-device-debug
post because its front-matter date (2026-05-30) is one day past the
current build date. Hugo skips future-dated posts unless --buildFuture
is set.

- scripts/website/build.sh now reads HUGO_BUILD_FUTURE (default
  "false") and HUGO_BUILD_DRAFTS (default "false") and passes
  --buildFuture / --buildDrafts to Hugo when set. Production
  behaviour unchanged.
- .github/workflows/website-docs.yml sets HUGO_BUILD_FUTURE=true on
  pull_request runs and "false" on the merged-to-master deploy. So
  reviewers see staged posts on the *.pages.dev preview; the live
  site still only shows posts on or after their publish date.
- JUnit example now boots the project's app class through init() /
  start() instead of constructing a Form in the test. Asserts
  against the form the app actually opens; that exercises the same
  startup path the simulator runs, which is what most apps want to
  test.
- Maven command is "mvn -Ptest test" (the project's test profile),
  not "mvn -pl javase test".
- Added IntelliJ-gutter screenshot and JUnit-results screenshot to
  the test tutorial. The screenshots make the IDE flow the primary
  example; the command-line version is below.
- The "fastest iteration loop" remark on the local-Xcode-build
  bullet is removed; both build paths are presented as equivalent.
- Block-on-load reasoning rewritten. The concern is not "an app
  that does nothing"; it is (a) launching an on-device-debug build
  while the proxy is not running and not realising it is silently
  waiting, and (b) mistaking the on-device-debug build for a
  release build and being surprised when it does not perform as
  smoothly.
- Native-interface capability section rewritten. The previous
  "Android Studio's LLDB lets you step into C / C++" framing was
  wrong; Codename One native interfaces are Java on Android, so
  the JDWP attach steps through them like any other class. On iOS
  the Impl is Objective-C; JDWP can't step through it, but framework
  code, your own Java, and the values the call returns are all still
  available, so most workflows still hold. Attach Xcode in parallel
  for the Objective-C body if you need it.
@shai-almog shai-almog merged commit 976ff73 into master May 30, 2026
8 checks passed
@shai-almog shai-almog deleted the blog-developer-workflow branch May 30, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant