I am trying to enable assertions (the keyword, not the junit methods) in my android project.
What I’ve tried so far:
I added a command line argument, -ea, in Eclipse (Indigo) under Eclipse > Preferences > Java > Installed JREs where I edit the only JRE listed (see two images below).


That didn’t work… I assume because this applies to my default JVM, not the dalvik VM.
I found a related post that suggested running a command against the emulator or device (I am most interested in the emulator) to enable assertions. But I don’t understand what that means. The command is:
adb shell setprop debug.assert 1
So my question is, how do I run a command against the emulator (using a Mac, if that’s relevant)?
Many thanks!
Open up a Terminal window (or your preferred equivalent, like iTerm), and type in the command at the command line. If you have not done so already, you need to add
$ANDROID_SDK/platform-toolsto yourPATH, where$ANDROID_SDKis wherever you have unZIPped the SDK on your machine.