我尝试过使用此命令:adb shell am startservice com.bytel.velizy.automation/.ExchangeService -es "begin" "lol" -es "priority" "hjhjhj"
但似乎我的Android应用程序没有收到Extras"开始"和"优先"
我在服务ExchangeService中有这些行:
if(intent.hasExtra("begin") && intent.hasExtra("priority")){
Log.i("AUTOMATION_ADB" , "EXTRAS : " + intent.getStringExtra("begin") + " " + intent.getStringExtra("priority") );
}else{
Log.i("AUTOMATION_ADB" , "NOTHING" );
}
我得到了#34;什么都没有"在logcat中;
cmd命令中的我有这条消息:
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.bytel.velizy.automation/.ExchangeService launchParam=MultiScreenLaunchParams { mDisplayId=0 mBaseDisplayId=0 mFlags=0 } }
如何使用ADB为Extraservice传递额外内容?