Note:
1.Linux/Python/uiautomator will automatically install apk/stub named uiautomator/1.0 and com.github.uiautomator.test (Test on Android7.1.2)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program Name
tcp 0 0 :::9008 :::* LISTEN 10835/com.github.uia
2.Windows/Python/uiautomator will automatically install apk/stub named Test-api (Test on Android7.1.2)
3.Linux/AnroidSDK/tool/uiautomator does not install any apk/stub (Test on Android7.1.2) but Android system default has /system/bin/uiautomator
rk3399_firefly_box:/ $ which uiautomator
/system/bin/uiautomator
rk3399_firefly_box:/ $
Python script example:
>>> from uiautomator import device
>>> from uiautomator import device as d
>>> d.info
{u'displayRotation': 0, u'displaySizeDpY': 811, u'displaySizeDpX': 1442, u'screenOn': True, u'displayWidth': 1920, u'productName': u'rk3399_firefly_box', u'currentPackageName': u'com.android.music', u'sdkInt': 25, u'displayHeight': 1016, u'naturalOrientation': True}
>>> d.screen.off()
>>> d.screen.on()
>>>
### Screen orientation
>>> d.orientation = "l" ### left
>>> d.orientation = "r"
>>> d.orientation = "n" ### nature
################## Click any icon on the screen which has the icon/app named "L5"
>>> d(text="L5").click()
True
>>>
>>> d(text="L5").info
{u'contentDescription': u'L5', u'checked': False, u'clickable': True, u'scrollable': False, u'text': u'L5', u'packageName': u'com.android.launcher3', u'selected': False, u'enabled': True, u'bounds': {u'top': 469, u'left': 328, u'right': 644, u'bottom': 631}, u'className': u'android.widget.TextView', u'focusable': True, u'focused': False, u'checkable': False, u'resourceName': u'com.android.launcher3:id/icon', u'longClickable': True, u'visibleBounds': {u'top': 469, u'left': 328, u'right': 644, u'bottom': 631}, u'childCount': 0}
>>>