Table of Contents
Xamarin.Android uses a number of custom Android system properties to communicate settings to application at the run time. Each property value can be no longer than 91 characters (as per Android OS limits) and can be set from the command line using the following syntax:
$ adb shell setprop property_name property_value
To unset any of the properties, the following syntax needs to be used:
$ adb shell setprop property_name "''"
Used mostly by the IDEs to set arguments for the remote debugger connection required to attach the debugger to application running on device. Arguments must be specified as a comma-separated list without any whitespace. Known arguments:
port=PORT
Debugger port (a short integer)timeout=VALUE
Debugger session start timeout (in milliseconds)
Indicates that Mono debug session needs to be initialized. Property value doesn't matter, only its presence is checked.
Specifies a list of environment properties to set. Property is only
used in Debug builds of Xamarin.Android applications. Its value
is a list of NAME=VALUE
pairs separated with the pipe character
(|
), without any whitespace surrounding each of the pipe separators.
Contains a whitespace separated list of additional command line arguments to pass to the Mono runtime initialization function.
Enable GC logging if set to any non-empty value. Property is only used in Debug builds of Xamarin.Android applications.
Set additional parameters when starting a Xamarin.Android application
under GDB. Each argument follows the NAME:VALUE
format. Supported
arguments:
wait:TIMESTAMP
TIMESTAMP
should be the output of date +%s in the android shell. If this property is set, wait for a native debugger to attach by spinning in a loop. If the current time is later thanTIMESTAMP
+ 10s, the property is ignored.
Configure the Xamarin.Android runtime categories. By default only the
default
category is enabled, which logs a handful of messages during
application startup and operation. This property enables all the
messages logged below the info
level for any of the categories.
Value of the property is a comma-separated list of NAME[=VALUE]
categories:
assembly
Log all messages related to embedded assembly activities (lookup, typemaps, loading etc).bundle
Log all messages related to bundled app processing.debugger-log-level=LEVEL
Set the Mono soft debugger logging level.debugger
Log all messages related to setting up the Mono soft debugger.default
Enable messages that don't belong to any of the other, more specific, categories.gc
Log garbage collector messages.gref-
Enable global reference logging but without writing the logged messages to a file.gref=FILE
Enable global reference logging and write messages to the specifiedFILE
gref
Enable global reference logging and log messages to the defaultgrefs.txt
file.gref+
Enable global reference logging, writing messages toadb logcat
. Note: this will spamadb logcat
, possibly impacting app performance, and Android might not preserve all messages. This is provided as a "last ditch effort", and is not as reliable as the normalgref
orgref=
options which write to a file. Added in Xamarin.Android 12.2.lref-
Enable local reference logging but without writing the logged messages to a file.lref=FILE
Enable local reference logging and write messages to the specifiedFILE
lref
Enable local reference logging and log messages to the defaultlrefs.txt
file, unlessgref
orgref=
are also present, in which case messages will be logged to thegref
file.lref+
Enable local reference logging, writing messages toadb logcat
. Note: this will spamadb logcat
, possibly impacting app performance, and Android might not preserve all messages. This is provided as a "last ditch effort", and is not as reliable as the normallref
orlref=
options which write to a file. Added in Xamarin.Android 12.2.mono_log_level=LEVEL
Set Mono runtime log level. The default value iserror
to log only errors, unlessgc
orassembly
log categories are enabled, in which case the default value for this property isinfo
.mono_log_mask=MASK
Set Mono runtime log mask. Value of this argument is a list of categories separated with:
, without any whitespace surrounding the separator. Full list of categories is available herenetlink
Enable logging of low-level Linuxnetlink
device used to enumerate network interfaces and their associated IP addresses.network
Enable logging for messages related to network activity.timing=bare
Enable logging of native code performance information, without logging method execution timing information to a file.timing
Enable logging of native code performance information, including method execution timing which is written to a file namedmethods.txt
.timing=bare
should be used in preference to this category.
If set, override the number of maximum global references. The number
defaults to 2000
if the application is running in an emulator and
51200
otherwise.
In "legacy" Xamarin.Android applications (that is not NET6+ ones), value of this property specifies argument to the Mono logging profiler.
In NET6+ applications, the only accepted value is [aot:]PORTS
where
PORTS
becomes value of the DOTNET_DiagnosticPorts
environment
variable used by the NET6+ profiling infrastructure to configure the
client/server ports.
Additional arguments passed to the Mono's mono_jit_parse_options
function.
If set to 0
, disable Mono debugger's soft breakpoints. By default
breakpoints are enabled.
Set Mono JIT trace options, passed to the Mono's
mono_jit_set_trace_options
function.
Configures use of Java (value java
) or JNI (value jni
) weak
references.