Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are asserts available on Android?

Tags:

android

Are asserts available on Android? I have:

assert(null);

It does nothing and I am in the debug mode.

like image 741
Code Poet Avatar asked Nov 17 '11 08:11

Code Poet


1 Answers

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.

Assertions in eclipse

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.

like image 51
a.ch. Avatar answered Jan 04 '23 10:01

a.ch.