zoukankan      html  css  js  c++  java
  • appium 问题

    adb shell pm list packages:列出所有的包名。
    adb shell dumpsys package:列出所有的安装应用的信息
    dumpsys package com.android.XXX:查看某个包的具体信息

    如何查看app的包名和Activity
    解决办法:
    a.有源码的情况,找到
    AndroidManifest.xml,找到android.intent.category.LAUNCHER关键字,就能找到需要的Activity
    包名在这里看;<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.chnMicro.MFExchange"
    一般位于XML定义的下一行,搜索“package”就能找到
    b.没有源码的情况
    链接好手机——cmd下输入adb logcat>D:log.txt——运行被测app——Ctrl+c停止,去D盘打开log文件搜索“LauncherAppInfo”就能在其后找到Activity

    from http://www.51testing.com/html/01/610901-864955.html

    A new session could not be created 看到这个错误 往上翻error

    在版本升级后问题解决,猜测是服务被重启了。

    但出现新的问题:urllib2.URLError: <urlopen error [Errno 10061] >

    解决办法:webdriver.Remote('http://localhost:4733/wd/hub', desired_caps)

    标红的地方要和appium设置里的一致

    目前代码:

    #coding:utf-8
    
    from appium import webdriver
    
    desired_caps = {}
    desired_caps['platformName'] = 'Android'
    desired_caps['platformVersion'] = '4.1.2'
    desired_caps['deviceName'] = 'YT9108NYVV'
    desired_caps['appPackage'] = 'com.android.calculator2'
    desired_caps['appActivity'] = '.Calculator'
    
    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
    
    driver.find_element_by_name("1").click()
    

      

    目前存在的问题:

     运行无反应。

    log:

    > info: [debug] Starting logcat capture
    > error: Logcat capture failed: spawn ENOENT
    > info: [debug] Stopping logcat capture

    采取操作:sdk的路径全移动到不带空格的目录下,并修改系统变量和path里面的路径。

    目前log:

    error: Android devices must be of API level 17 or higher. Please change your device to Selendroid or upgrade Android on your device.
    > info: Device API level is: 16

     解决办法:

    appium目前支持最低的api为17.

    所以只能刷机到更高一点的版本来进行适配。

  • 相关阅读:
    Note:《Microsoft Windows Workflow Foundation 入门:开发人员演练》
    泛型集合类型,赋予集合业务意义,增强集合的抽象使用
    IIS7.0 for developer
    【代码保留】成对值类(PairCollection和Pair
    《SOA中国路线图》下载
    【代码保留】Quarter类
    复合控件和事件(6)——一点优化
    全方位掌握 NSIS 的使用[转]
    HTML Entities Examples
    如何对Outlook添加右键菜单
  • 原文地址:https://www.cnblogs.com/xiaobaichuangtianxia/p/4892539.html
Copyright © 2011-2022 走看看