Code Monkey home page Code Monkey logo

android-uiautomator-server's Introduction

Purpose

Android CI

UIAutomator is a great tool to perform Android UI testing, but to do it, you have to write java code, compile it, install the jar, and run. It's a complex steps for all testers...

This project is to build a light weight jsonrpc server in Android device, so that we can just write PC side script to write UIAutomator tests.

Build

  • Run command:
$ ./gradlew build
$ ./gradlew packageDebugAndroidTest
  • Run the jsonrpc server on Android device
$ ./gradlew cC
$ adb forward tcp:9008 tcp:9008 # tcp forward

If debug apk already installed, There is no need to use gradle.

simply run the following command

adb forward tcp:9008 tcp:9008
adb shell am instrument -w -r -e debug false -e class com.github.uiautomator.stub.Stub \
    com.github.uiautomator.test/androidx.test.runner.AndroidJUnitRunner

Run

$ curl -X POST -d '{"jsonrpc": "2.0", "id": "1f0f2655716023254ed2b57ba4198815", "method": "deviceInfo", "params": {}}' 'http://127.0.0.1:9008/jsonrpc/0'
{'currentPackageName': 'com.smartisanos.launcher',
 'displayHeight': 1920,
 'displayRotation': 0,
 'displaySizeDpX': 360,
 'displaySizeDpY': 640,
 'displayWidth': 1080,
 'productName': 'surabaya',
 'screenOn': True,
 'sdkInt': 23,
 'naturalOrientation': True}

The buildin input method

Fast input method

Encode the text into UTF-8 and then Base64

For example:

"Hello 你好" -> (UTF-8 && Base64) = SGVsbG8g5L2g5aW9

Send to FastInputIME with broadcast

# Append text to input field
$ adb shell am broadcast -a ADB_INPUT_TEXT --es text SGVsbG8g5L2g5aW9

# Clear text
$ adb shell am broadcast -a ADB_CLEAR_TEXT

# Clear text before append text
$ adb shell am broadcast -a ADB_SET_TEXT --es text SGVsbG8g5L2g5aW9

# Send keycode, eg: ENTER
$ adb shell am broadcast -a ADB_INPUT_KEYCODE --ei code 66

# Send Editor code
$ adb shell am broadcast -a ADB_EDITOR_CODE --ei code 2 # IME_ACTION_GO

# Get clipboard (without data)
$ adb shell am broadcast -a ADB_GET_CLIPBOARD
Broadcasting: Intent { act=ADB_GET_CLIPBOARD flg=0x400000 }
Broadcast completed: result=0

# Get clipboard (with data, base64 encoded)
$ adb shell am broadcast -a ADB_GET_CLIPBOARD
Broadcasting: Intent { act=ADB_GET_CLIPBOARD flg=0x400000 }
Broadcast completed: result=-1, data="5LqG6Kej5Lyg57uf5paH5YyW"

Change GPS mock location

You can change mock location from terminal using adb in order to test GPS on real devices.

adb [-s <specific device>] shell am broadcast -a send.mock [-e lat <latitude>] [-e lon <longitude>]
        [-e alt <altitude>] [-e accurate <accurate>]

For example:

adb  shell am broadcast -a send.mock -e lat 15.3 -e lon 99

Show toast

adb shell am start -n com.github.uiautomator/.ToastActivity -e message hello

Float window

adb shell am start -n com.github.uiautomator/.ToastActivity -e showFloatWindow true # show
adb shell am start -n com.github.uiautomator/.ToastActivity -e showFloatWindow false # hide

How to use with Python

import uiautomator2 as u2

d = u2.connect()

d.screen.on()
d(text="Settings").click()
d(scrollable=True).scroll.vert.forward()

Refer to python wrapper library uiautomator.

How to generate changelog

conventional-changelog

npm install -g conventional-changelog-cli
conventional-changelog -p grunt -i CHANGELOG.md -s -r 0

Notes

If you have any idea, please email [email protected] or submit tickets.

Dependencies

Added features

  • support unicode input

Resources

Clipboard, Thanks to @fplust

Thanks to

android-uiautomator-server's People

Contributors

atomtong avatar codeskyblue avatar danuid avatar diaojunxian avatar fplust avatar kenansheng avatar mingyuan-xia avatar nathankun avatar pengchenglin avatar xiaocong avatar xiscoxu avatar yaming116 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-uiautomator-server's Issues

com.easetest.recorder_1.3.apk 几个小问题

在录屏已经开始的情况下

  1. 用d.session()启动,会中断当前的录屏,并且生成错误格式的mp4文件(该文件无法打开,使用FFMPEG压缩抛出格式错误异常:moov atom not found)
  2. 用d.app_start()启动,会打开录屏APP,但是界面处于START RECOREDER状态,而不是STOP(没有正确加载APP启动状态)

另外录屏正常启停的情况下,生成的MP4文件概率性(大约10%-20%)格式错误,无法打开,压缩同样抛出格式错误异常:moov atom not found

机型:荣耀8A、荣耀8C 安卓版本:Android 9

Do not suppress accessibility services

In newer uiautomator versions 2.1.2 onwards there is a new option which allow not to suppress accessibility services. Currently when this json prc server is running on device we cant execute any uiautomator command using adb e.g we cant run
adb shell uiautomator dump
If we use the following flag we might use the existing accessibility services without killing them
//FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES
this.uiAutomation = InstrumentationRegistry.getInstrumentation().getUiAutomation(UiAutomation.FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES);

如果selector 同时传入checked 和checkable 参数, 会报错Checkable selector is already defined

猜测原因:src/androidTest/java/com/github/uiautomator/stub/Selector.java: 157 ~ 166

    public BySelector toBySelector() {
        BySelector s = null;
        if ((getMask() & Selector.MASK_CHECKABLE) > 0 && android.os.Build.VERSION.SDK_INT >= 18)
            s = By.checkable(this.isCheckable());
        if ((getMask() & Selector.MASK_CHECKED) > 0) {
            if (s == null)
                s = By.checked(isChecked());
            else
                s = s.checkable(isChecked());   // 猜测是行的函数调用错了?应该是s.checked?
        }

java.lang.NoSuchMethodException: android.os.Process.setArgV0(java.lang.String)

java.lang.NoSuchMethodException: android.os.Process.setArgV0(java.lang.String)
	at java.lang.Class.getMethod(Class.java:1786)
	at com.github.uiautomator.ScreenClient.setArgV0(ScreenClient.java:37)
	at com.github.uiautomator.ScreenClient.main(ScreenClient.java:16)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)
java.lang.ClassNotFoundException: android.view.SurfaceControl
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.github.uiautomator.ScreenHttpServer.initialize(ScreenHttpServer.java:49)
	at com.github.uiautomator.ScreenClient.main(ScreenClient.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)

when run ScreenClient main

change longClick duration

Any way to change longClick behavior do set a duration for it? the current value is not working for me

Run the jsonrcp server on Android device 描述有误

Run the jsonrcp server on Android device 应该改为
Run the AutomatorHttpServer on Android device,AutomatorHttpServer将部分请求转发给jsonrcp server处理。jsonrcp server实际上代理了uiautomator

app-uiautomator客户端,点击启动uiautomator时会闪退

app-uiautomator客户端,点击启动uiautomator时,会提示启动成功,但过两三秒,app就闪退。
重启app还是显示 uiautomator stopped。

说明:
1、用release 2.0.4的打好的包,启动ua服务会闪退,但重启app显示已启动。uiautomator服务不稳定,跑一两个用例就stopped了
2、用源码debug,启动ua服务会闪退,重启app依然显示stopped
3、atx-agent用的是默认安装版本
4、经过调试,startUiautomator是执行成功的,但过两三秒app就闪退,也捕获不到异常信息;
5、以上测试机型:华为荣耀10青春版、红米6、红米6、360

UIAutomator is crashing every 10 - 15 minutes. Can you check this please?

12-12 13:14:50.280 3227 14995 I ActivityManager: Force stopping com.github.uiautomator appid=10185 user=0: from pid 26635
12-12 13:14:50.281 3227 14995 I ActivityManager: Killing 26589:com.github.uiautomator/u0a185 (adj 0): stop com.github.uiautomator,from pid 26635
12-12 13:14:50.282 3227 14995 W ActivityManager: Crash of app com.github.uiautomator running instrumentation ComponentInfo{com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner}
12-12 13:14:50.283 3227 21351 W Binder : Outgoing transactions from this process must be FLAG_ONEWAY
12-12 13:14:50.283 3227 21351 W Binder : java.lang.Throwable
12-12 13:14:50.283 3227 21351 W Binder : at android.os.BinderProxy.transact(Binder.java:744)
12-12 13:14:50.283 3227 21351 W Binder : at android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.java:160)
12-12 13:14:50.283 3227 21351 W Binder : at com.android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.java:86)
12-12 13:14:50.283 3227 3242 W ActivityManager: Error shutting down UiAutomationConnection
12-12 13:14:50.283 3227 14995 I ActivityManager: Force stopping com.github.uiautomator appid=10185 user=0: finished inst
12-12 13:14:50.283 3227 21351 I ActivityManager: Failure reporting to instrumentation watcher: comp=ComponentInfo{com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner} results=Bundle[{shortMsg=Process crashed.}]

uiautomator.NullPointerException

运行时抛出错误,复现方法不具体

相关代码

    /**
     * Check if view exists. This methods performs a waitForExists(long) with zero timeout. This basically returns immediately whether the view represented by this UiObject exists or not.
     *
     * @param obj the ui object.
     * @return true if the view represented by this UiObject does exist
     */
    @Override
    public boolean exist(Selector obj) {
        if (obj.getChildOrSibling().length == 0 && obj.toBySelector() != null)
            return device.wait(Until.hasObject(obj.toBySelector()), 0L);
        return device.findObject(obj.toUiSelector()).exists();
    }

Trace内容

uiautomator2.JsonRpcError: -32001 Jsonrpc error: <java.lang.NullPointerException> data: java.lang.NullPointerException
	at android.support.test.uiautomator.ByMatcher.findMatches(ByMatcher.java:142)
	at android.support.test.uiautomator.ByMatcher.findMatches(ByMatcher.java:111)
	at android.support.test.uiautomator.ByMatcher.findMatch(ByMatcher.java:72)
	at android.support.test.uiautomator.UiDevice.hasObject(UiDevice.java:154)
	at android.support.test.uiautomator.Until$2.apply(Until.java:55)
	at android.support.test.uiautomator.Until$2.apply(Until.java:52)
	at android.support.test.uiautomator.WaitMixin.wait(WaitMixin.java:40)
	at android.support.test.uiautomator.WaitMixin.wait(WaitMixin.java:34)
	at android.support.test.uiautomator.UiDevice.wait(UiDevice.java:187)
	at com.github.uiautomator.stub.AutomatorServiceImpl.exist(AutomatorServiceImpl.java:744)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:515)
	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.invoke(JsonRpcBasicServer.java:467)
	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleObject(JsonRpcBasicServer.java:352)
	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleJsonNodeRequest(JsonRpcBasicServer.java:283)
	at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleRequest(JsonRpcBasicServer.java:251)
	at com.github.uiautomator.stub.AutomatorHttpServer.serve(AutomatorHttpServer.java:100)
	at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244)
	at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
	at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
	at java.lang.Thread.run(Thread.java:841)

Is there a way to stop a executing action?

Hey @codeskyblue,

I have being using the lib for a while now and thanks for providing the handy lib and support!

However, I am facing a situation these days of not able to stop an exceuting a long task, something like 'scrollToEndOfTheContactList'.

The use case:

Python uiautomator sends a scrollToEnd request , then the uiautomator server sees the request and starts to execute it. But before it gets fully finished, the python uiautomator wants to stop it in order to do another request. The question is how to stop it without killing uiautomator server.

To my knowledge, I am not seeing how I could stop the executing task without killing the uiautomator and restart it. But killing it generates an exception on python uiautomator side('Uiautomation not connected' or 'GatewayError'). And this info is not enough to tell if this 'not connected' action is because I intentionally want to kill it or because it's really an exception causing by a temporary network issue.

This is important in some cases when you need to decide if you want to retry the task since it's just a temporary network issue and a retry will just fix it or you just want to let it go since you killed it yourself.

So if you know any other methods to stop an executing task without killing uiautomator server, can you share some insight?

Launch atx-agent daemon via start atx-agent button

是否可以在UI做一个打开atx-agent服务进程的按键?

  • 首先,我看到uiautomator代码启动atx-agent的代码是:atx-agent server -d
  • 然后,我不是很理解这个为什么不做到app里面,即app启动时,直接启动atx-agent服务进程,这样可以免去连接usb使用adb才能启动,真正实现无线测试。

dumpWindowHierarchy返回的XML格式错误

极少数几率会遇到以下这种问题
image
这是jsonrpc返回的json

转义之后:
image

出现逗号是其中一种情况 偶尔也会有属性值乱序的情况
就算这个界面上每次都会触发,但是重新启动服务之后在同一个界面就不会出错了

本来是想转到前端用xmlDOM来解析的 但是偶尔会出错导致无法正常使用

设备:一加6
安卓版本:9.0
ATX版本:releases里最新版

这个问题干扰了我好几天 大佬辛苦了 希望看一下

parent() method not implemented

Hey @codeskyblue
Thanks for maintaining the app! It is quite a handy tool!

I am building an app using it but stucking at missing 'd.parent()' method when trying to access the node's parent. So i want to implemente this method.

From the code of uiautomator2, the python wrapper, it is commented that it has to implement a 'parent' method in this android-uiautomator-server app.

I tried to see where the code is located. It seems it should be in stub/Selector.java.
Reading this class, I got confused by 'getChildOrSibling'.

But to be honest, I don't really know what I am doing , I was hoping to write some 'parralle' function, something like child(), but there's no such method...and I got lose...

To fiture it out, I have some questions regarding the function calling processes and I am hoping you can help me to understand them and I can start to contribute as well, if you have time :)

  1. I setted d.debug to true from python uiautomator2 and I saw the all the requests and responses. And I can see there's 'method' field. And after sending it to androiud-uiautomater-server, how does the server accept the request? Where is the server accepting point?

  2. I cloned the project to my local env and tried to build it. I followed the build session from README.md
    At the project root, I did

$ ./gradlew build
$ ./gradlew packageDebugAndroidTest

No error so far.

But running ./gradlew cC, the terminal stucked at

<============-> 95% EXECUTING [2m 53s]
> :app:connectedDebugAndroidTest

Is this normal?

And I open another terminal to run:

adb forward tcp:9008 tcp:9008 # tcp forward

and then

adb shell am broadcast -a ADB_INPUT_TEXT --es text SGVsbG8g5L2g5aW9

But the text field in my app didn't have any text inserted.

So, I am not sure if I build sucessfully or not.
Also I changed one method in Selector.java

	public String getText() {
		Log.d("should always return this text");
		return "should always return this text";
	}

So when I send a d(xx).get_text(), it should always got the given texts. However that's not what happed.
I am not sure if it's a build issue or this is just not how it

Other than these two questions, if you have any insight you want to share, please let me know.
Thanks again for your time.

Ran

travis编译带有ConstraintLayout的依赖出现错误

Checking the license for package Solver for ConstraintLayout 1.0.2 in /usr/local/android-sdk/licenses

build.gradle里面的依赖是

compile 'com.android.support.constraint:constraint-layout:1.0.2'

暂时是将该依赖去除了

有没有什么方式在atx app里运行atx-agent可执行文件

如题, 我想做一个功能,比如在atx app的界面上启动atx-agent,是否可行?

我试了一圈没有成功,提示权限问题,无法在app内运行可执行文件

另外atx界面上的「停止atx-agent」的功能并没有生效。

can set default theme to `BLACK`

https://github.com/openatx/android-uiautomator-server/blob/master/app/src/main/java/com/github/uiautomator/MainActivity.java#L73
for this line, set default theme to RED, which will result in 1.0f brightness and battery-consuming.

Can help change to BLACK?

The background is, some phones as Samsung brand, will offline in atx-server after the screen is off. The way to avoid offline is to keep the screen on all the time, but there is no such settings for Samsung phones. So alternative way is to start up the IdentifyActivity. The default setting is so battery consuming.

关于NAF Node的判定

请教一下大佬们,如何判断节点是NAF节点的?它和哪些因素有关?
我现在有两部手机,系统版本一样,微信版本一样,测试小程序时,相同的节点,一部手机节点标记为NAF,另一部手机却没有,这是什么原因呢?

adb广播使用讨论

目前项目中有一个adb静态注册的广播,目前安卓在8.0及之后的版本已经禁止了静态注册的行为,也就是说静态注册是没用的 ,所以这块需要一个调整,但是我不是很清楚这个具体在哪里使用了.

如果改为动态注册,这样才atx app不在运行的时候是没办法接收到相关的广播信息的

@codeskyblue @mingyuan-xia

一加手机会启动崩溃, 貌似是service没释放,需要在MainActivity的onDestroy()方法里面再调一下unbindService(connect)

这个工具的想法是很赞的,如果能做到不要adb 就更赞了~

09-30 15:01:08.601  7047  7047 E ActivityThread: Activity com.github.uiautomator.MainActivity has leaked ServiceConnection com.github.uiautomator.MainActivity$1@9d004a8 that was originally bound here
09-30 15:01:08.601  7047  7047 E ActivityThread: android.app.ServiceConnectionLeaked: Activity com.github.uiautomator.MainActivity has leaked ServiceConnection com.github.uiautomator.MainActivity$1@9d004a8 that was originally bound here
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:1571)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:1463)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1606)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.ContextImpl.bindService(ContextImpl.java:1558)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.content.ContextWrapper.bindService(ContextWrapper.java:685)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at com.github.uiautomator.MainActivity.onCreate(MainActivity.java:55)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.Activity.performCreate(Activity.java:7041)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.Activity.performCreate(Activity.java:7032)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1231)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.support.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:532)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2864)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2989)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1688)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.os.Handler.dispatchMessage(Handler.java:106)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.os.Looper.loop(Looper.java:164)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at android.app.ActivityThread.main(ActivityThread.java:6753)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at java.lang.reflect.Method.invoke(Native Method)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:482)
09-30 15:01:08.601  7047  7047 E ActivityThread: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
09-30 15:01:08.602  1324  9317 W ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@11787a5

INJECT_EVENTS permission

在xiaomi Note miui9平台下发生
Server error: Injecting to another application requires INJECT_EVENTS permission

atx-agent can not work

shell on summary note 8
#./atx-agent server -d
this show message:


INFO[0000] run atx-agent in background
panic: runtime error: slice bounds out of range [1:0] [recovered]
        panic: runtime error: slice bounds out of range [1:0]
goroutine 1 [running]:
encoding/json.(*encodeState).marshal.func1(0x14aaafc)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:305 +0x8c
panic(0x524520, 0x1418650)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/runtime/panic.go:679 +0x194
reflect.(*rtype).String(0x514aa0, 0x32c9ac, 0x141864c)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/reflect/type.go:763 +0xac
reflect.(*rtype).Name(0x514aa0, 0x0, 0x0)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/reflect/type.go:878 +0x28
encoding/json.typeFields(0x640568, 0x5414c0, 0x5414c0, 0x0, 0x0, 0x0)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:1133 +0x398
encoding/json.cachedTypeFields(0x640568, 0x5414c0, 0x999328, 0xe9d32000, 0x4e0f40, 0x140ee40)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:1278 +0xbc
encoding/json.newStructEncoder(0x640568, 0x5414c0, 0x4e96b8)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:674 +0x24
encoding/json.newTypeEncoder(0x640568, 0x5414c0, 0x541401, 0x4e0f40)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:425 +0x2e8
encoding/json.typeEncoder(0x640568, 0x5414c0, 0x5414c0)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:381 +0x14c
encoding/json.newPtrEncoder(0x640568, 0x540340, 0x4e96b8)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:814 +0x38
encoding/json.newTypeEncoder(0x640568, 0x540340, 0x540301, 0x4e0f40)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:433 +0x284
encoding/json.typeEncoder(0x640568, 0x540340, 0x16)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:381 +0x14c
encoding/json.valueEncoder(0x540340, 0x1477420, 0x16, 0x7)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:355 +0x48
encoding/json.(*encodeState).reflectValue(0x14b54a0, 0x540340, 0x1477420, 0x16, 0x990100)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:337 +0x2c
encoding/json.(*encodeState).marshal(0x14b54a0, 0x540340, 0x1477420, 0x100, 0x0, 0x0)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/encode.go:309 +0xe4
encoding/json.(*Encoder).Encode(0x1449bb0, 0x540340, 0x1477420, 0x3, 0x4)
        /home/travis/.gimme/versions/go1.13.linux.amd64/src/encoding/json/stream.go:202 +0x58
github.com/sevlyar/go-daemon.(*Context).parent(0x1477420, 0x141e150, 0x0, 0x0)
        /home/travis/gopath/pkg/mod/github.com/sevlyar/[email protected]/daemon_unix.go:107 +0x26c
github.com/sevlyar/go-daemon.(*Context).reborn(0x1477420, 0x0, 0x0, 0x1a4)
        /home/travis/gopath/pkg/mod/github.com/sevlyar/[email protected]/daemon_unix.go:59 +0x80
github.com/sevlyar/go-daemon.(*Context).Reborn(...)
        /home/travis/gopath/pkg/mod/github.com/sevlyar/[email protected]/daemon.go:31
main.runDaemon(0x1456a80)
        /home/travis/gopath/src/github.com/openatx/atx-agent/main.go:388 +0xa4
main.main()
        /home/travis/gopath/src/github.com/openatx/atx-agent/main.go:595 +0x14ac

run python :


D:\>python
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import uiautomator2 as u2
>>> d = u2.connect("xxxf3f037e")
>>> d.info
[W 220725 18:38:33 __init__:218] [pid:7092] atx-agent has something wrong, auto recovering
[D 220725 18:38:33 __init__:317] [pid:7092] [xxxf3f037e] device xxxf3f037e is online
[I 220725 18:38:34 init:156] uiautomator2 version: 2.16.18
[D 220725 18:38:34 init:167] Shell: ('/data/local/tmp/atx-agent', 'server', '--stop')
[D 220725 18:38:34 init:295] Real version: [0, 10, 0], Expect version: [0, 10, 0]
[D 220725 18:38:34 init:167] Shell: ('/data/local/tmp/atx-agent', 'server', '--nouia', '-d', '--addr', '127.0.0.1:7912')
[I 220725 18:38:34 init:350] Check atx-agent version
[D 220725 18:38:34 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:35 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:35 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:36 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:36 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:37 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:37 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:38 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:38 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
[D 220725 18:38:39 init:359] Forward: local:tcp:50713 -> remote:tcp:7912
Traceback (most recent call last):
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1322, in getresponse
    response.begin()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 272, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 439, in send
    resp = conn.urlopen(
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\util\retry.py", line 532, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\packages\six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 445, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\urllib3\connectionpool.py", line 440, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 1322, in getresponse
    response.begin()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\http\client.py", line 272, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 444, in info
    return self.jsonrpc.deviceInfo(http_timeout=10)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 475, in __call__
    return self.server._jsonrpc_retry_call(self.method, params,
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 482, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 508, in _jsonrpc_call
    res = self.http.post("/jsonrpc/0",
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 223, in request
    self.__client._prepare_atx_agent()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 324, in _prepare_atx_agent
    self._setup_atx_agent()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\__init__.py", line 334, in _setup_atx_agent
    _initer.setup_atx_agent()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\init.py", line 351, in setup_atx_agent
    self.check_atx_agent_version()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\retry\api.py", line 73, in retry_decorator
    return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\retry\api.py", line 33, in __retry_internal
    return f()
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\uiautomator2\init.py", line 360, in check_atx_agent_version
    version = requests.get("http://%s:%d/version" %
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\dxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

`
so, what's wrong? please help me

Fail to run am instrument command

I was trying to clone and build this repository. After building and installing successfully, I try to use am instrument command to enable uiautomator, but keep getting the follow error. Can anyone help? All setting is the same as the original in this repository.
Permission Denial: starting instrumentation ComponentInfo{com.github.uiautomator.test/androidx.test.runner.AndroidJUnitRunner} from pid=17992, uid=2000 not allowed because package com.github.uiautomator.test does not have a signature matching the target com.github.uiautomator

UIAutomator2: Atx-agent 0.9.5 Install Error: "arch['x86-64'] need to be supported, please report an issue in github"

https://enterprise.githubsupport.com/hc/en-us/requests/944955
We use UIAutomator-2 as part of our automation environment for Infotainment Validation at General Motors. The headunits of future model year vehicle lines (currently worked on) have moved to x86_64 architecture.
We are having trouble installing the ATX-agent on these unit since it is not supported currently. The error flagged is as below:
"Install atx-agent 0.9.5
arch(['x86_64']) need to be supported yet, please report an issue in github"

installError

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.