安卓自动化之appium

appium本身是一个java项目,我们使用maven来管理appium需要引入的jar包

appium服务端环境搭建

  1. jdk环境
  2. Android SDK环境,设置ANDROID_HOME环境变量,加入path。
  3. Node.js环境: https://nodejs.org/en/download/
  4. 安装appium: http://appium.io/,加入path

appium客户端环境搭建

第一步:在eclipse中创建一个maven工程
eclipse中创建的maven工程默认jre system library版本是1.5的,将其更新为1.8。
第二步:在pom.xml中添加依赖jar包

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.appium.test</groupId>
  <artifactId>appiumtest</artifactId>
  <version>V1.0</version>
  <dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.6.0</version>
    </dependency>
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>5.0.4</version>
    </dependency>       
  </dependencies>
</project>

其中通过访问http://mvnrepository.com/网站来寻找依赖包。

appium客户端驱动代码

package com.appium.driver;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

public class InitDriver {
    public static void initDriver() throws MalformedURLException{
        
        // 注意此apk是存在于服务端机器上的
        File app = new File("apps/zhihu.apk");
        
        // caps中存入的是k-v
        DesiredCapabilities caps = new DesiredCapabilities();
        // deviceName 这个参数可以随便写,但是不能没有这个参数
        caps.setCapability("deviceName", "moniqi");
        caps.setCapability("app", app.getAbsolutePath());
        
        //使用appium的输入法,支持中文并隐藏键盘
        caps.setCapability("unicodeKeyboard", true);
        // 将输入法重置回设备默认的输入法
        caps.setCapability("resetKeyboard", true);
        
        // 不重签名app
        caps.setCapability("noSign", true);
        // 设置driver超时时间
        caps.setCapability("newCommandTimeout", 120);
        
        AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(
                new URL("http://127.0.0.1:4723/wd/hub"),caps);
        /** 代码脚本和服务端是通过  http://127.0.0.1:4723/wd/hub 来进行通信的
         * 这就是服务端的接口地址。在4723端口监听服务器传送到服务器的命令。其中wd可以解释为web driver的简写
         * */
        
        /**
         * AndroidDriver和AndroidElement的关系
         * AndroidDriver继承WebDriver
         * AndroidElement继承WebElement,表示一个Android元素
         **/
    }
    
    public static void main(String[] args) {
        try {
            InitDriver.initDriver();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
}

appium关键字讲解

appium关键字信息是存入到DesiredCapabilities类中的。

DesiredCapabilities caps = new DesiredCapabilities();
  1. deviceName
# 必须项,但在Android上它的值可以随便写
caps.setCapability("deviceName", "moniqi");
  1. app
# 要安装app路径,路径必须是在服务端所在电脑上存放的apk路径
caps.setCapability("app", new File("apps/zhihu.apk").getAbsolutePath());
  1. appPackage/appActivity

与app属性冲突

# 直接启动手机上已有的app,无需重新安装。需要注释掉app
caps.setCapability("appPackage", "包名");
caps.setCapability("appActivity", "起始activity");
  1. browserName

与appPackage、appActivity、app属性冲突

# 如果做手机web自动化,配置browserName属性,同时注释掉app、appPackage、appActivity
caps.setCapability("browserName", "Browser");
  1. appWaitActivity

appium如何判断自己把应用启动成功了?答:通过当前activity与起始activity对比。但是有的app的起始activity是一闪而过的。

# 指定开启应用时需要等待的activity名称
caps.setCapability("appWaitActivity", "activity名称");
  1. deviceReadyTimeout
    appium是如何判断设备是正常响应的?答:执行adb shell "echo 'ready' 。默认5s内执行成功表明设备正常响应。
# 修改appium判断设备正常响应的超时时间
caps.setCapability("deviceReadyTimeout", 20);
  1. udid

适用场景是有多台设备连接时需要指定用哪一台设备进行测试。

# 表示指定连接某台设备。
caps.setCapability("udid", "127.0.0.1:62001");
  1. unicodeKeyboard/resetKeyboard

测试脚本输入时需要输入中文

# 使用appium的输入法,支持中文并隐藏键盘
caps.setCapability("unicodeKeyboard", true);
# 将输入法重置回设备默认的输入法
caps.setCapability("resetKeyboard", true);
  1. noSign
# 不重签名app
caps.setCapability("noSign",  true);
  1. newCommandTimeout

默认60s内一直等待客户端发送脚本到服务端。超过默认时间服务端会认为客户端退出了。

# 修改默认时间为10分钟
caps.setCapability("newCommandTimeout", 600);

总结:以上10个参数为常用的caps参数。其中这10个参数又可分为两类。一类是与appium服务器相关的Capability,一类是Android测试专有参数

# 与appium服务器相关的Capability
deviceName  
app 
browserName     
udid    
newCommandTimeout
# Android测试专有参数
noSign
unicodeKeyboard/resetKeyboard
deviceReadyTimeout  
appWaitActivity 
appPackage/appActivity

由于caps的参数过多,为防止书写错误java中封装了两个表示常量的类。与appium服务器相关的Capability用 MobileCapabilityType 类封装。Android测试专有参数用 AndroidMobileCapabilityType 类封装

appium原理

appium可以分为三部分:appium客户端脚本、appium服务端、设备。其中appium服务端作为appium客户端脚本和手机设备进行通信的中转站。
appium客户端脚本和appium服务端直接的通信是通过http://127.0.0.1:4723/wd/hub完成的。
appium服务端和手机设备通信是通过appium服务端向手机设备发送一个BootStrap.jar(存放位置:/data/local/tmp)。来完成的。此jar包通过uiautomator启动(安卓设备<4.2是通过selendriod启动),创建一个socket服务,并监听4724端口。

appium服务端启动日志分析

> Checking if an update is available
> Update not available
> Launching Appium server with command: D:\appium\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 23 --automation-name Appium --log-no-color
> info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"23","automationName":"Appium"}
> info: Console LogLevel: debug
//  caps 
> info: --> POST /wd/hub/session {"desiredCapabilities":{"app":"D:\\eclipse\\workspace0122\\appiumtest\\apps\\zhihu.apk","platformName":"Android","deviceName":"moniqi"},"requiredCapabilities":{},"capabilities":{"desiredCapabilities":{"app":"D:\\eclipse\\workspace0122\\appiumtest\\apps\\zhihu.apk","platformName":"Android","deviceName":"moniqi"},"requiredCapabilities":{},"alwaysMatch":{"platformName":"Android"},"firstMatch":[]}}
> info: Client User-Agent string: Apache-HttpClient/4.5.3 (Java/1.8.0_121)
// caps中没有写appActivity和appPackage
> info: [debug] No appActivity desired capability or server param. Parsing from apk.
> info: [debug] No appPackage desired capability or server param. Parsing from apk.
// 从apk包中去主动去解析
> info: [debug] Using local app from desired caps: D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk
// 创建一个appium的session。得到session ID
> info: [debug] Creating new appium session 41fee12e-7fc7-4adc-b6e1-0ce1ea3e1a87
> info: Starting android appium
> info: [debug] Getting Java version
> info: Java version is: 1.8.0_121
// 做adb检查、依据我们环境变量的配置
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe
> info: [debug] Parsing package and activity from app manifest
> info: [debug] Checking whether aapt is present
// 通过aapt dump badging zhihu.apk 获取包或起始activity
> info: [debug] Using aapt from D:\android_workspace\AppData\Local\Android\sdk\build-tools\25.0.2\aapt.exe
> info: [debug] Extracting package and launch activity from manifest.
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\build-tools\25.0.2\aapt.exe dump badging D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk
> info: [debug] badging package: com.zhihu.android
> info: [debug] badging act: com.zhihu.android.app.ui.activity.MainActivity
> info: [debug] Parsed package and activity are: com.zhihu.android/com.zhihu.android.app.ui.activity.MainActivity
// 进行快速重置
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Checking whether app is actually present
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: Found device 127.0.0.1:62001
// 找到设备并设置为我要操作的设备
> info: [debug] Setting device id to 127.0.0.1:62001
// 确定找到的设备是否能正常相应。执行一个shell命令来测试设备是否正常连接,超时时间为5s
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 wait-for-device
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "echo 'ready'"
// 进行日志捕获
> info: [debug] Starting logcat capture
> info: [debug] Getting device API level
// 获取手机中Android版本
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 19
> info: Device API level is: 19
> info: [debug] Extracting strings for language: default
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "getprop persist.sys.language"
> info: [debug] Current device persist.sys.language: zh
> info: [debug] java -jar "D:\appium\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk" "D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk" "C:\Users\ADMINI~1\AppData\Local\Temp\com.zhihu.android" zh
> info: [debug] Reading strings from converted strings.json
> info: [debug] Setting language to default
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 push "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\com.zhihu.android\\strings.json" /data/local/tmp
> info: [debug] Checking whether aapt is present
> info: [debug] Using aapt from D:\android_workspace\AppData\Local\Android\sdk\build-tools\25.0.2\aapt.exe
> info: [debug] Retrieving process from manifest.
// 解析 apk中AndroidManifest.xml文件
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\build-tools\25.0.2\aapt.exe dump xmltree D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk AndroidManifest.xml
> info: [debug] Set app process to: com.zhihu.android
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Checking app cert for D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk.
> info: [debug] executing cmd: java -jar D:\appium\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk
> info: [debug] App already signed.
> info: [debug] Zip-aligning D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk
> info: [debug] Checking whether zipalign is present
> info: [debug] Using zipalign from D:\android_workspace\AppData\Local\Android\sdk\build-tools\25.0.2\zipalign.exe
> info: [debug] Zip-aligning apk.
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\build-tools\25.0.2\zipalign.exe -f 4 D:\eclipse\workspace0122\appiumtest\apps\zhihu.apk C:\Users\ADMINI~1\AppData\Local\Temp\118022-4144-x4cion\appium.tmp
// 发送到Android手机的上apk形式为:d9f8dd6bb601598747a44d89e7c628c7.apk
> info: [debug] MD5 for app is d9f8dd6bb601598747a44d89e7c628c7
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "ls /data/local/tmp/d9f8dd6bb601598747a44d89e7c628c7.apk"
> info: [debug] Getting install status for com.zhihu.android
> info: [debug] Getting device API level
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 19
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "pm list packages -3 com.zhihu.android"
> info: [debug] App is installed
> info: App is already installed, resetting app
> info: [debug] Running fast reset (stop and clear)
// 判断app是否已经安装
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "am force-stop com.zhihu.android"
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "pm clear com.zhihu.android"
// 电脑上的4724端口和设备的4724进行关联,为后续进行通信
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 forward tcp:4724 tcp:4724
// 将 bootstrap.jar包发送给设备,让设备通过这个jar包来接收服务端传递的信息
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 push "D:\\appium\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: [debug] Pushing settings apk to device...
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 install "D:\appium\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 install "D:\appium\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: Starting App
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
// bootstrap.jar通过uiautomator被启动
> info: [debug] spawning: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.zhihu.android -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
// 开通了4724服务,并加载json
> 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] [BOOTSTRAP] [debug] json loading complete.
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] Waking up device if it's not alive
> info: [debug] Pushing command to appium work queue: ["wake",{}]
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: wake
// 获取当前界面的activity
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "dumpsys window"
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data","status":0}
> info: [debug] dataDir set to: /data
> info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
> info: [debug] Getting device API level
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "getprop ro.build.version.sdk"
> 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: [debug] Device is at API Level 19
// 启动app应用
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.zhihu.android/com.zhihu.android.app.ui.activity.MainActivity"
> info: [debug] Waiting for pkg "com.zhihu.android" and activity "com.zhihu.android.app.ui.activity.MainActivity" to be focused
> info: [debug] Getting focused package and activity
// 获取当前的activity和起始activity进行对比,判断是否一直
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "dumpsys window windows"
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "getprop ro.build.version.release"
> info: [debug] Device is at release version 4.4.2
> info: [debug] Device launched! Ready for commands
> info: [debug] Setting command timeout to the default of 60 secs
> info: [debug] Appium session started with sessionId 41fee12e-7fc7-4adc-b6e1-0ce1ea3e1a87
> info: <-- POST /wd/hub/session 303 10391.397 ms - 74 
> info: --> GET /wd/hub/session/41fee12e-7fc7-4adc-b6e1-0ce1ea3e1a87 {}
> info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"D:\\eclipse\\workspace0122\\appiumtest\\apps\\zhihu.apk","platformName":"Android","deviceName":"moniqi"},"app":"D:\\eclipse\\workspace0122\\appiumtest\\apps\\zhihu.apk","platformName":"Android","deviceName":"127.0.0.1:62001"},"sessionId":"41fee12e-7fc7-4adc-b6e1-0ce1ea3e1a87"}
> info: <-- GET /wd/hub/session/41fee12e-7fc7-4adc-b6e1-0ce1ea3e1a87 200 4.124 ms - 560 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"app":"D:\\eclipse\\workspace0122\\appiumtest\\apps\\zhihu.apk","platformName":"Android","deviceName":"moniqi"},"app":"D:\\eclipse\\workspace0122\\appiumtest\\apps\\zhihu.apk","platformName":"Android","deviceName":"127.0.0.1:62001"},"sessionId":"41fee12e-7fc7-4adc-b6e1-0ce1ea3e1a87"}
> info: [debug] Didn't get a new command in 60 secs, shutting down...
> info: Shutting down appium session
> info: [debug] Pressing the HOME button
// 退出appium后,按一个home键
> info: [debug] executing cmd: D:\android_workspace\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:62001 shell "input keyevent 3"
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> 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: 62.145
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> 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

重点学习日志中相关的adb命令

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 215,384评论 6 497
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,845评论 3 391
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 161,148评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,640评论 1 290
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,731评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,712评论 1 294
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,703评论 3 415
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,473评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,915评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,227评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,384评论 1 345
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,063评论 5 340
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,706评论 3 324
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,302评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,531评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,321评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,248评论 2 352

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 172,028评论 25 707
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,647评论 18 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 46,801评论 6 342
  • 前两天听了企鹅妈妈的分享,她的事例触动了7万人。 企鹅妈妈曾经是新东方的老师,生了小企鹅后自学插画,两年时间,从新...
    Free小洋阅读 2,538评论 9 21
  • 许久不动笔说些什么,再拾起笔怕也难逃硬式教育的后遗症,结束了众人各自印象中都最炎热的暑假,初到山大几个月,若说我...
    好大一个碗哟阅读 287评论 0 1