Skip to content

Instantly share code, notes, and snippets.

@markus2610
Forked from Moddus/adb am gcm.md
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save markus2610/c7da2203040c92eadf4d to your computer and use it in GitHub Desktop.

Select an option

Save markus2610/c7da2203040c92eadf4d to your computer and use it in GitHub Desktop.

general:

am broadcast -a <Intent-Name> -n <Package>/<Receiver-Name-with-leading-dot> <Extras>

example:

am broadcast -a com.google.android.c2dm.intent.REGISTRATION -n de.example/.GCMBroadcastReceiver 
--es "registration_id" "1234"

explanation: --es define extra as string

full command:

adb shell am broadcast -a com.google.android.c2dm.intent.REGISTRATION 
-n de.example/.GCMBroadcastReceiver --es "registration_id" "1234"

testing:

uncomment android:permission="com.google.android.c2dm.permission.SEND" from your broadcast receiver configuration.

more details:

adb shell am help for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment