You can use the "am" shell command to send a broadcast.  Use "adb shell am"
to get a help summary.  Don't use it to send a BOOT_COMPLETED broadcast,
since if you are allowed to do that you will cause all kinds of chaos as
tons of stuff receives it and thinks the system has booted again.  Instead
use the -n option to send a broadcast to your specific component.

On Sat, Feb 12, 2011 at 10:20 AM, Kostya Vasilyev <kmans...@gmail.com>wrote:

> 12.02.2011 15:47, rrd пишет:
>
>  Hi,
>>
>> My application listens to a broadcast message sent by a service. I would
>> like to test, debug the activity but I do not want to wait for the time when
>> the broadcast message is actually sent by the service.
>>
>> Is there any way to send a particular broadcast message to the emulator?
>>
>
> You can fake it in your own code. Not all system broadcasts can be sent by
> applications, so you'd need something like this:
>
> <receiver ...>
> <intent-filter>
> <action name="android.intent.action.BOOT_COMPLETED"/>
> <action name="my.test.boot_completed"/>
> </intent-filter>
> </receiver>
>
> Then put a button in some activity of yours to send
> "my.test.boot_completed" broadcast.
>
> -- Kostya
>
>
>
>> rrd
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>
> --
> Kostya Vasilyev -- http://kmansoft.wordpress.com
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to