Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

执行python -muiautomator2 init 报错是什么原因? #166

Open
guanfc opened this issue Feb 2, 2018 · 6 comments
Open

执行python -muiautomator2 init 报错是什么原因? #166

guanfc opened this issue Feb 2, 2018 · 6 comments

Comments

@guanfc
Copy link

guanfc commented Feb 2, 2018

E:>python -muiautomator2 init
2018-02-02 15:00:44,652 - main.py:239 - INFO - Device(10a3b908) initialing ...
Traceback (most recent call last):
File "D:\360YP\VM\Python35\lib\runpy.py", line 184, in run_module_as_main
"main", mod_spec)
File "D:\360YP\VM\Python35\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 300, in
main()
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 296, in main
fire.Fire(MyFire)
File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 127, in Fire
component_trace = Fire(component, args, context, name)
File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 366, in Fire
component, remaining_args)
File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 542, in CallCallable
result = fn(*varargs, **kwargs)
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 242, in init
ins.install_minicap()
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 107, in install_minicap
path = cache_download(url)
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 72, in cache_download
raise Exception("status code", r.status_code)
Exception: ('status code', 404)

@codeskyblue
Copy link
Member

python -muiautomator2 init --verbose 这样看看

@guanfc
Copy link
Author

guanfc commented Feb 9, 2018

C:\Users\Administrator>adb version
Android Debug Bridge version 1.0.36
Revision 302830efc153-android

C:\Users\Administrator>python -muiautomator2 init --verbose
2018-02-09 11:37:34,261 - main.py:239 - INFO - Device(611AKBPP22HR5) initialing ...
2018-02-09 11:37:39,566 - main.py:105 - DEBUG - install minicap.so
2018-02-09 11:37:40,605 - main.py:70 - DEBUG - download from https://github.com/codeskyblue/stf-binaries/raw/master/node_modules/minicap-prebuilt/prebuilt/a
rm64-v8a/lib/android-adb server version (32) doesn't match this client (36); killing...

  • daemon started successfully *
    23/minicap.so
    Traceback (most recent call last):
    File "D:\360YP\VM\Python35\lib\runpy.py", line 184, in run_module_as_main
    "main", mod_spec)
    File "D:\360YP\VM\Python35\lib\runpy.py", line 85, in run_code
    exec(code, run_globals)
    File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
    .py", line 300, in
    main()
    File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
    .py", line 296, in main
    fire.Fire(MyFire)
    File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 127, in Fire
    component_trace = Fire(component, args, context, name)
    File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 366, in Fire
    component, remaining_args)
    File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 542, in CallCallable
    result = fn(*varargs, **kwargs)
    File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
    .py", line 242, in init
    ins.install_minicap()
    File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
    .py", line 107, in install_minicap
    path = cache_download(url)
    File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
    .py", line 72, in cache_download
    raise Exception("status code", r.status_code)
    Exception: ('status code', 404)

@codeskyblue
Copy link
Member

电脑上的adb太多了,卸载的只剩一个就好了

@guanfc
Copy link
Author

guanfc commented Feb 11, 2018

经过尝试,我都已经检查过电脑adb只有一个adb了,应该不是adb太多的原因,根据报错提示/android-adb server version (32) doesn't match this client (36),我安装了adb 1.0.32版本后就解决了上面这个报错,但是出现了新的报错如下:
C:\Users\Administrator>adb version
Android Debug Bridge version 1.0.32

C:\Users\Administrator>python -muiautomator2 init --verbose
2018-02-11 10:53:58,521 - main.py:239 - INFO - Device(611AKBPP22HR5) initialing ...
2018-02-11 10:53:58,771 - main.py:105 - DEBUG - install minicap.so
2018-02-11 10:54:01,281 - main.py:70 - DEBUG - download from https://github.com/codeskyblue/stf-binaries/raw/master/node_modules/minicap-prebuilt/prebuilt/a
rm64-v8a/lib/android-23/minicap.so
�[Kminicap.so |################################| 21.8K / 21.8K
�[?25h2018-02-11 10:54:01,423 - main.py:109 - INFO - install minicap
2018-02-11 10:54:02,971 - main.py:70 - DEBUG - download from https://github.com/codeskyblue/stf-binaries/raw/master/node_modules/minicap-prebuilt/prebuilt/a
rm64-v8a/bin/minicap
�[Kminicap |################################| 566.5K / 566.5K
�[?25h2018-02-11 10:54:04,129 - main.py:116 - INFO - install minitouch
2018-02-11 10:54:05,659 - main.py:70 - DEBUG - download from https://github.com/codeskyblue/stf-binaries/raw/master/node_modules/minitouch-prebuilt/prebuilt
/arm64-v8a/bin/minitouch
�[Kminitouch |################################| 33.8K / 33.8K
�[?25h2018-02-11 10:54:06,118 - main.py:134 - DEBUG - uninstall old apks
2018-02-11 10:54:50,723 - main.py:137 - INFO - app-uiautomator.apk(1.0.9) installing ...
2018-02-11 10:54:52,805 - main.py:70 - DEBUG - download from https://github.com/openatx/android-uiautomator-server/releases/download/1.0.9/app-uiautomator.a
pk
�[Kapp-uiautomator.apk |################################| 1.7M / 1.7M.7M
�[?25hTraceback (most recent call last):
File "D:\360YP\VM\Python35\lib\runpy.py", line 184, in run_module_as_main
"main", mod_spec)
File "D:\360YP\VM\Python35\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 300, in
main()
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 296, in main
fire.Fire(MyFire)
File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 127, in Fire
component_trace = _Fire(component, args, context, name)
File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 366, in Fire
component, remaining_args)
File "D:\360YP\VM\Python35\lib\site-packages\fire\core.py", line 542, in CallCallable
result = fn(*varargs, **kwargs)
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 244, in init
ins.install_uiautomator_apk(apk_version, reinstall)
File "D:\360YP\VM\Python35\lib\site-packages\uiautomator2_main
.py", line 144, in install_uiautomator_apk
raise EnvironmentError("package com.github.uiautomator version expect "%s" got "%s"" % (apk_version, pkg_info['version_name']))
OSError: package com.github.uiautomator version expect "1.0.9" got "None"

@codeskyblue
Copy link
Member

升级一下 uiautomator2 ,然后重试一次

@guanfc
Copy link
Author

guanfc commented Feb 12, 2018

谢谢大神,现在OK了!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants