[GH-ISSUE #97] Press Profile crashes on Insomniac v2.0.0 #75

Closed
opened 2026-03-02 23:37:49 +03:00 by kerem · 1 comment
Owner

Originally created by @domcindor on GitHub (Aug 29, 2020).
Original GitHub issue: https://github.com/alexal1/Insomniac/issues/97

Phone: Xiaomi Mi 9T Pro
Android version: 10

I am running CMD as admin, Python 3.8.3 and upon running 'py insomniac.py --interact USERNAME' I get the following output:

Insomniac v2.0.0

[08/29 11:59:40] Connected devices via adb: 1. That's ok.
[08/29 11:59:42] Action: interact with @USERNAME

-------- START: 2020-08-29 11:59:42.623620 --------
[08/29 11:59:42] Open Instagram app
Warning: Activity not started, intent has been delivered to currently running top-most instance.
[08/29 11:59:42] Sleep for 3 seconds
[08/29 11:59:45] Press profile
[D 200829 11:59:45 init:598] kill process(ps): uiautomator
[D 200829 11:59:46 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\app-uiautomator.apk-81d5349503\app-uiautomator.apk
[D 200829 11:59:46 init:347] pm install /data/local/tmp/app-uiautomator.apk
[D 200829 11:59:46 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\app-uiautomator-test.apk-a0b8958cc1\app-uiautomator-test.apk
[D 200829 11:59:46 init:347] pm install /data/local/tmp/app-uiautomator-test.apk
[D 200829 11:59:47 init:616] uiautomator-v2 is starting ... left: 40.0s
[D 200829 11:59:48 init:616] uiautomator-v2 is starting ... left: 39.0s
[I 200829 11:59:48 init:570] restart-uiautomator since "uiautomator2.GatewayError(gateway error, time used 0.0s)"
[D 200829 11:59:48 init:598] kill process(ps): uiautomator
[D 200829 11:59:49 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\app-uiautomator.apk-81d5349503\app-uiautomator.apk
[D 200829 11:59:49 init:347] pm install /data/local/tmp/app-uiautomator.apk
[D 200829 11:59:49 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\app-uiautomator-test.apk-a0b8958cc1\app-uiautomator-test.apk
[D 200829 11:59:49 init:347] pm install /data/local/tmp/app-uiautomator-test.apk
[D 200829 11:59:49 init:652] grant permissions
[D 200829 11:59:50 init:616] uiautomator-v2 is starting ... left: 40.0s
[D 200829 11:59:51 init:616] uiautomator-v2 is starting ... left: 39.0s
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\uiautomator2_init_.py", line 441, in _jsonrpc_retry_call
return self.jsonrpc_call(*args, **kwargs)
File "C:\Python38\lib\site-packages\uiautomator2_init
.py", line 476, in _jsonrpc_call
raise GatewayError(
uiautomator2.exceptions.GatewayError: uiautomator2.GatewayError(gateway error, time used 0.0s)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "insomniac.py", line 421, in
main()
File "insomniac.py", line 93, in main
session_state.my_following_count = get_my_profile_info(device)
File "C:\Users\PC\Documents\GitHub\Insomniac\src\action_get_my_profile_info.py", line 9, in get_my_profile_info
navigate(device, Tabs.PROFILE)
File "C:\Users\PC\Documents\GitHub\Insomniac\src\navigation.py", line 16, in navigate
button.click(timeout=UI_TIMEOUT)
File "C:\Python38\lib\site-packages\uiautomator2_selector.py", line 150, in click
self.must_wait(timeout=timeout)
File "C:\Python38\lib\site-packages\uiautomator2_selector.py", line 344, in must_wait
if not self.wait(exists, timeout):
File "C:\Python38\lib\site-packages\uiautomator2_selector.py", line 314, in wait
return self.jsonrpc.waitForExists(self.selector,
File "C:\Python38\lib\site-packages\uiautomator2_init_.py", line 434, in call
return self.server.jsonrpc_retry_call(self.method, params,
File "C:\Python38\lib\site-packages\uiautomator2_init
.py", line 445, in jsonrpc_retry_call
self.reset_uiautomator(str(e)) # uiautomator可能出问题了,强制重启一下
File "C:\Python38\lib\site-packages\uiautomator2_init
.py", line 588, in reset_uiautomator
return self.reset_uiautomator(reason=reason,
File "C:\Python38\lib\site-packages\uiautomator2_init_.py", line 588, in reset_uiautomator
return self.reset_uiautomator(reason=reason,
File "C:\Python38\lib\site-packages\uiautomator2_init_.py", line 562, in reset_uiautomator
raise EnvironmentError(
OSError: [WinError adb shell am instrument -w -r -e debug false -e class com.github.uiautomator.stub.Stub com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner] uiautomator2.GatewayError(gateway error, time used 0.0s): 'https://github.com/openatx/uiautomator2/wiki/Common-issues'

'python -m uiautomator2 init' returns:

[I 200829 12:00:14 init:155] uiautomator2 version: 2.11.3.dev2
[I 200829 12:00:14 init:352] Install minicap, minitouch
[D 200829 12:00:14 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\minitouch-d9b00c06bb\minitouch
[D 200829 12:00:14 init:232] Push to /data/local/tmp/minitouch:0755
[D 200829 12:00:14 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\minicap.so-1bae78be21\minicap.so
[D 200829 12:00:14 init:232] Push to /data/local/tmp/minicap.so:0755
[D 200829 12:00:14 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\minicap-e06ae097fd\minicap
[D 200829 12:00:14 init:232] Push to /data/local/tmp/minicap:0755
[D 200829 12:00:15 init:250] apk-debug package-info: None
[D 200829 12:00:15 init:251] apk-debug-test package-info: None
[I 200829 12:00:15 init:365] Install com.github.uiautomator, com.github.uiautomator.test 2.3.1
[D 200829 12:00:15 init:162] Shell: ('pm', 'uninstall', 'com.github.uiautomator')
[D 200829 12:00:15 init:162] Shell: ('pm', 'uninstall', 'com.github.uiautomator.test')
[D 200829 12:00:15 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\app-uiautomator.apk-81d5349503\app-uiautomator.apk
[D 200829 12:00:15 init:232] Push to /data/local/tmp/app-uiautomator.apk:0644
[D 200829 12:00:15 init:162] Shell: ('pm', 'install', '-r', '-t', '/data/local/tmp/app-uiautomator.apk')
[I 200829 12:00:15 init:332] - app-uiautomator.apk installed
[D 200829 12:00:15 init:59] Use cached assets: C:\Users\PC.uiautomator2\cache\app-uiautomator-test.apk-a0b8958cc1\app-uiautomator-test.apk
[D 200829 12:00:15 init:232] Push to /data/local/tmp/app-uiautomator-test.apk:0644
[D 200829 12:00:15 init:162] Shell: ('pm', 'install', '-r', '-t', '/data/local/tmp/app-uiautomator-test.apk')
[I 200829 12:00:16 init:332] - app-uiautomator-test.apk installed
[D 200829 12:00:16 init:290] Real version: [0, 9, 5], Expect version: [0, 9, 5]
[D 200829 12:00:16 init:162] Shell: ('/data/local/tmp/atx-agent', 'server', '--nouia', '-d')
[I 200829 12:00:16 init:377] Check atx-agent version
[D 200829 12:00:16 init:390] Forward: local:tcp:57012 -> remote:tcp:7912
[D 200829 12:00:16 init:393] atx-agent version 0.9.5
Successfully init AdbDevice(serial=7bcfd6b5)

Originally created by @domcindor on GitHub (Aug 29, 2020). Original GitHub issue: https://github.com/alexal1/Insomniac/issues/97 Phone: Xiaomi Mi 9T Pro Android version: 10 I am running CMD as admin, Python 3.8.3 and upon running 'py insomniac.py --interact USERNAME' I get the following output: > Insomniac v2.0.0 > > [08/29 11:59:40] Connected devices via adb: 1. That's ok. > [08/29 11:59:42] Action: interact with @USERNAME > > -------- START: 2020-08-29 11:59:42.623620 -------- > [08/29 11:59:42] Open Instagram app > Warning: Activity not started, intent has been delivered to currently running top-most instance. > [08/29 11:59:42] Sleep for 3 seconds > [08/29 11:59:45] Press profile > [D 200829 11:59:45 __init__:598] kill process(ps): uiautomator > [D 200829 11:59:46 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\app-uiautomator.apk-81d5349503\app-uiautomator.apk > [D 200829 11:59:46 __init__:347] pm install /data/local/tmp/app-uiautomator.apk > [D 200829 11:59:46 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\app-uiautomator-test.apk-a0b8958cc1\app-uiautomator-test.apk > [D 200829 11:59:46 __init__:347] pm install /data/local/tmp/app-uiautomator-test.apk > [D 200829 11:59:47 __init__:616] uiautomator-v2 is starting ... left: 40.0s > [D 200829 11:59:48 __init__:616] uiautomator-v2 is starting ... left: 39.0s > [I 200829 11:59:48 __init__:570] restart-uiautomator since "uiautomator2.GatewayError(gateway error, time used 0.0s)" > [D 200829 11:59:48 __init__:598] kill process(ps): uiautomator > [D 200829 11:59:49 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\app-uiautomator.apk-81d5349503\app-uiautomator.apk > [D 200829 11:59:49 __init__:347] pm install /data/local/tmp/app-uiautomator.apk > [D 200829 11:59:49 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\app-uiautomator-test.apk-a0b8958cc1\app-uiautomator-test.apk > [D 200829 11:59:49 __init__:347] pm install /data/local/tmp/app-uiautomator-test.apk > [D 200829 11:59:49 __init__:652] grant permissions > [D 200829 11:59:50 __init__:616] uiautomator-v2 is starting ... left: 40.0s > [D 200829 11:59:51 __init__:616] uiautomator-v2 is starting ... left: 39.0s > Traceback (most recent call last): > File "C:\Python38\lib\site-packages\uiautomator2\__init__.py", line 441, in _jsonrpc_retry_call > return self._jsonrpc_call(*args, **kwargs) > File "C:\Python38\lib\site-packages\uiautomator2\__init__.py", line 476, in _jsonrpc_call > raise GatewayError( > uiautomator2.exceptions.GatewayError: uiautomator2.GatewayError(gateway error, time used 0.0s) > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "insomniac.py", line 421, in <module> > main() > File "insomniac.py", line 93, in main > session_state.my_following_count = get_my_profile_info(device) > File "C:\Users\PC\Documents\GitHub\Insomniac\src\action_get_my_profile_info.py", line 9, in get_my_profile_info > navigate(device, Tabs.PROFILE) > File "C:\Users\PC\Documents\GitHub\Insomniac\src\navigation.py", line 16, in navigate > button.click(timeout=UI_TIMEOUT) > File "C:\Python38\lib\site-packages\uiautomator2\_selector.py", line 150, in click > self.must_wait(timeout=timeout) > File "C:\Python38\lib\site-packages\uiautomator2\_selector.py", line 344, in must_wait > if not self.wait(exists, timeout): > File "C:\Python38\lib\site-packages\uiautomator2\_selector.py", line 314, in wait > return self.jsonrpc.waitForExists(self.selector, > File "C:\Python38\lib\site-packages\uiautomator2\__init__.py", line 434, in __call__ > return self.server._jsonrpc_retry_call(self.method, params, > File "C:\Python38\lib\site-packages\uiautomator2\__init__.py", line 445, in _jsonrpc_retry_call > self.reset_uiautomator(str(e)) # uiautomator可能出问题了,强制重启一下 > File "C:\Python38\lib\site-packages\uiautomator2\__init__.py", line 588, in reset_uiautomator > return self.reset_uiautomator(reason=reason, > File "C:\Python38\lib\site-packages\uiautomator2\__init__.py", line 588, in reset_uiautomator > return self.reset_uiautomator(reason=reason, > File "C:\Python38\lib\site-packages\uiautomator2\__init__.py", line 562, in reset_uiautomator > raise EnvironmentError( > OSError: [WinError adb shell am instrument -w -r -e debug false -e class com.github.uiautomator.stub.Stub com.github.uiautomator.test/android.support.test.runner.AndroidJUnitRunner] uiautomator2.GatewayError(gateway error, time used 0.0s): 'https://github.com/openatx/uiautomator2/wiki/Common-issues' ### **'python -m uiautomator2 init' returns:** > [I 200829 12:00:14 init:155] uiautomator2 version: 2.11.3.dev2 > [I 200829 12:00:14 init:352] Install minicap, minitouch > [D 200829 12:00:14 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\minitouch-d9b00c06bb\minitouch > [D 200829 12:00:14 init:232] Push to /data/local/tmp/minitouch:0755 > [D 200829 12:00:14 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\minicap.so-1bae78be21\minicap.so > [D 200829 12:00:14 init:232] Push to /data/local/tmp/minicap.so:0755 > [D 200829 12:00:14 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\minicap-e06ae097fd\minicap > [D 200829 12:00:14 init:232] Push to /data/local/tmp/minicap:0755 > [D 200829 12:00:15 init:250] apk-debug package-info: None > [D 200829 12:00:15 init:251] apk-debug-test package-info: None > [I 200829 12:00:15 init:365] Install com.github.uiautomator, com.github.uiautomator.test 2.3.1 > [D 200829 12:00:15 init:162] Shell: ('pm', 'uninstall', 'com.github.uiautomator') > [D 200829 12:00:15 init:162] Shell: ('pm', 'uninstall', 'com.github.uiautomator.test') > [D 200829 12:00:15 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\app-uiautomator.apk-81d5349503\app-uiautomator.apk > [D 200829 12:00:15 init:232] Push to /data/local/tmp/app-uiautomator.apk:0644 > [D 200829 12:00:15 init:162] Shell: ('pm', 'install', '-r', '-t', '/data/local/tmp/app-uiautomator.apk') > [I 200829 12:00:15 init:332] - app-uiautomator.apk installed > [D 200829 12:00:15 init:59] Use cached assets: C:\Users\PC\.uiautomator2\cache\app-uiautomator-test.apk-a0b8958cc1\app-uiautomator-test.apk > [D 200829 12:00:15 init:232] Push to /data/local/tmp/app-uiautomator-test.apk:0644 > [D 200829 12:00:15 init:162] Shell: ('pm', 'install', '-r', '-t', '/data/local/tmp/app-uiautomator-test.apk') > [I 200829 12:00:16 init:332] - app-uiautomator-test.apk installed > [D 200829 12:00:16 init:290] Real version: [0, 9, 5], Expect version: [0, 9, 5] > [D 200829 12:00:16 init:162] Shell: ('/data/local/tmp/atx-agent', 'server', '--nouia', '-d') > [I 200829 12:00:16 init:377] Check atx-agent version > [D 200829 12:00:16 init:390] Forward: local:tcp:57012 -> remote:tcp:7912 > [D 200829 12:00:16 init:393] atx-agent version 0.9.5 > Successfully init AdbDevice(serial=7bcfd6b5)
kerem closed this issue 2026-03-02 23:37:49 +03:00
Author
Owner

@domcindor commented on GitHub (Aug 29, 2020):

I managed to fixed it, I had to enable Install via USB in developer opetions.

<!-- gh-comment-id:683269584 --> @domcindor commented on GitHub (Aug 29, 2020): I managed to fixed it, I had to enable **Install via USB** in developer opetions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Insomniac#75
No description provided.