Is there any way how to build UiAutomator (https://android.googlesource.com/platform/frameworks/testing/+/jb-mr2-release/uiautomator/cmds/uiautomator/) module? UiAutomator has command called dump, which you can execute on device / emulator shell by calling uiautomator dump
and this will generate a xml file with UI hierarchy. But what a problem is that if special character came into play (visible on screen) likey smileys which Im guessing are UTF-16 chars the xml generator behind the UIAutomator fails (this is actually known issue) with exception of IllegalCharacter
Im not really experienced in java programming, but I'm guessing I should be able to update java code to avoid this issue. But the problem is Im not really able to compile this module into jar file.
Can anyone help me with this?
答案 0 :(得分:3)
是的,您可能需要签出AOSP项目并构建此特定模块。方法如下:
现在,诀窍是将UiAutomator构建为框架(AOSP)模块。为此,请运行:
make uiautomator
确保设置环境变量(source build / envsetup.sh)并预先选择目标和组合(午餐)。
NB:每个AOSP模块都包含一个Android.mk makefile,其中指定了模块名称。在你的例子中,我只是看看Android.mk并发现了这个:
LOCAL_MODULE := uiautomator