Monday, January 17, 2011

How to run multiple instances of Android emulator to SMS?

Today, I wanted to run two instances of emulator to simulate sending and receiving SMS messages.

This is how i managed to make it work.

To create the 2nd instance you need to,

1. Need to create a separate virtual device on Android SDK and AVD Manager.
1.1 Open Eclips -> Window -> Android SDK and AVD Manager

2. Select virtual devices from left panel, Click on New button.

3. Set the name Eg. androidavd2

4. Set the Target Android 2.3 API Level 9 or any other you prefer.

5. Click on ok.

ok, now we have a Android Virtual Device created.

6. Open the Android SDK Tools folder in the command prompt.
C:\android-sdk_r08-windows\android-sdk-windows\Tools

Type:
emulator.exe -avd androidavd2

this will tell the emulator.exe to open android virtual device "androidavd2".

that's it.

Also you can use the telnet. (Windows Vista Up operating systems, you have to download telnet.exe separately because it doesn't come with the default Windows installation.)

to connect using telnet type
telnet localhost 5554

you can use the
adb devices command to see the list of devices currently running. if not You need to start the emulator first!.

then
sms send
eg:
sms send 5554 "Hello android!"

if you have any questions, please drop a line here. good luck.

7 comments:

  1. a lot of thanx.. it makes my work so easy...

    ReplyDelete
  2. thanx friend......thank you very much.....it makes my work really very easy

    ReplyDelete
  3. thanx a lot friend......DEV From India

    ReplyDelete
  4. Thank you soo much ... it really helped :)

    ReplyDelete
  5. when we run "emulator.exe -avd androidavd2" in the command prompt it only opens one emulator, how do i open another?
    I have created another device androidavd3.
    When i run "emulator.exe -avd androidavd3", it does not open another emulator, why?

    ReplyDelete
  6. @Naveen Reddy Mandadi

    Open Eclipse -> Window -> select AVD Name -> Start

    ReplyDelete