Send Intent to App in Emulator

后端 未结 2 1059

Is it somehow possible to send automated intents to an app inside an emulator for testing?

I have a list of all my intents and I want to test them automaticily, so is it

2条回答
  •  后悔当初
    2021-02-15 13:40

    Even more simple is the use of the am application.

    You can just run it like this from the adb shell:

    # am broadcast android.net.conn.CONNECTIVITY_CHANGE
    Broadcasting: Intent { act=android.intent.action.VIEW dat=android.net.conn.CONNECTIVITY_CHANGE }
    Broadcast completed: result=0
    # am broadcast android.intent.action.BOOT_COMPLETED
    Broadcasting: Intent { act=android.intent.action.VIEW dat=android.intent.action.BOOT_COMPLETED }
    Broadcast completed: result=0
    

提交回复
热议问题