• #13 楼 @chenhengjie123
    已在正文开头粗体标出,🌀

  • #11 楼 @laiyuncong8404
    是两个\,自己转义了。

  • #10 楼 @watman
    只连接了一台。
    刚刚我试了下,将 caps 中的 APP_PATH 用拼接方法,结果居然成功了。
    之前我试过写绝对路径,比如''c:\superapp\SuerApp9_6.apk'',不行。

    APP_PATH = File.join(File.dirname(__FILE__),'..','SuerApp9_6.apk')
    

    再次感谢您的帮助,谢谢!👍 👏

  • 根据 appium 官网介绍,chromedriver 的配置可参考https://sites.google.com/a/chromium.org/chromedriver/capabilities

  • #7 楼 @watman
    试过你给的命令,还是报错。
    appium-log 中是我贴错,因为 SplashActivity 和 MainActivity 我交替尝试过,现已更正。
    虽然问题还没有解决,但是非常感谢您。
    给个 app 地址:http://pan.baidu.com/s/1c0Gy9PY

  • #5 楼 @watman
    谢谢!
    试了以后,似乎证明启动的 Activity 就是 com.changhong.superapp.activity.SplashActivity 无误,
    但是脚本运行死活不行啊。

    c:\>aapt d badging C:\Appium_Script\SuperApp\SuerApp9_6.apk
    package: name='com.changhong.ssc.cookbook' versionCode='3' versionName='V1.0.2'
    ~~中间略过~~
    application: label='SuperApp' icon='res/drawable-mdpi/ic_launcher.png'
    launchable-activity: name='com.changhong.superapp.activity.SplashActivity'  label='SuperApp' icon=''
    
    c:\>aapt d xmltree C:\Appium_Script\SuperApp\SuerApp9_6.apk AndroidManifest.xml
        A: package="com.changhong.ssc.cookbook" (Raw: "com.changhong.ssc.cookbook")
    ~~中间略过~~
          E: activity (line=63)
            A: android:label(0x01010001)=@0x7f070000
            A: android:name(0x01010003)="com.changhong.superapp.activity.SplashActivity" (Raw: "com.changhong.superapp.activity.SplashActivity")
    ~~中间略过~~        
          E: activity (line=73)
            A: android:label(0x01010001)=@0x7f070000
            A: android:name(0x01010003)="com.changhong.superapp.activity.main.MainActivity" (Raw: "com.changhong.superapp.activity.main.MainActivity")
    ~~以下略过~~
    

    另外,我 Monkey 测试时,可以启动,
    真的有点邪门了。

    :Monkey: seed=12867 count=20000
    :AllowPackage: com.changhong.ssc.cookbook
    :IncludeCategory: android.intent.category.LAUNCHER
    :IncludeCategory: android.intent.category.MONKEY
    // Selecting main activities from category android.intent.category.LAUNCHER
    //   - NOT USING main activity com.miui.barcodescanner.activity.CaptureActivity (from package com.miui.barcodescanner)
    ~~中间略过~~       
    
    //   + Using main activity com.changhong.superapp.activity.SplashActivity (from package com.changhong.ssc.cookbook)
    // Selecting main activities from category android.intent.category.MONKEY
    
    ~~中间略过~~     
    
    :Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=com.changhong.ssc.cookbook/com.changhong.superapp.activity.SplashActivity;end
        // Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.changhong.ssc.cookbook/com.changhong.superapp.activity.SplashActivity } in package com.changhong.ssc.cookbook
    
    Sleeping for 1000 milliseconds
    :Sending Trackball (ACTION_MOVE): 0:(2.0,2.0)
    :Sending Trackball (ACTION_MOVE): 0:(-4.0,2.0)
    ~~以下略过~~
    
  • #3 楼 @watman
    什么意思?
    appActivity 和 appWaitActivity 两个交换吗?
    试过了,错误依旧:(

  • #1 楼 @eurekasaber
    谢谢你的回复。
    我也尝试过从 cmd 中直接用 adb 启动,但是报以下错误:

    C:\Users\Administrator>adb -s 274b3f06 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.SplashActivity"
    Stopping: com.chonghong.ssc.cookbook
    Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.SplashActivity }
    Error type 3
    Error: Activity class {com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.SplashActivity} does not exist.
    
    C:\Users\Administrator>adb -s 274b3f06 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.main.MainActivity"
    Stopping: com.chonghong.ssc.cookbook
    Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.main.MainActivity }
    Error type 3
    Error: Activity class {com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.main.MainActivity} does not exist.
    
    C:\Users\Administrator>adb -s 274b3f06 shell am start -a com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.SplashActivity
    Starting: Intent { act=com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.SplashActivity }
    Error: Activity not started, unable to resolve Intent { act=com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.SplashActivity flg=0x10000000 }
    
    C:\Users\Administrator>adb -s 274b3f06 shell am start -a com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.mian.MainActivity
    Starting: Intent { act=com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.mian.MainActivity }
    Error: Activity not started, unable to resolve Intent { act=com.chonghong.ssc.cookbook/com.chonghong.superapp.activity.mian.MainActivity flg=0x10000000 }
    
  • 恭喜测试小道消息成册! at 2015年09月07日

    这个必须要赞啊

  • 我在项目里遇到一个问题,就是设置后,程序跑不动了。
    部分 ruby 代码如下:

    it 'login with the work mode is STA' do
        fail_sum = pass_sum = 0
        set_STA_mode_before_login()
        login_with_password_remember(@login_username,@login_password)
     @total_num.times do
        begin
            @login_button.click
            sleep 2
            enter_wkzx_page()
            sleep 2
            if exists{id('com.iceboxcontrol:id/home')} == true #设备不在线
                fail_sum += 1
                puts "fail num is:#{fail_sum}"
            else pass_sum += 1
                puts "pass num is:#{pass_sum}"                  
            end
            enter_setting_page()
            id('com.iceboxcontrol:id/unlogin').click
            button('确定').click
            sleep 1
        ensure          
            @driver.set_network_connection (2) #(ConnectionType:Open Wifi only) 
            sleep 3
            start_activity app_package: 'com.iceboxcontrol', app_activity: 'com.iceboxcontrol.activitys.LoginActivity'
            sleep 1
        end 
     end
        puts "------------------------------"
        Fail_Rate = (fail_sum/@total_num.to_f * 100).round(2)
        Pass_Rate = (pass_sum/@total_num.to_f * 100).round(2)
        puts "Fail total number is: #{fail_sum},the Fail Rate is: #{Fail_Rate}%"
        puts "Pass total number is: #{pass_sum},the Pass Rate is: #{Pass_Rate}%"
    end
    

    实际 Appium Server 执行网络设置的 log 如下:

    info: --> POST /wd/hub/session/72a9a501-64e9-4def-a64f-9266d6aa121b/network_connection {"type":2}
    info: Setting network connection
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "settings put global airplane_mode_on 0"
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 kill-server
    error: Unhandled error: Error: read ECONNRESET
        at errnoException (net.js:905:11)
        at TCP.onread (net.js:559:19) context: [POST /wd/hub/session {"desiredCapabilities":{"app":"C:/Appium_Script/iceboxcontrol/IceBoxControl_CHiQ1U_debug.apk","
    appActivity":"com.iceboxcontrol.activitys.LoginActivity","appPackage":"com.iceboxcontrol","platformName":]
    info: [debug] UiAutomator exited
    info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 wait-for-device
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "echo 'ready'"
    info: [debug] Starting logcat capture
    info: [debug] Forwarding system:4724 to device:4724
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 forward tcp:4724 tcp:4724
    info: Starting App
    info: [debug] Attempting to kill all 'uiautomator' processes
    info: [debug] Getting all processes with 'uiautomator'
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "ps 'uiautomator'"
    info: [debug] No matching processes found
    info: [debug] Running bootstrap
    info: [debug] spawning: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.and
    roid.bootstrap.Bootstrap -e pkg com.iceboxcontrol -e disableAndroidWatchers false
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
    info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
    info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
    info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
    info: [debug] [BOOTSTRAP] [debug] Loading json...
    info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
    info: [debug] [BOOTSTRAP] [debug] json loading complete.
    info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
    info: [debug] [BOOTSTRAP] [debug] Client connected
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "am broadcast -a android.intent.action.AIRPLANE_MOD
    E --ez state false"
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0}
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 kill-server
    error: Unhandled error: Error: read ECONNRESET
        at errnoException (net.js:905:11)
        at TCP.onread (net.js:559:19) context: [POST /wd/hub/session {"desiredCapabilities":{"app":"C:/Appium_Script/iceboxcontrol/IceBoxControl_CHiQ1U_debug.apk","
    appActivity":"com.iceboxcontrol.activitys.LoginActivity","appPackage":"com.iceboxcontrol","platformName":]
    info: [debug] UiAutomator exited
    info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 wait-for-device
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "echo 'ready'"
    info: [debug] Starting logcat capture
    info: [debug] Forwarding system:4724 to device:4724
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 forward tcp:4724 tcp:4724
    info: Starting App
    info: [debug] Attempting to kill all 'uiautomator' processes
    info: [debug] Getting all processes with 'uiautomator'
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "ps 'uiautomator'"
    info: [debug] No matching processes found
    info: [debug] Running bootstrap
    info: [debug] spawning: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.and
    roid.bootstrap.Bootstrap -e pkg com.iceboxcontrol -e disableAndroidWatchers false
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
    info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
    info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
    info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
    info: [debug] [BOOTSTRAP] [debug] Loading json...
    info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
    info: [debug] [BOOTSTRAP] [debug] json loading complete.
    info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
    info: [debug] [BOOTSTRAP] [debug] Client connected
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "am start -n io.appium.settings/.Settings -e wifi o
    n -e data off"
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0}
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 kill-server
    error: Unhandled error: Error: read ECONNRESET
        at errnoException (net.js:905:11)
        at TCP.onread (net.js:559:19) context: [POST /wd/hub/session {"desiredCapabilities":{"app":"C:/Appium_Script/iceboxcontrol/IceBoxControl_CHiQ1U_debug.apk","
    appActivity":"com.iceboxcontrol.activitys.LoginActivity","appPackage":"com.iceboxcontrol","platformName":]
    info: [debug] UiAutomator exited
    info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 wait-for-device
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "echo 'ready'"
    info: [debug] Starting logcat capture
    info: [debug] Forwarding system:4724 to device:4724
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 forward tcp:4724 tcp:4724
    info: Starting App
    info: [debug] Attempting to kill all 'uiautomator' processes
    info: [debug] Getting all processes with 'uiautomator'
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "ps 'uiautomator'"
    info: [debug] No matching processes found
    info: [debug] Running bootstrap
    info: [debug] spawning: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.and
    roid.bootstrap.Bootstrap -e pkg com.iceboxcontrol -e disableAndroidWatchers false
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
    info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
    info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
    info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
    info: [debug] [BOOTSTRAP] [debug] Loading json...
    info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
    info: [debug] [BOOTSTRAP] [debug] json loading complete.
    info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
    info: [debug] [BOOTSTRAP] [debug] Client connected
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0}
    info: Getting network connection
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "settings get global airplane_mode_on"
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "settings get global wifi_on"
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "settings get global mobile_data"
    info: [debug] Responding to client with success: {"status":0,"value":6,"sessionId":"72a9a501-64e9-4def-a64f-9266d6aa121b"}
    info: <-- POST /wd/hub/session/72a9a501-64e9-4def-a64f-9266d6aa121b/network_connection 200 24747.456 ms - 73 {"status":0,"value":6,"sessionId":"72a9a501-64e9-4d
    ef-a64f-9266d6aa121b"}
    info: --> POST /wd/hub/session/72a9a501-64e9-4def-a64f-9266d6aa121b/appium/device/start_activity {"appPackage":"com.iceboxcontrol","appActivity":"com.iceboxcont
    rol.activitys.LoginActivity","appWaitPackage":"","appWaitActivity":""}
    info: [debug] Getting device API level
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "getprop ro.build.version.sdk"
    info: [debug] Device is at API Level 19
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "am start -S -n com.iceboxcontrol/com.iceboxcontrol
    .activitys.LoginActivity"
    info: [debug] Responding to client with success: {"status":0,"value":"Successfully launched the app.","sessionId":"72a9a501-64e9-4def-a64f-9266d6aa121b"}
    info: <-- POST /wd/hub/session/72a9a501-64e9-4def-a64f-9266d6aa121b/appium/device/start_activity 200 1522.236 ms - 104 {"status":0,"value":"Successfully launche
    d the app.","sessionId":"72a9a501-64e9-4def-a64f-9266d6aa121b"}
    info: --> POST /wd/hub/session/72a9a501-64e9-4def-a64f-9266d6aa121b/element/3/click {}
    info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"3"}]
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"3"}}
    info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue"
    :"Unknown error"},"sessionId":"72a9a501-64e9-4def-a64f-9266d6aa121b"}
    info: <-- POST /wd/hub/session/72a9a501-64e9-4def-a64f-9266d6aa121b/element/3/click 500 30.234 ms - 182
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: click
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"Unknown error","status":13}
    info: [debug] [BOOTSTRAP] [debug] Emitting system alert message
    info: [debug] Emitting alert message...
    info: [debug] [BOOTSTRAP] [debug] Emitting system alert message
    info: [debug] Emitting alert message...
    info: [debug] Didn't get a new command in 60 secs, shutting down...
    info: Shutting down appium session
    info: [debug] Pressing the HOME button
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "input keyevent 3"
    info: [debug] Resetting IME to 'com.iflytek.inputmethod/.FlyIME'
    info: [debug] executing cmd: E:\adt-bundle-windows-x86-20140702\sdk\platform-tools\adb.exe -s 274b3f06 shell "ime set com.iflytek.inputmethod/.FlyIME"
    info: [debug] Stopping logcat capture
    info: [debug] Logcat terminated with code null, signal SIGTERM
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
    info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
    info: [debug] [BOOTSTRAP] [debug] Closed client connection
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
    info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
    info: [debug] [UIAUTOMATOR STDOUT] Time: 67.984
    info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
    info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
    info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
    info: [debug] UiAutomator shut down normally
    info: [debug] Cleaning up android objects
    info: [debug] Cleaning up appium session
    info: [debug] We shut down because no new commands came in
    

    实际执行结果如下图:

    而如果代码中去掉下面这一行,则可以正常跑通,没搞明白为什么。

    @driver.set_network_connection (2) #(ConnectionType:Open Wifi only) 
    
  • Testerhome, 你还好吗? at 2015年08月01日

    必须得支持,顶一个!

  • 请教一下,所有测试用例共用一个 driver,在 page 页面中如何实现对该 driver 的调用及继承 Appium 已经封装好的 Android 方法呢(避免重新定义方法)?

  • 我一直以为你是男生……原来的头像用的男朋友的?

  • 你确定启动的 activity-name 正确吗?我有点怀疑。

  • #8 楼 @testly 赞,同求 Win7-32 位版本的工具,谢谢!

  • 移动测试初探-续 at 2015年04月27日

    卡斯,我也想求一份,可以吗?
    谢谢!

  • 我们一般先会收集浏览器/系统的分布数据,再根据自己用户的层次特点,制作出附图的表格进行 IE 兼容性测试覆盖.
    目前不考虑同一系统的 32-bit 和 64bit 的差异.

  • 好帖,必须顶啊.我收藏了.

  • 之前我也遇到这个问题。
    4.2.2 的系统的 api 是 17,升级到 19 后就可以使用 class_name 进行定位。