Title: How do I run a command against the Android emulator?
Tags: java;android;android-emulator;assert
Question: 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!
Comment: I didn't realize you couldn't find where adb was located on your machine. No, I thought you expected the command to be different on a Mac... which it isn't, hence the question.

Comment: @JohnGiotta Same as what? Maybe it would help if I framed this as a newbie question. When I hear "run command x against y", I simply don't know what that means.

Here is the accepted answer: So my question is, how do I run a command against the emulator
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-tools to your PATH, where $ANDROID_SDK is wherever you have unZIPped the SDK on your machine.
Comment for this answer: Thanks, @CommonsWare. I had to look up [how to add a directory to the PATH variable for mac](http://keito.me/tutorials/macosx_path) (that's how green I am). But after following your suggestions, I am able to get assertion errors!

Here is another answer: First at all is necessary know the devices connected:
adb devices
And then select the desired device name and type:
adb -s <device-name&gt; shell
At this point you are connected to the device shell and could execute commands.
Regards.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2011:00:12/09/11', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><android><android-emulator><assert>', 'Title': 'How do I run a command against the Android emulator?', 'ViewCount': 315, 'id': 8451992, 'user_AboutMe': '<p>Hap is shy.</p>\n', 'user_AccountId': 430633.0, 'user_DisplayName': 'Hap', 'user_Reputation': 556.0, 'user_Views': 78.0, 'user_id': 814186.0}}