@Retention(CLASS) @Target({TYPE})

public @interface OnDeviceDebug

On-device debugging build hints for iOS and Android.

Place this on your application’s main class – the class named by codename1.mainName. An attribute you do not set is not written at all, so the build server’s own default applies. The default clause below each attribute names a constant that says nothing – see HintUnset – and this package deliberately does not record what the server would do instead, because that is the server’s to change.

Methods

public abstract Toggle android() default Toggle.DEFAULTBoolean true/false defaults to false.
public abstract Toggle ios() default Toggle.DEFAULTBoolean true/false defaults to false.
public abstract String iosProxyHost() default ""Hostname or IP address the device-side listener dials to reach the desktop proxy.
public abstract int iosProxyPort() default 0TCP port on ios.onDeviceDebug.proxyHost where the proxy is listening for the device.
public abstract Toggle iosWaitForAttach() default Toggle.DEFAULTBoolean true/false defaults to false.

Method details

android

public abstract Toggle android() default Toggle.DEFAULT
Boolean true/false defaults to false. When true, the generated AndroidManifest.xml is marked android:debuggable="true", R8/proguard is disabled, and the build is pinned to debug-only (android.release is forced off and android.debug is forced on) so a stray hint can’t ship a release-signed APK that’s debuggable="true". Pair with the cn1:android-on-device-debugging Maven goal (or the bundled IntelliJ run configs) to install, launch, forward JDWP, and stream logcat through adb. Has no effect on builds that don’t carry it – release builds are unaffected. See the On-Device Debugging (Android) chapter for the full flow.

ios

public abstract Toggle ios() default Toggle.DEFAULT
Boolean true/false defaults to false. When true, the iOS build links a small JDWP listener thread (cn1_debugger) into the binary and the ParparVM translator emits source-line and locals metadata so a desktop proxy can serve the running app to any JDWP-speaking debugger. Has no effect on release builds. See the On-Device Debugging (iOS) chapter for the full flow.

iosProxyHost

public abstract String iosProxyHost() default ""
Hostname or IP address the device-side listener dials to reach the desktop proxy. Default 127.0.0.1 (correct for the native iOS simulator). For a physical device, set this to the developer laptop’s LAN IP. Has no effect unless ios.onDeviceDebug=true.

iosProxyPort

public abstract int iosProxyPort() default 0
TCP port on ios.onDeviceDebug.proxyHost where the proxy is listening for the device. Default 55333. Has no effect unless ios.onDeviceDebug=true.

iosWaitForAttach

public abstract Toggle iosWaitForAttach() default Toggle.DEFAULT
Boolean true/false defaults to false. When true, the app blocks at startup until the proxy connects and the IDE tells the VM to continue. Useful when the breakpoint to investigate fires during app boot. Has no effect unless ios.onDeviceDebug=true.