• 上面的issue,附上测试机型:

    1. google nexus 6 Android版本:7.1.1
    2. 魅族15 Android版本:7.1.1
    3. OPPO R17 Android版本:8.1.0
  • Hi,作者:
    我想问下这个framework.jar的作用是啥呢?为啥我push framework.jar和monkey.jar到手机后启动,然后同时抓取logcat的输出,发现系统在处理这个framework.jar时抛出了异常,这个应该没有起作用吧。下面是logcat中的输出:

    01-14 16:43:21.256 E/System  (31646): Unable to open zip file: /sdcard/framework.jar
    01-14 16:43:21.258 E/System (31646): java.util.zip.ZipException: error in opening zip file
    01-14 16:43:21.258 E/System (31646): at java.util.zip.ZipFile.open(Native Method)
    01-14 16:43:21.258 E/System (31646): at java.util.zip.ZipFile.<init>(ZipFile.java:225)
    01-14 16:43:21.258 E/System (31646): at java.util.zip.ZipFile.<init>(ZipFile.java:148)
    01-14 16:43:21.258 E/System (31646): at java.util.jar.JarFile.<init>(JarFile.java:161)
    01-14 16:43:21.258 E/System (31646): at java.util.jar.JarFile.<init>(JarFile.java:98)
    01-14 16:43:21.258 E/System (31646): at libcore.io.ClassPathURLStreamHandler.<init>(ClassPathURLStreamHandler.java:47)
    01-14 16:43:21.258 E/System (31646): at dalvik.system.DexPathList$Element.maybeInit(DexPathList.java:532)
    01-14 16:43:21.258 E/System (31646): at dalvik.system.DexPathList$Element.findResource(DexPathList.java:568)
    01-14 16:43:21.258 E/System (31646): at dalvik.system.DexPathList.findResource(DexPathList.java:440)
    01-14 16:43:21.258 E/System (31646): at dalvik.system.BaseDexClassLoader.findResource(BaseDexClassLoader.java:74)
    01-14 16:43:21.258 E/System (31646): at java.lang.ClassLoader.getResource(ClassLoader.java:793)
    01-14 16:43:21.258 E/System (31646): at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:977)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle$RBClassLoader.getResourceAsStream(ResourceBundle.java:464)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle$Control$1.run(ResourceBundle.java:2603)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle$Control$1.run(ResourceBundle.java:2589)
    01-14 16:43:21.258 E/System (31646): at java.security.AccessController.doPrivileged(AccessController.java:67)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:2587)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1438)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle.findBundle(ResourceBundle.java:1402)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle.findBundle(ResourceBundle.java:1356)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1298)
    01-14 16:43:21.258 E/System (31646): at java.util.ResourceBundle.getBundle(ResourceBundle.java:723)
    01-14 16:43:21.258 E/System (31646): at java.util.logging.Level.<init>(Level.java:223)
    01-14 16:43:21.258 E/System (31646): at java.util.logging.Level.<clinit>(Level.java:96)
    01-14 16:43:21.258 E/System (31646): at java.util.logging.Logger.<clinit>(Logger.java:177)
    01-14 16:43:21.258 E/System (31646): at java.util.logging.Logger.getLogger(Logger.java:393)
    01-14 16:43:21.258 E/System (31646): at android.icu.util.TimeZone.<clinit>(TimeZone.java:92)
    01-14 16:43:21.258 E/System (31646): at java.util.TimeZone.setDefault(TimeZone.java:712)
    01-14 16:43:21.258 E/System (31646): at com.android.internal.os.RuntimeInit.commonInit(RuntimeInit.java:132)
    01-14 16:43:21.258 E/System (31646): at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:256)
  • 算法积累 at October 26, 2018

    没用过C,只用过Python的有强迫症,去帮他改过来😁 😁 😁

  • 出现这个的原因可能很多,比如有些界面禁止截屏,或者说动态界面。建议在执行时抓取下手机的log看下是否有相应的log输出。
    分析下电脑端的代码流程,这个报错是出现在UiAutomatorHelper.java中的166行,

    调用了IDevice的实现类Device中的getScreenshot()方法,

    而其又调用了AdbHelper.java中的getFrameBuffer()方法。


    而AdbHelper.java中的getFrameBuffer()处理方式就是通过与手机端的adb server建立socket连接,读取流信息。单独从这边看不出啥问题来,所以应结合手机端 adb server是否有对应的log输出再分析具体产生的原因。

  • 建议你升级下appium的版本,我看最新版本在设置mock_location的时候对异常是有捕获的

    helpers.setMockLocationApp = async function (adb, app) {
    try {
    if (await adb.getApiLevel() < 23) {
    await adb.shell(['settings', 'put', 'secure', 'mock_location', '1']);
    } else {
    await adb.shell(['appops', 'set', app, 'android:mock_location', 'allow']);
    }
    } catch (err) {
    logger.warn(`Unable to set mock location for app '${app}': ${err.message}`);
    }
    };

    代码地址:android-helpers.js

  • 自己写个SDK指的是类似bugly的方式?

  • Android Monkey 小记 at September 04, 2018

    相互学习😀

  • 我与《C++ Primer》 at September 04, 2018

    湿人

  • 滴滴出行收费时段书写错误 at September 04, 2018

    没毛病吧 就是6-10点😀

  • 建议看下社区的这篇文章,https://testerhome.com/topics/1030