macaca icon indicating copy to clipboard operation
macaca copied to clipboard

pm dump com.google.android.webview | grep versionName 真机无效,无法获取webview

Open neohob opened this issue 8 years ago • 14 comments

  • Macaca Version: 2.1.3

  • Macaca Doctor Logs: macaca-doctor version: 2.0.14

    Node.js checklist:

    node env: /usr/local/bin/node node version: v10.9.0

    iOS checklist:

    Xcode Command Line Tools is ready, version: 2349. xcodebuild version: 9.4.1 iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

    Android checklist:

    JAVA version is 1.8 JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home ANDROID_HOME is set to /Users/neo/Library/Android/sdk Platforms is set to /Users/neo/Library/Android/sdk/platforms/android-28 ADB tool is set to /Users/neo/Library/Android/sdk/platform-tools/adb gradle is installed, version: 4.9

    Installed driver list:

    android: 2.0.48 chrome: 1.0.7 electron: 2.0.3 ios: 2.0.34

  • Operate System:

Mac OS 10.13.6(Darwin Neos-MBP 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64 ) Android 7.1.1 (带谷歌框架的坚果Pro)

  • Programming Language:

Could not get the webview version with error Error: Command failed: /Users/xxx/Library/Android/sdk/platform-tools/adb -s 9961xxxx shell "pm dump com.google.android.webview | grep versionName"

No webview version found from adb shell!

真机就是无法获取webview,AVD虚拟出来的可以获取webview,官方的java版本的例子或者自己写的python代码都是如此,chromedirver已经和手机上的Chrome版本对应

neohob avatar Aug 24 '18 00:08 neohob

This is the translated issue:


Pm dump com.google.android.webview | grep versionName The real machine is invalid, can't get webview

  • Macaca Version:  2.1.3

  • Macaca Doctor Logs:  Macaca-doctor version: 2.0.14

  Node.js checklist:

  Node env: /usr/local/bin/node   Node version: v10.9.0

  iOS checklist:

  Xcode Command Line Tools is ready, version: 2349.   Xcodebuild version: 9.4.1   Iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy   Ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy

  Android checklist:

  JAVA version is 1.8   JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home   ANDROID_HOME is set to /Users/neo/Library/Android/sdk   Platforms is set to /Users/neo/Library/Android/sdk/platforms/android-28   ADB tool is set to /Users/neo/Library/Android/sdk/platform-tools/adb   Gradle is installed, version: 4.9

  Installed driver list:

  Android: 2.0.48   Chrome: 1.0.7   Electron: 2.0.3   Ios: 2.0.34

  • Operate System:

Mac OS 10.13.6 (Darwin Neos-MBP 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root: xnu-4570.71.2~1/RELEASE_X86_64 x86_64 ) Android 7.1.1 (Nuts Pro with Google Framework)

  • Programming Language:

Could not get the webview version with error Error: Command failed: /Users/xxx/Library/Android/sdk/platform-tools/adb -s 9961xxxx shell "pm dump com.google.android.webview | grep versionName"

No webview version found from adb shell!

The real machine is unable to get the webview, the AVD virtual can get the webview, the official java version of the example or the python code written by myself, the chromedirver has corresponded to the Chrome version on the phone.

macaca-bot avatar Aug 24 '18 00:08 macaca-bot

此问题已经解决,要装一个Android版本的webview,最好装一个要测试的内含的Chrome相对应的版本,否则Chromedriver无法匹配,可以从apkmirror上面去下载

neohob avatar Aug 24 '18 03:08 neohob

This is the translated issue comment: @neohob


This problem has been solved, to install an Android version of the webview, it is best to install a corresponding version of Chrome to be tested, otherwise Chromedriver can not match, you can download from apkmirror

macaca-bot avatar Aug 24 '18 03:08 macaca-bot

但是为什么不直接取当前app里面使用的webview版本号呢?国内那么多手机都是没有google框架的,估计没几个手机能好好的测h5混合app吧,现在又出现新的问题,很不稳定,好好坏坏,坏的时候总是提示“session not created exception\nfrom unknown error: failed to close UI debuggers”

neohob avatar Aug 24 '18 06:08 neohob

This is the translated issue comment: @neohob


But why not directly take the version of the webview used in the current app? There are no google frameworks in so many mobile phones in China. It is estimated that few mobile phones can measure the h5 hybrid app well. Now there are new problems, very unstable, good and bad. When it is bad, it always prompts "session not created." Exception\nfrom unknown error: failed to close UI debuggers”

macaca-bot avatar Aug 24 '18 06:08 macaca-bot

这个问题我继续跟踪下去,换了个小米手机,小米手机是自带系统webview的,但是macaca检测出来是61版本,微信却是53版本,这些又要卸载系统webview重新安装,但是root要能删除到system目录下的内容还是花了很大的功夫

neohob avatar Aug 31 '18 06:08 neohob

chromedriver ready with: {"sessionId":null,"status":13,"value":{"message":"unknown error: unable to discover open pages\n (Driver info: chromedriver=2.28.455517 (2c6d2707d8ea850c862f04ac066724273981e88f),platform=Mac OS X 10.13.6 x86_64)"}}

这个问题一直困扰我,不知道如何下手,这个不是chrome版本不匹配,看似是超时,但又没更多信息,这个issue作者还会不会看

neohob avatar Sep 02 '18 23:09 neohob

@neohob 应用与系统自带的版本不一致了,尝试先手工下载对应版本chromedriver到macaca-android下面存放chromedriver的路径试试。

xudafeng avatar Sep 03 '18 03:09 xudafeng

@xudafeng 不行的 你们代码里会自动排定webview版本。就算你放一个也没用,还会自动下载并且使用。 webviewVersion = yield this.adb.getWebviewVersion(); 上面是macaca-android里面的代码 需要自己修改代码才可以使用

Jeffy2012 avatar Sep 03 '18 04:09 Jeffy2012

@xudafeng 并不是对应版本不一样,请从头看这个问题,如果版本不一样会出现 chrome版本提示,这里并没有;现象像超时,重启手机才有有可能(只是有可能)恢复

neohob avatar Sep 03 '18 13:09 neohob

@Jeffy2012 说的没错,但是系统webview有的和微信的webview版本并不一致,所以要改成读取微信的webview的版本,但是还是解决不了"unknown error: unable to discover open pages"问题,这个像是链接超时,但版本是肯定绝对是符合的,因为是程序跑着跑着出错的,重启server,重起adb,重新插拔都无效,只有可能重启手机有可能有效

neohob avatar Sep 03 '18 13:09 neohob

你说说看国产的东西能不能用,技术再好也没办法用,社区烂到极点,八月份提的issue看看作者回答了什么东西,解决了什么问题

neohob avatar Oct 19 '18 12:10 neohob

建议从代码层面分析方案吧,也欢迎提有效的改进建议。

xudafeng avatar Oct 23 '18 07:10 xudafeng

This is the translated issue comment: @xudafeng


It is recommended to analyze the program from the code level, and also welcome suggestions for effective improvement.

macaca-bot avatar Oct 23 '18 07:10 macaca-bot