• 还在招,中学业务。

  • #4楼 @lihuazhang 请问你遇到过这样的问题么,之前看过你一个帖子:http://testerhome.com/topics/153。里面提到了海信的手机无法识别,跟这个有关么?
    我的测试机是三星的,在配置文件里面也加上了id,还是不行

  • 相当于不执行adb -s device_id 安装apk。
    好苦恼。ios没有问题

  • 我之前保存了一份完整运行的日志,这步后面应该的步骤是:
    debug: executing: "/Users/dongdaqing/Documents/AndroidDevEnv/android-sdk-macosx/platform-tools/adb" -s 0149B2EC0C01900D wait-for-device

    info: Setting device id to 0149B2EC0C01900D
    info: [ADB] Waiting for device to be ready and to respond to shell commands (timeout = 5)

    debug: executing: "/Users/dongdaqing/Documents/AndroidDevEnv/android-sdk-macosx/platform-tools/adb" -s 0149B2EC0C01900D shell "echo 'ready'"

    info: Starting logcat capture

    debug: java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/helpers/strings_from_apk.jar" "/Users/dongdaqing/Downloads/ContactManager.apk" "/tmp/com.example.android.contactmanager"

    debug: executing: "/Users/dongdaqing/Documents/AndroidDevEnv/android-sdk-macosx/platform-tools/adb" -s 0149B2EC0C01900D push "/tmp/com.example.android.contactmanager/strings.json" /data/local/tmp

    debug: Not uninstalling app since server not started with --full-reset

  • #4楼 @lihuazhang 偶然好用的情景是这样的:执行脚本的时候没连接手机,appium一直在找设备,此时连接手机,脚本顺利向下执行了。然后,反复运行脚本,都没有问题。
    可是,过了1个小时,又出现我描述的问题了,走到这步就不走了:
    info: Creating new appium session 2b7aa45a-92de-4b89-a6b3-06504d3d0293
    info: Starting android appium
    info: Preparing device for session
    info: Checking whether app is actually present
    info: Checking whether adb is present
    info: [ADB] Using adb from /Users/dongdaqing/Documents/AndroidDevEnv/android-sdk-macosx/platform-tools/adb
    info: Trying to find a connected android device
    info: [ADB] Getting connected devices...

    debug: executing: "/Users/dongdaqing/Documents/AndroidDevEnv/android-sdk-macosx/platform-tools/adb" devices

    info: [ADB] 1 device(s) connected

  • 好吧,一个偶然的机会功能恢复了。
    android手机没有连接电脑,运行脚本。会提示无法连接设备。这时再把手机连到电脑上,脚本顺利运行通过了。。。

  • 接着补充下,设备的初始化:
    PATH为apk的路径
    desired_caps = {}
    desired_caps['device'] = 'Android'
    desired_caps['browserName'] = ''
    desired_caps['version'] = '4.2.1'
    desired_caps['app'] = PATH
    desired_caps['app-package'] = 'com.example.android.contactmanager'
    desired_caps['app-activity'] = '.ContactManager'

    self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

  • 问题真的很诡异,android突然就不好用了,只执行到了找到设备,就不往下执行了。大家是否遇到过这样的问题。。。。