Reputation: 157
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?
Upvotes: 3
Views: 984
Reputation: 376
Yes it's possible you just have to checkout AOSP project and build this particular module. Here is how:
Now, the trick is to build UiAutomator as a Framework (AOSP) module. To do so, run:
make uiautomator
Be sure you set up your environment variable (source build/envsetup.sh) and select your target and combo (lunch) beforehand.
NB: each AOSP module contains an Android.mk makefile where the module name is specified. In your example, I just look at the Android.mk and found this out :
LOCAL_MODULE := uiautomator
Upvotes: 4