如何测试我的码头应用我的、码头、测试

2023-09-05 07:32:35 作者:逆流而上

我没有一个码头,但我正在写一个码头替代应用程序。 我可以模拟时钟底座不知何故? 我知道我能为汽车码头,但是这不是被告席我更换。

I don't have a Dock, but I'm writing an Dock replacement app. Can I simulate the Clock Dock somehow? I know I can for the Car Dock, but that's not the dock I'm replacing.

我可以通过亚行翻我的设备台模式不知何故? 也许喜欢的东西? ADB壳的SendEvent XXX

Can I flip my device to Desk Mode through ADB somehow? Maybe with something like? ADB shell sendevent XXX

感谢

推荐答案

以上adb命令几乎是正确的。你需要使用--ei而不是-ei。 我用于模拟停放汽车的完整的命令是:

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.