# Annotation Type OnDeviceDebug

@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.

- ## Optional Element Summary

  Optional Elements
  Modifier and Type
  Optional Element
  Description
  `Toggle`
  `android`
  Boolean true/false defaults to false.
  `Toggle`
  `ios`
  Boolean true/false defaults to false.
  `String`
  `iosProxyHost`
  Hostname or IP address the device-side listener dials to reach the desktop proxy.
  `int`
  `iosProxyPort`
  TCP port on `ios.onDeviceDebug.proxyHost` where the proxy is listening for the device.
  `Toggle`
  `iosWaitForAttach`
  Boolean true/false defaults to false.

- ## Element Details

  - ### android

    Toggle android
    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.
    Default:
      `DEFAULT`

  - ### ios

    Toggle ios
    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.
    Default:
      `DEFAULT`

  - ### iosProxyHost

    String iosProxyHost
    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`.
    Default:
      `""`

  - ### iosProxyPort

    int iosProxyPort
    TCP port on `ios.onDeviceDebug.proxyHost` where the proxy is listening for the device. Default `55333`. Has no effect unless `ios.onDeviceDebug=true`.
    Default:
      `0`

  - ### iosWaitForAttach

    Toggle iosWaitForAttach
    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`.
    Default:
      `DEFAULT`