BroadcastReceiver class example

package com.example

override fun onReceive(context: Context, i: Intent) {
	val id = i.getIntExtra("id", -1)
	val code = i.getStringExtra("extra1")
	
	println("$id / $code")
}

Script

 cd Library/Android/sdk/platform-tools
 
 ./adb shell am broadcast -n 앱패키지명/com.example.클래스 --ei id 1 --es extra1 "test code"

params

// string
--es

// int
--ei

// boolean
--ez

// long
--el

//float
--ef

// URI
--eu