• Appium学习笔记1_获取到APK安装包的Package以及Activity属性值


    我们设置DesiredCapabilities属性值得时候需要设置"appPackage"和"appActivity",如何获取到这两个值呢?

    这两个值不是随便瞎写的,需要有正确的值对应,否则就会报错。

    进入到 android-sdk-windowsuild-tools19.1.0 相关版本下面,用命令"aapt.exe dump badging LocationOfApp",然后就能查看到该安装包的相关信息,

    appPackageappActivity的相关信息,把这个信息整理出来就OK了。

    // To create an object of Desired Capabilities
    DesiredCapabilities capabilities = new DesiredCapabilities();
    
    // Name of mobile web browser to automate. It should be an empty string, as we are automation an app
    capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
    
    // Name of the OS: Android, iOS or FirefoxOS
    capabilities.setCapability("platformName", "Android");
    
    // Mobile OS version –  My device is running Android 4.4.2
    capabilities.setCapability(CapabilityType.VERSION, "4.4.2");
    
    // Device name:  – I am using Micromax A311
    capabilities.setCapability("deviceName", "Micromax A311″);
    
    // An absolute local path to the APK file
    capabilities.setCapability("app", app.getAbsolutePath());
    
    // Java package of the tested Android app
    capabilities.setCapability("appPackage", "com.taobao.taobao");
    
    // An activity name for the Android activity you want to run from your package.
    capabilities.setCapability("appActivity", "com.taobao.tao.welcome.Welcome");
    

      

  • 相关阅读:
    总结一下矩阵的基本操作
    洛谷|P4281 [AHOI2008]紧急集合 / 聚会
    CQYZ OJ|Contest 133|祖孙询问
    博客主题分享
    USACO1.1|黑色星期五Friday the Thirteenth
    USACO1.1.2|贪婪的送礼者
    POJ1664|DFS水题
    树状数组的区间查询与区间修改
    N0lP2018爆零记录
    A了一道dijkstra板子
  • 原文地址:https://www.cnblogs.com/taoSir/p/4816354.html
Copyright © 2020-2023  润新知