Plug-ins development
How to debug Indesign plugin source code in Xcode?
inexutils — InDesign plugin to ignore missing plugins information from documents (by Manan-Joshi)
KohakuExtendScriptStyleShortcut — a plugin that extends the script for adding shortcut properties to styles by Kohaku Nekotarou
The build method is also clearly documented, so if you're interested, please try developing plugins in C++.
Since several decades a plug-in is a binary executable library (Windows: dll, OSX: framework) produced from C++ sources.
The term plugin is an unfortunate marketing choice for something formerly known as extension, implemented in a high level scripting language such as Flex/ActionScript, CEP / Javascript or the forthcoming UXP.
Setting a debug flag is a concept of the latter - it disables security checks for the convenience of the developer.
Debug builds of plug-ins have different binary code matching differences in the debug build of the application. As you found, they are incompatible with the release build and fortunately the application checks for that.
The differences would be larger object sizes to support extended (slow) runtime checks, additional object methods, entire interface omitted or unfunctional in the release builds - for example services to turn numeric IDs into readable strings, or support various debug output sinks. The plug-ins also should contain extra code in macros that are optimized away by the compiler for the release build. Therefor these debug plug-ins can't run with a release build.
To join the InDesign Developer Prerelease program, start at prerelease.adobe.com. Approval is a manual process but it should not take much longer than a working day. The debug builds will then show as separate downloads in CC.app .
