// Author: cirakg & claude ai // Summary: Debug-only self-test: fills one field and runs the settings-change path once, so the simulator shows real output. // // The simulator has no phone, so this stands in for one save from Garmin // Connect: if Text 1 is empty it receives a fake 100-character test string, // then the normal onSettingsChanged path runs (analysis plus write-back). // It prints a "SPIKE ready" line that build-spike.sh waits for. Release // builds compile the empty (:release) version, so the beta you upload never // changes your settings by itself. import Toybox.Application.Properties; import Toybox.Lang; import Toybox.System; module DebugSelfTest { // Fake 100-character test string in the same format as the phone tests. (:debug) const SAMPLE = "N=100|abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrP0050stuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghEND"; (:debug) function run(app as SpikeApp) as Void { var current = Properties.getValue("text1"); if (current == null || (current instanceof String && current.length() == 0)) { Properties.setValue("text1", SAMPLE); app.onSettingsChanged(); } System.println("SPIKE ready total_chars=" + app.report.totalChars + " changes=" + app.report.changeCount + " status='" + Properties.getValue("statusField") + "'"); } (:release) function run(app as SpikeApp) as Void { } }