Reference to DeveloperToolsOptions
DeveloperToolsOptions.Gesture
Defines the gesture to run and connect to the Developer Tools
process.
By default: F12
.
DeveloperToolsOptions.ApplicationName
Optional application display name.
If unset, Application.Name
or entry assembly name is used.
DeveloperToolsOptions.ConnectOnStartup
Defines if the app should be connected to dev tools on startup.
By default: true
on iOS and Android, false
everywhere else.
DeveloperToolsOptions.AutoConnectFromDesignMode
Defines if design mode app should be connected to dev tools. Default is 'false'.
DeveloperToolsOptions.Runner
By default, DiagnosticsSupport
package attempts to run global avdt
.NET tool when requested, if DevTools
instance is not already running.
But it is possible to redefine this behavior by changing DeveloperToolsOptions.Runner
value:
this.AttachDeveloperTools(o =>
{
o.Runner = DeveloperToolsOptions.DotNetTool;
});
Possible options are:
DeveloperToolsOptions.DotNetTool
- global .NET tool.DeveloperToolsOptions.AppleBundle
- runs macOS bundle by its ID. To make it work, you need to runDeveloper Tools
process directly at least once.DeveloperToolsOptions.NoOp
- do nothing. This option assumes theDeveloper Tools
application was started by the user manually.DeveloperToolsRunner.CreateFromExecutable(string)
- run executable by full path. This option is not recommended, unless you prefer a custom installation of the tool.- Default:
DeveloperToolsRunner.GetDefaultForPlatform()
- returnsDotNetTool
on desktop orNoOp
on mobile/browser.
DeveloperToolsOptions.Protocol
DiagnosticsSupport
uses one of two transport protocols to communicate between the user app and Developer Tools
process: HTTP and Named Pipes.
this.AttachDeveloperTools(o =>
{
o.Protocol = DeveloperToolsProtocol.DefaultHttp;
});
Possible options are:
DeveloperToolsProtocol.DefaultHttp
- default HTTP connection on29414
port and 5 seconds connection timeout.DeveloperToolsProtocol.CreateHttp(Uri, TimeSpan)
- creates HTTP connection with provided parameters. Note: you need to reconfigureDeveloper Tools
listener port independently by following Settings page.DeveloperToolsProtocol.CreateHttp(IpAddress, int? port, TimeSpan)
- creates HTTP connection with provided parameters. When port is unset, default29414
is used.DeveloperToolsProtocol.CreateNamedPipe(string)
- creates Named Pipe connection. This option is only compatible with Desktop platforms and might be preferred if there are connectivity issues on the local machine. Named Pipe name will be automatically passed to theDeveloper Tools
instance.- Default:
DeveloperToolsProtocol.GetDefaultForPlatform()
- currently returnsDefaultHttp
on all platforms.
DeveloperToolsOptions.DiagnosticLogger
Defines sink to which all AvaloniaUI.DiagnosticsSupport
logs are written to.
By default, this option is set to AvaloniaDiagnosticLogger
, redirecting logs to Avalonia.Logger.TryGet
.
Possible options are:
DiagnosticLogger.CreateConsole(LogEntryVerbosity)
.DiagnosticLogger.CreateDebug(LogEntryVerbosity)
.- Any user implementation of
DiagnosticLogger
abstract interface.
To learn more about Developer Tools
logging, please read Reporting Issue page.
DeveloperToolsOptions.LoggerCollector
Defines a collector which listens for logs to be displayed in Developer Tools
.
By default, Developer Tools
will listen only to Avalonia logs and display them in the Logger tools.
This behavior can be redefined with options:
DeveloperToolsOptions.AddAvaloniaLoggerObservable()
- enabled by default.DeveloperToolsOptions.AddMicrosoftLoggerObservable(ILoggerFactory, LogLevel)
- allows to connect devtools as a logger provider to MicrosoftILoggerFactory
.DeveloperToolsOptions.AddLoggerObservable(ILoggerObservable)
- customILoggerObservable
interface implementation. Use this option, if you want DevTools to display your third party logs provider like Serilog.DeveloperToolsOptions.ClearLoggerObservables()
- clear all observables.