CrabNebula DevTools
CrabNebula 作为与 Tauri 项目合作的一部分,为 Tauri 提供免费的 DevTools 应用。此应用允许你通过捕获其嵌入资源、Tauri 配置文件、日志和跨度并提供 Web 前端来无缝地实时可视化数据,从而对你的 Tauri 应用进行检测。
¥CrabNebula provides a free DevTools application for Tauri as part of its partnership with the Tauri project. This application allows you to instrument your Tauri app by capturing its embedded assets, Tauri configuration file, logs and spans and providing a web frontend to seamlessly visualize data in real time.
使用 CrabNebula DevTools,你可以检查应用的日志事件(包括来自依赖的日志),跟踪命令调用的性能和整体 Tauri API 使用情况,并为 Tauri 事件和命令提供特殊界面,包括有效负载、响应和内部日志以及执行跨度。
¥With the CrabNebula DevTools you can inspect your app’s log events (including logs from dependencies), track down the performance of your command calls and overall Tauri API usage, with a special interface for Tauri events and commands, including payload, responses and inner logs and execution spans.
要启用 CrabNebula DevTools,请安装 devtools crate:
¥To enable the CrabNebula DevTools, install the devtools crate:
cargo add tauri-plugin-devtools@2.0.0
并尽快在你的主要功能中初始化插件:
¥And initialize the plugin as soon as possible in your main function:
fn main() { // This should be called as early in the execution of the app as possible #[cfg(debug_assertions)] // only enable instrumentation in development builds let devtools = tauri_plugin_devtools::init();
let mut builder = tauri::Builder::default();
#[cfg(debug_assertions)] { builder = builder.plugin(devtools); }
builder .run(tauri::generate_context!()) .expect("error while running tauri application");}
然后照常运行你的应用,如果一切设置正确,devtools 将打印以下消息:
¥And then run your app as usual, if everything is set up correctly devtools will print the following message:

:::note 注意
在这种情况下,我们只初始化 devtools 插件以进行调试应用,这是推荐的。
¥In this case we only initialize the devtools plugin for debug applications, which is recommended.
:::
有关更多信息,请参阅 CrabNebula DevTools 文档。
¥For more information, see the CrabNebula DevTools documentation.
Tauri 中文网 - 粤ICP备13048890号