Quick answer: Capture both Lua script errors and engine-level crashes from your Defold game, tagged with the platform, because Defold exports one project to desktop, mobile, and HTML5 and each can fail differently. Defold provides crash APIs for native crashes, so capturing both layers gives full visibility across targets.
Defold is a cross-platform engine that builds a single Lua project to a wide range of targets, desktop, iOS, Android, HTML5, from one codebase. That portability means your game runs in genuinely different environments, and crashes can come from your Lua scripts or from the engine itself, and can be specific to one platform. Setting up crash reporting for a Defold game means capturing both the Lua-level errors and the engine-level crashes, tagged with the platform, so you can make sense of failures spread across all the targets Defold ships to.
One project, many targets
Defold strength is building one Lua project to many platforms with a consistent engine, but that breadth means your game runs across desktop operating systems, mobile devices, and the browser, each with its own behavior. A crash can be specific to one target, a mobile memory issue, an HTML5 browser constraint, a desktop driver problem, so knowing which platform a crash came from is the first requirement for interpreting it.
This portability makes platform tagging essential. The same Lua code runs everywhere, but the engine, the hardware, and the constraints differ per target, so a crash on the HTML5 export and a crash on the Android export need different interpretation even if the symptom looks similar. Capturing the platform with every crash is what lets you tell a universal Lua bug from a target-specific engine or environment issue.
Capture Lua script errors
Most of your game logic in Defold is Lua, and Lua runtime errors, a nil access, a wrong type, an index error, are a primary crash source. Defold lets you capture these through its scripting error handling, so a Lua error that would otherwise just log and potentially disrupt the game can be captured with its message and the location in your script.
Capture the Lua error message and the script context, the script and function where it occurred, so you can localize the error to a specific piece of your game logic. Lua errors are readable and point at your source, making them straightforward to act on once captured. This script-level capture handles the bulk of your game-logic crashes, the ones in the code you actually wrote, across all the platforms the project ships to.
Capture engine-level crashes
Beneath your Lua scripts is the Defold engine, written in native code, and crashes can occur there too, in the engine itself, in a native extension, or in the rendering layer. These engine-level crashes do not surface as clean Lua errors, and Defold provides a crash API that captures information about native crashes, including a backtrace, which you can retrieve and report.
Use Defold crash capabilities to capture these native crashes, typically reading the crash information on the next launch after a crash took the game down, and uploading it. This complements the Lua-level capture: the Lua handling catches your script errors, and the engine crash capture catches the lower-level failures, so an engine or native-extension crash does not vanish silently. Covering both layers gives you complete crash visibility for a Defold game.
Handle the platform differences
Each Defold target has characteristic failure modes. The HTML5 export runs in a browser with its memory limits and WebGL constraints, like any web game. Mobile exports face device fragmentation and memory ceilings. Desktop exports deal with driver and platform variation. Capture the platform-appropriate context, device and OS on mobile, browser on HTML5, GPU on desktop, so each crash carries what its target requires.
This platform-specific context, combined with the platform tag, lets you diagnose target-specific crashes correctly. A crash on the HTML5 build with browser context points at a web constraint, while a mobile crash with device and memory context points at fragmentation or a memory kill. Tailoring the captured context to each platform, while tagging every crash with its target, is what makes a multi-target Defold game stability interpretable across its whole range of exports.
Setting it up with Bugnet
Bugnet captures Defold crashes at both layers, hooking the Lua error handling for script errors and using the engine crash information for native crashes, with the platform and platform-appropriate device context attached. Reports from your desktop, mobile, and HTML5 exports flow into one dashboard, tagged by platform, so you see your whole cross-platform game in one place.
Add custom fields for your game state and group identical crashes into occurrence counts. Because Defold ships one project to so many targets, the ability to filter crashes by platform is especially valuable, instantly telling you whether a crash is a universal Lua bug or a target-specific engine or environment issue, which determines how you investigate and fix it across the breadth of platforms Defold supports.
Test each export you ship
Defold makes exporting to many platforms easy, which can tempt you to ship targets you have barely tested, so test each export you ship at least briefly, because target-specific issues, an HTML5 memory limit, a mobile permission, a desktop driver quirk, often show up on the first run on that platform. A quick test per target catches the obvious problems before players hit them.
Then rely on your platform-tagged crash data for the long tail of devices, browsers, and configurations you cannot test exhaustively. Your testing catches the gross per-platform issues, and the captured crashes, tagged by target, reveal the specific failures across the range players run. For a Defold game that ships everywhere from one project, this combination of per-target testing and platform-tagged capture is what lets you confidently support the full breadth of platforms the engine makes available.
Defold ships one project everywhere. Capture both Lua and engine crashes, tagged by the target they hit.