Are asserts available on Android? I have:
assert(null);
It does nothing and I am in the debug mode.
Yes, they are available.
They are disabled in emulator by default. You will need to add -shell -prop debug.assert=1
command line parameters to Additional Emulator Command Line Options at the run configuration you're using to run your app.
The other thing you should be aware of is that your application installed on a device will not take into account assertions - they will be ignored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With