• CTS 框架解析 at 2015年01月08日

    这么赞~~~~

  • Android 测试框架整理 at 2015年01月08日

    你这边指免费或者开源的吧

  • #10 楼 @huangcheng

    ➜  Downloads  aapt dump badging ~/Downloads/ContactManager-selendroid.apk
    package: name='com.example.android.contactmanager' versionCode='1' versionName='1.0'
    sdkVersion:'5'
    targetSdkVersion:'5'
    uses-permission:'android.permission.GET_ACCOUNTS'
    uses-permission:'android.permission.READ_CONTACTS'
    uses-permission:'android.permission.WRITE_CONTACTS'
    uses-permission:'android.permission.INTERNET'
    application-label:'Contact Manager'
    application-icon-120:'res/drawable-ldpi/icon.png'
    application-icon-160:'res/drawable-mdpi/icon.png'
    application-icon-240:'res/drawable-hdpi/icon.png'
    application: label='Contact Manager' icon='res/drawable-mdpi/icon.png'
    application-debuggable
    launchable-activity: name='com.example.android.contactmanager.ContactManager'  label='Contact Manager' icon=''
    uses-permission:'android.permission.READ_CALL_LOG'
    uses-implied-permission:'android.permission.READ_CALL_LOG','targetSdkVersion < 16 and requested READ_CONTACTS'
    uses-permission:'android.permission.WRITE_CALL_LOG'
    uses-implied-permission:'android.permission.WRITE_CALL_LOG','targetSdkVersion < 16 and requested WRITE_CONTACTS'
    uses-feature:'android.hardware.touchscreen'
    uses-implied-feature:'android.hardware.touchscreen','assumed you require a touch screen unless explicitly made optional'
    main
    other-activities
    supports-screens: 'small' 'normal' 'large'
    supports-any-density: 'true'
    locales: '--_--'
    densities: '120' '160' '240'
    
    
  • Error: Could not find a device to launch. You requested 'iPhone 5s (449AC674-9FB8-431E-8617-846161A5587B) (8.1 Simulator)',

    又是一个看不懂日志的同学。这是因为你选择了 iPhone 5s (449AC674-9FB8-431E-8617-846161A5587B) 。
    然后呢, appium 的 ios.js 里面傻 x 的代码,给你加了一个 (8.1 Simulator)。 然后在你的 instruments -s device 里面返回的一个 devices 数组,一个个去匹配。 结果你返回的是没有 (8.1 Simulator) 的,所以都对不上。这些就悲剧了。所以你就来问问题了。给你看看代码:

    这个是加 (8.1 Simulator)

    var reqVersion = opts.platformVersion || opts.iOSSDKVersion;
      if (opts.iOSSDKVersion >= 8) {
        iosDeviceString += " (" + reqVersion + " Simulator)";
      }
    

    整个函数是这样的:

    IOS.getDeviceStringFromOpts = function (opts) {
      logger.debug("Getting device string from opts: " + JSON.stringify({
        forceIphone: opts.forceIphone,
        forceIpad: opts.forceIpad,
        xcodeVersion: opts.xcodeVersion,
        iOSSDKVersion: opts.iOSSDKVersion,
        deviceName: opts.deviceName,
        platformVersion: opts.platformVersion
      }));
      var isiPhone = opts.forceIphone || opts.forceIpad === null || (opts.forceIpad !== null && !opts.forceIpad);
      var isTall = isiPhone;
      var isRetina = opts.xcodeVersion[0] !== '4';
      var is64bit = false;
      var deviceName = opts.deviceName;
      var fixDevice = true;
      if (deviceName && deviceName[0] === '=') {
        return deviceName.substring(1);
      }
      logger.debug("fixDevice is " + (fixDevice ? "on" : "off"));
      if (deviceName) {
        var device = deviceName.toLowerCase();
        if (device.indexOf("iphone") !== -1) {
          isiPhone = true;
        } else if (device.indexOf("ipad") !== -1) {
          isiPhone = false;
        }
        if (deviceName !== opts.platformName) {
          isTall = isiPhone && (device.indexOf("4-inch") !== -1);
          isRetina =  (device.indexOf("retina") !== -1);
          is64bit = (device.indexOf("64-bit") !== -1);
        }
      }
    
      var iosDeviceString = isiPhone ? "iPhone" : "iPad";
      if (opts.xcodeVersion[0] === '4') {
        if (isiPhone && isRetina) {
          iosDeviceString += isTall ? " (Retina 4-inch)" : " (Retina 3.5-inch)";
        } else {
          iosDeviceString += isRetina ? " (Retina)" : "";
        }
      } else if (opts.xcodeVersion[0] === '5') {
        iosDeviceString += isRetina ? " Retina" : "";
        if (isiPhone) {
          if (isRetina && isTall) {
            iosDeviceString += is64bit ? " (4-inch 64-bit)" : " (4-inch)";
          } else if (deviceName.toLowerCase().indexOf("3.5") !== -1) {
            iosDeviceString += " (3.5-inch)";
          }
        } else {
          iosDeviceString += is64bit ? " (64-bit)" : "";
        }
      } else if (opts.xcodeVersion[0] === '6') {
        iosDeviceString = opts.deviceName ||
          (isiPhone ? "iPhone Simulator" : "iPad Simulator");
      }
      var reqVersion = opts.platformVersion || opts.iOSSDKVersion;
      if (opts.iOSSDKVersion >= 8) {
        iosDeviceString += " (" + reqVersion + " Simulator)";
      } else if (opts.iOSSDKVersion >= 7.1) {
        iosDeviceString += " - Simulator - iOS " + reqVersion;
      }
      if (fixDevice) {
        // Some device config are broken in 5.1
        var CONFIG_FIX = {
          'iPhone - Simulator - iOS 7.1': 'iPhone Retina (4-inch 64-bit) - ' +
                                          'Simulator - iOS 7.1',
          'iPad - Simulator - iOS 7.1': 'iPad Retina (64-bit) - Simulator - ' +
                                        'iOS 7.1',
          'iPad Simulator (8.0 Simulator)': 'iPad 2 (8.0 Simulator)',
          'iPad Simulator (8.1 Simulator)': 'iPad 2 (8.1 Simulator)',
          'iPad Simulator (8.2 Simulator)': 'iPad 2 (8.2 Simulator)',
          'iPad Simulator (7.1 Simulator)': 'iPad 2 (7.1 Simulator)',
          'iPhone Simulator (8.2 Simulator)': 'iPhone 6 (8.2 Simulator)',
          'iPhone Simulator (8.1 Simulator)': 'iPhone 6 (8.1 Simulator)',
          'iPhone Simulator (8.0 Simulator)': 'iPhone 6 (8.0 Simulator)',
          'iPhone Simulator (7.1 Simulator)': 'iPhone 5s (7.1 Simulator)'
        };
        if (CONFIG_FIX[iosDeviceString]) {
          var oldDeviceString = iosDeviceString;
          iosDeviceString = CONFIG_FIX[iosDeviceString];
          logger.debug("Fixing device. Changed from: \"" + oldDeviceString +
                       "\" to: \"" + iosDeviceString + "\"");
        }
      }
      logger.debug("Final device string is: '" + iosDeviceString + "'");
      return iosDeviceString;
    };
    
    

    所以,基本上你只要在 Force Device 那里扔个字符串 iPhone 就可以了。

  • #7 楼 @huangcheng 你真是一塌糊涂,头像没有头像,发帖也不遵守规矩。 你怎么做测试的啊?

  • #7 楼 @huangcheng 这个 app 的链接给我看看

  • #1 楼 @monkey 先架 dns server

  • [已解决] opensuse 运行报错 at 2015年01月07日

    JAVA_HOME 指向 jdk

  • #22 楼 @anonymity 收费的娃~

  • 再见 2014,你好 2015 at 2015年01月07日

    #12 楼 @anonymity 对的,给酒精点烟~

  • appium 能否跨进程测试 at 2015年01月07日

    #7 楼 @xingjizhao 求分享 ios 测试。

  • info: [debug] executing cmd: F:\android_sdk\platform-tools\adb.exe -s cfcc43fd shell "am instrument -e main_activity 'com.example.android.contactmanager.ContactManagerselendroid'

    确定是这个 activity 么?

  • 重复发帖是什么意思啊?

  • 自己维护分支吧。

  • 银行用这个的比较多。我知道以前有个银行的同事,他们部门采购了。

  • #5 楼 @525250478 先看看网站,别一上来就刷问题。你问的东西很多都已经有帖子了。

  • #5 楼 @525250478 github 的账号?

  • #3 楼 @525250478 新人注册的时候,没看到提示么?新人 24 小时内无法发帖。

  • #1 楼 @xie_0723 你要看看是否真的杀死了。

  • 再见 2014,你好 2015 at 2015年01月05日
  • 发帖的时候,遵守下发帖的规矩,好吧?

  • 请使用插桩模式,appium 这类的都不稳定,走 tcp 的估计都够呛。

  • 2014年 年终总结 at 2015年01月04日

    5.视野,这个词可能不太准,个人感觉就是做管理后发现很多东西考虑的角度不一样了,那天听到段总的访谈,心有感触,明确了未来的路的方向,目标 15 年做到测试总监