Simulating SMS on Android Devices when developing

后端 未结 7 1553
不知归路
不知归路 2021-02-02 00:46

Is there a way to send an SMS from te DDMS in Eclipse to my Android phone. The emulator control is disabled when I\'m running my physical phone. I can only sent a SMS to the emu

相关标签:
7条回答
  • 2021-02-02 01:20

    Indeed, it is quite easy with Android emulator to simulate an incoming sms,there are loads of tutorials for that for example: http://www.anddev.org/video-tut_-_simulating_incoming_phone_calls_-_sms_via_cmd-t135.html

    But i'm not sure that you can do that with a phone. Using the Command line is only for emulator purposes. Though you could try to find the port on which your phone is connected and use the procedure with telnet to test it.

    0 讨论(0)
  • 2021-02-02 01:23

    The following few steps should get you up into simulating an incoming sms in an Android Emulator.

    Requirements:

    1.Make sure that you have the telnet client in you PC whether it is Windows or Linux.Google around on how to install one if it is not already installed on your PC.

    Steps To Emulating an incoming sms

    (a) open you CMD prompt and Enter the command:

    telnet

    For now I am Demonstrating using Windows 7 ,so you will get

    Welcome to Microsoft Telnet Client

    Escape Character is 'CTRL+]'

    Microsoft Telnet>

    (b)Assuming that your Emulator is already started.And while still on the CMD,type:

     o localhost 5554
    

    this should open a connection to the emulator.

    (c)To Emulate an incoming sms from a number say 0123456 type:

    sms send 0123456 Your Message
    

    You should be able to get the message in your android emulator inbox.Thats all Folks.

    0 讨论(0)
  • 2021-02-02 01:23

    Use some free SMS sending website to get the Intent of android.provider.Telephony.SMS_RECEIVED. means send a SMS to your mobile number using free sms service.

    0 讨论(0)
  • 2021-02-02 01:32

    telnet localhost 5554

    sms send +905xxxxxxxxx "Type your message here, between quotes"

    0 讨论(0)
  • 2021-02-02 01:34

    I am not sure about what versions of android or adb support this you can try

    adb emu sms send [from] [message]
    

    so for example

    adb emu sms send "+1555....." "Your message goes here....."
    

    Hope this helps.

    PS: I think this only works with emulators.

    0 讨论(0)
  • 2021-02-02 01:41

    Yeah it doesn't seem like it is possible. With the emulator you can do:

    telnet localhost 5554
    sms send +12345 A quick brown fox.
    

    But if you try it with a real phone (well I tried a Galaxy S2) it just closes the connection. Of course it's always possible Samsung screwed up the code somewhere, but as common as that is, I think in this case the functionality is probably disabled for non-debug ROM builds.

    0 讨论(0)
提交回复
热议问题