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.