{"id":15013249,"url":"https://github.com/crabnebula-dev/devtools","last_synced_at":"2025-04-13T21:35:14.486Z","repository":{"id":210737596,"uuid":"616384694","full_name":"crabnebula-dev/devtools","owner":"crabnebula-dev","description":"Inspect and Debug your Tauri applications in style 💃","archived":false,"fork":false,"pushed_at":"2025-04-11T23:35:58.000Z","size":23848,"stargazers_count":336,"open_issues_count":24,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-12T00:29:06.632Z","etag":null,"topics":["benchmark","devtools","inspector","performance-analysis","performance-metrics","profiling","solidjs","tauri"],"latest_commit_sha":null,"homepage":"https://devtools.crabnebula.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crabnebula-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-20T09:35:48.000Z","updated_at":"2025-04-11T00:26:27.000Z","dependencies_parsed_at":"2023-12-23T17:07:47.407Z","dependency_job_id":"f9627100-7dc9-48d2-b503-5ac2f5867fe7","html_url":"https://github.com/crabnebula-dev/devtools","commit_stats":{"total_commits":625,"total_committers":23,"mean_commits":27.17391304347826,"dds":0.5696,"last_synced_commit":"73d363b4319b5558056b908eff7443ad9741c28e"},"previous_names":["crabnebula-dev/devtools"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabnebula-dev%2Fdevtools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabnebula-dev%2Fdevtools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabnebula-dev%2Fdevtools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabnebula-dev%2Fdevtools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crabnebula-dev","download_url":"https://codeload.github.com/crabnebula-dev/devtools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788302,"owners_count":21161721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","devtools","inspector","performance-analysis","performance-metrics","profiling","solidjs","tauri"],"created_at":"2024-09-24T19:43:57.701Z","updated_at":"2025-04-13T21:35:14.462Z","avatar_url":"https://github.com/crabnebula-dev.png","language":"TypeScript","readme":"[![Devtools banner](/docs/gh-banner.webp)](https://devtools.crabnebula.dev)\n\n# Devtools for Tauri\n\nInspect, monitor, and understand your [Tauri](https://tauri.app) application with ease.\n\n- **Easy Integration:** With just a few lines of code, enable detailed event logging and metadata extraction for your application.\n- **Rich Insights:** Get insight into what your app is doing, Performance, Errors, Warnings, everything is available at a glance.\n- **And more:** This project is actively worked on, and we are open to hear your ideas, check out the [Upcoming Features]() issue for details.\n\n## Getting Started\n\n\u003e [!TIP]\n\u003e For the full documentation, check: [docs.crabnebula.dev/devtools](https://docs.crabnebula.dev/devtools)\n\n### Tauri v1\n\nEnsure you have [Tauri](https://tauri.app/v1/guides/getting-started/setup/) set up correctly. Then install the Rust instrumentation from crates.io:\n\n```sh\ncargo add devtools\n```\n\nYou also have to use Tauri **1.5.4** (or later) so your `Cargo.toml` file should look as follows::\n\n```toml\n[dependencies]\ntauri = \"1.5.4\"\ndevtools = \"0.3.0\"\n[build-dependencies]\ntauri-build = \"1.5.0\"\n```\n\nThe primary export of the devtools crate is a Tauri Plugin that interfaces with the system, therefore you will need to initialize and register the plugin with Tauri itself before you can use the DevTools. To do that, edit your main.rs file like so:\n\n```rust\nfn run() {\n    let devtools = devtools::init(); // initialize the plugin as early as possible\n\n    tauri::Builder::default()\n        .plugin(devtools) // then register it with Tauri\n        .run(tauri::generate_context!(\"./tauri.conf.json\"))\n        .expect(\"error while running tauri application\");\n}\n```\n\n\u003e Note: You should disable devtools in production builds, as it bloats your app unnecessarily and poses a possible security risk.\n\nAnd that’s it! If you run your app now (cargo tauri dev), you will notice the following new output in your terminal:\n\n![Terminal input](docs/devtools-running.png)\n\n### Tauri v2\n\nEnsure you have [Tauri](https://v2.tauri.app/guides/create/) set up correctly. Then install the Rust instrumentation from crates.io:\n\n```sh\ncargo add tauri-plugin-devtools@2.0.0\n```\n\nYou also have to use Tauri **2.0** so your `Cargo.toml` file should look as follows:\n\n```toml\n[dependencies]\ntauri-plugin-devtools = \"2.0.0\"\ntauri = \"2.0.0\"\n[build-dependencies]\ntauri-build = \"2.0.0\"\n```\n\nThen add the following snippet to your tauri initialization code:\n\n```rust\nfn main() {\n    // This should be called as early in the execution of the app as possible\n    #[cfg(debug_assertions)] // only enable instrumentation in development builds\n    let devtools = tauri_plugin_devtools::init();\n\n    let mut builder = tauri::Builder::default();\n\n    #[cfg(debug_assertions)]\n    {\n        builder = builder.plugin(devtools);\n    }\n\n    builder\n        .run(tauri::generate_context!())\n        .expect(\"error while running tauri application\");\n}\n```\n\nAnd then run your app as usual, if everything is set up correctly devtools will print the following message:\n\n![Screenshot 2023-11-28 at 14.05.20.png](https://github.com/crabnebula-dev/devtools/blob/f9970a0daa40757256aa1b32c93d66039cbdd041/Screenshot.png)\n\nYou can click or copy \u0026 paste the link into your browser to open up the UI.\nAlternatively you can navigate to https://devtools.crabnebula.dev and connect from there.\n\n### Usage with other logging systems\n\nIf you're running the DevTools plugin next to another tracing or logging system, you will face a crash\nstating you cannot define multiple logging systems on the same process:\n\n```\nthread 'main' panicked at src/main.rs:24:10:\nerror while running tauri application: PluginInitialization(\"log\", \"attempted to set a logger after the logging system was already initialized\")\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n```\n\nAn alternative is to use tauri-plugin-devtools in debug builds (`tauri dev` and `tauri build --debug` modes)\nand use a separate logging system in production (such as `fern` or `tauri-plugin-log`) letting you persist logs or have custom functionality:\n\n```rust\nfn run() {\n    let mut builder = tauri::Builder::default();\n\n    #[cfg(debug_assertions)]\n    {\n        let devtools = tauri_plugin_devtools::init();\n        builder = builder.plugin(devtools);\n    }\n\n    #[cfg(not(debug_assertions))]\n    {\n        use tauri_plugin_log::{Builder, Target, TargetKind};\n\n        let log_plugin = Builder::default()\n            .targets([\n                Target::new(TargetKind::Stdout),\n                Target::new(TargetKind::LogDir { file_name: None }),\n                Target::new(TargetKind::Webview),\n            ])\n            .build();\n\n        builder = builder.plugin(log_plugin);\n    }\n\n    builder\n        .run(tauri::generate_context!())\n        .expect(\"error while running tauri application\");\n}\n```\n\nAnother approach is to pipe other logging system through `tauri-plugin-devtools` via the `attach_logger` function,\nwhich register the logging system to receive log records propagated by this plugin's tracing subscriber.\nThe following snippet demonstrates how to use the `attach_logger` function for compatibility between\n`tauri-plugin-devtools` and `tauri-plugin-log`:\n\n```rust\nfn run() {\n    tauri::Builder::default()\n        .setup(|app| {\n            // create the log plugin as usual, but call split() instead of build()\n            let (tauri_plugin_log, max_level, logger) = tauri_plugin_log::Builder::new().split(app.handle())?;\n\n            // on debug builds, set up the DevTools plugin and pipe the logger from tauri-plugin-log\n            #[cfg(debug_assertions)]\n            {\n                let mut devtools_builder = tauri_plugin_devtools::Builder::default();\n                devtools_builder.attach_logger(logger);\n                app.handle().plugin(devtools_builder.init())?;\n            }\n            // on release builds, only attach the logger from tauri-plugin-log\n            #[cfg(not(debug_assertions))]\n            {\n                tauri_plugin_log::attach_logger(max_level, logger);\n            }\n\n            app.handle().plugin(tauri_plugin_log)?;\n\n            Ok(())\n        })\n}\n```\n\n### Android\n\nThe Android emulator runs behind a virtual router that isolates it from the development machine network interfaces.\nTo access the WebSocket server started by the Devtools on your machine, you must set up network redirection:\n\n- Via adb:\n\n```\nadb forward tcp:3000 tcp:3000\n```\n\n- Via the emulator console:\n\n```sh\n# first emulator launches on port 5554, you might need to find out the port via `$ adb devices`\ntelnet localhost 5554\nauth \u003cinsert-auth-token-here\u003e # insert token from `$HOME/.emulator_console_auth_token`\n# redirect host connections to 3000 to emulator port 3000\nredir add tcp:3000:3000\n```\n\nFor more information, see the [official documentation](https://developer.android.com/studio/run/emulator-networking#redirection).\n\n## Features\n\n### Console\n\nThe Console tab lets you quickly and conveniently see what your app is doing.\nAny errors, warnings or other messages produced by your code, Tauri or your dependencies will show up here.\n\n### Calls\n\nCommands are at the core of your Tauri app, and the Calls tab is designed to let you debug and troubleshoot any\nissues that you might have. It will display arguments and returns for each command as well as a detailed performance\nbreakdown of exactly how much processing time your command spent on what.\n\n### Config Viewer\n\nThe Config Viewer will present you with a detailed breakdown of your Tauri configuration and in the future also include\nwarnings, tips and hints.\n\n## License\n\nThe Instrumentation (i.e. the folders `/wire` and `/devtools`) is licensed under either of [Apache License, Version 2.0](./LICENSES/Apache-2.0.md) or [MIT license](./LICENSES/MIT.md) at your option.\n\nAll other code is licensed under the [PolyForm Noncommercial License 1.0.0](./LICENSES/Polyform-Noncommercial.md).\n\n\u003e ⚠️ Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, shall be licensed as above, without any additional terms or conditions.\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrabnebula-dev%2Fdevtools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrabnebula-dev%2Fdevtools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrabnebula-dev%2Fdevtools/lists"}