如何测试我的码头应用 [英] How do I test my Dock Application

查看:92
本文介绍了如何测试我的码头应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于如何测试我的码头应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆