How do I test my Dock Application

我是研究僧i 提交于 2019-12-02 21:21:53

The adb command above is almost correct. you need to use --ei and not -ei. the full command I use to simulate docked to car is:

am broadcast -a android.intent.action.DOCK_EVENT --ei android.intent.extra.DOCK_STATE 2

execute this command from the adb console and that should do it (no permission issues since adb runs in root context)

Only thing missing it that this is supposed to be a sticky broadcast and I don't think there is any way setting it as sticky using adb.

It works by magnet so if you have place a strong enough magnet near the back of the device it will think its on a dock. I don't think that will hurt anything in the device either.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!