Is it possible to receive an SMS from Android emulator?

前端 未结 6 594
滥情空心
滥情空心 2020-12-09 11:15

I was wondering if there is a way to receive an SMS from Android emulator, perhaps on a TCP port. I know it\'s possible to send SMS to emulator by opening a TCP socket on th

相关标签:
6条回答
  • 2020-12-09 11:29

    telnet localhost <port number> didn't work for me.

    This worked for me:

    Run an emulator and click "More." That's three horizontal dots to the right of the emulator window.

    Then click "Phone".

    Type a phone number from which you'd like to receive a text and the text. Press "Send message"

    Now you see your message.


    Source: https://developer.android.com/studio/run/emulator.html#console, the table "Working with the Extended Controls, Settings, and Help," the row "Phone."

    0 讨论(0)
  • 2020-12-09 11:33

    UPDATE : follow video tutorial on this link: https://developer.android.com/studio/run/emulator.html#console

      DDMS -> Emulator Control

    It been a while, but never late to learn.

    0 讨论(0)
  • 2020-12-09 11:35

    No it is not possible.

    first you connect to your emulator via telnet with following command:

    telnet localhost <console-port>
    

    then you can query for help like this, to see all available commands for sms:

    sms help
    

    here is the list with all commands:

    available sub-commands:
    send             send inbound SMS text message
    pdu              send inbound SMS PDU
    

    finally you can go and visit android developer page for extensive information about emulator console here:

    http://developer.android.com/tools/devices/emulator.html#console

    0 讨论(0)
  • 2020-12-09 11:38

    Start two emulators, first will be 5554, second will be 5556. Send a text message using the built in messaging app from 5554 to 5556 by typing '5556' as the telephone number.

    (You will need to have created two different AVDs first, so that you can use one for 5554 and the other for 5556)

    0 讨论(0)
  • 2020-12-09 11:39

    in terminal you can use this

    adb emu sms send [from] [message]
    
    
    adb emu sms send 12345 hiiiiii
    
    0 讨论(0)
  • 2020-12-09 11:40

    Friend, refer to this answer provided in a blog (with additional info from authentication token does not match ~/.emulator_console_auth_token)

    Just connect the emulator using telnet and there we can emulate SMS. Below are the steps to emulate SMS:

    Step 1: Start the emulator (with any desired options). Open a new terminal / command shell and type :

    adb devices
    

    Note the number after emulator (emulator-5554). This is the port number.

    Step 2: Connect to the console using the telnet command:

    telnet localhost 5554 
    

    Step 3: You will then need to authenticate the session. Find the auth_token in ~/.emulator_console_auth_token and copy the text in the file. Return to the telnet console and enter:

    auth {contents_of_token_file}
    

    Step 4: After you have authenticated the shell you can emulate SMS with the command:

    sms send <phonesender> <textmessage>
    

    For More Info Refer to this link

    If you send SMS from the emulator, see this http://mobiforge.com/developing/story/sms-messaging-android

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