Are asserts available on Android? I have:
assert(null);
It does nothing and I am in the debug mode.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, they are available.
They are disabled in emulator by default. You will need to add
-shell -prop debug.assert=1command 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.