1、手动启动appium 服务

> Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 22 --automation-name Appium --device-name "lge-nexus_4-005475cbccd279d4" --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,"deviceName":"lge-nexus_4-005475cbccd279d4","platformName":"Android","platformVersion":"22","automationName":"Appium"}
> info: Console LogLevel: debug
2、【TestScript】发送带json数据(Capabilities)的POST请求到/wd/hub/session来创建session
> info: --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.edusoho.kuozhi","appActivity":"com.edusoho.kuozhi.KuozhiActivity","platformVersion":"5.1.1","automationName":"Appium","sessionOverride":true,"unicodeKeyboard":true,"platformName":"Android","deviceName":"red note3","resetKeyboard":false},
"requiredCapabilities":{},"capabilities":{"desiredCapabilities":{"appPackage":"com.edusoho.kuozhi","appActivity":"com.edusoho.kuozhi.KuozhiActivity","platformVersion":"5.1.1","automationName":"Appium","sessionOverride":true,"unicodeKeyboard":true,"platformName":"Android","deviceName":"red note3","resetKeyboard":false},
"requiredCapabilities":{}},"alwaysMatch":
{"appPackage":"com.edusoho.kuozhi","appActivity":"com.edusoho.kuozhi.KuozhiActivity","platformVersion":"5.1.1","automationName":"Appium","sessionOverride":true,"unicodeKeyboard":true,"platformName":"Android","deviceName":"red note3","resetKeyboard":false},"firstMatch":[]}
> info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_111)
> info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : sessionOverride
初始化APP应用(没有获取到APP但是又Android包(取决于脚本配置的Capabilities参数))
> info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
新建appium session
> info: [debug] Creating new appium session 2ac0e18a-9120-4e90-a066-c6ddb1a1deaf
3、启动Android appium
> info: Starting android appium
检查JDK
> info: [debug] Getting Java version
> info: Java version is: 1.8.0_111
检查adb
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe
> warn: No app capability, can't parse package/activity
4、检查并连接设备device
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming(假定) it's already on the device
检查设备信息
> info: Retrieving device
> info: [debug] Trying to find a connected android device
连接设备
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe devices
设备连接成功
> info: [debug] 1 device(s) connected
> info: Found device 5977b8a3
> info: [debug] Setting device id to 5977b8a3
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 wait-for-device
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "echo 'ready'"
开启logcat
> info: [debug] Starting logcat capture
> info: [debug] Getting device API level
获取设备系统API版本
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 22
> info: Device API level is: 22
获取设备系统语言
> info: [debug] Extracting strings for language: default
> info: [debug] Apk doesn't exist locally
> info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "rm -rf /data/local/tmp/strings.json"
5、检查APP安装和相关配置信息
没有卸载已存在APP,因为appium服务器未设置--full-reset
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Skipping install since we launched with a package instead of an app path
把系统的4724端口映射到测试设备的4724端口
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 forward tcp:4724 tcp:4724
 

把bootstrap.jar push到设备

> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 push "C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
 

让Unicode键盘可用

> info: [debug] Enabling Unicode keyboard support
把unicode ime输入法 push 到设备中
> info: [debug] Pushing unicode ime to device...
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unicode_ime_apk\UnicodeIME-debug.apk"
 

获取设备当前输入法

> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "settings get secure default_input_method"
取消设备当前输入法(百度输入法小米V6版)
> info: [debug] Unsetting IME 'com.baidu.input_miv6/.ImeService'
设置Unicode输入法为设备当前输入法
> info: [debug] Setting IME to 'io.appium.android.ime/.UnicodeIME'
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "ime enable io.appium.android.ime/.UnicodeIME"
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "ime set io.appium.android.ime/.UnicodeIME"
安装setting和unlock apk到测试设备
安装setting apk到测试设备
> info: [debug] Pushing settings apk to device...
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
安装unlock.apk到测试设备
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 install "C:\Program Files (x86)\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:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "ps 'uiautomator'"
> info: [debug] No matching processes found
6、运行测试机上的bootstrap
> info: [debug] Running bootstrap
> info: [debug] spawning: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.edusoho.kuozhi -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
appium socket server在4724端口打开
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] [BOOTSTRAP] [debug] Loading json...
注册crash监听器
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
如果设备锁屏,则唤醒设备
> info: [debug] Waking up device if it's not alive
把wake命令push到appium工作队列
> 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
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "dumpsys window"
> info: [debug] Screen already unlocked, continuing.
把getDataDir命令push到appium工作队列
> 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: {"status":0,"value":"\/data\/local\/tmp"}
> info: [debug] dataDir set to: /data/local/tmp
把compressedLayoutHierarchy命令push到appium工作队列
> 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] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":false}
再次检查设备API版本
> info: [debug] Getting device API level
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 22
启动APP
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.edusoho.kuozhi/com.edusoho.kuozhi.KuozhiActivity"
让待测试APP获取焦点
> info: [debug] Waiting for pkg "com.edusoho.kuozhi" and activity "com.edusoho.kuozhi.KuozhiActivity" to be focused
> info: [debug] Getting focused package and activity
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "dumpsys window windows"
获取设备系统版本
> info: [debug] executing cmd: D:\Software\adt-bundle-windows-x86_64-20140321\sdk\platform-tools\adb.exe -s 5977b8a3 shell "getprop ro.build.version.release"
> info: [debug] Device is at release version 5.1.1
设备初始化成功,准备接收testscript->appium 服务器传过来的命令
> info: [debug] Device launched! Ready for commands
设置命令默认超时时间为60秒
> info: [debug] Setting command timeout to the default of 60 secs
> info: [debug] Appium session started with sessionId 2ac0e18a-9120-4e90-a066-c6ddb1a1deaf
7.反馈最开始POST的请求结果
> info: <-- POST /wd/hub/session 303 10052.520 ms - 74

appium启动运行log分析的更多相关文章

  1. Appium Server 源码分析之启动运行Express http服务器

    通过上一个系列Appium Android Bootstrap源码分析我们了解到了appium在安卓目标机器上是如何通过bootstrap这个服务来接收appium从pc端发送过来的命令,并最终使用u ...

  2. Appium Android Bootstrap源码分析之启动运行

    通过前面的两篇文章<Appium Android Bootstrap源码分析之控件AndroidElement>和<Appium Android Bootstrap源码分析之命令解析 ...

  3. Appium Android Bootstrap源代码分析之启动执行

    通过前面的两篇文章<Appium Android Bootstrap源代码分析之控件AndroidElement>和<Appium Android Bootstrap源代码分析之命令 ...

  4. 老李推荐:第5章7节《MonkeyRunner源码剖析》Monkey原理分析-启动运行: 循环获取并执行事件 - runMonkeyCycles

    老李推荐:第5章7节<MonkeyRunner源码剖析>Monkey原理分析-启动运行: 循环获取并执行事件 - runMonkeyCycles   poptest是国内唯一一家培养测试开 ...

  5. 老李推荐:第5章6节《MonkeyRunner源码剖析》Monkey原理分析-启动运行: 初始化事件源

    老李推荐:第5章6节<MonkeyRunner源码剖析>Monkey原理分析-启动运行: 初始化事件源   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试 ...

  6. 老李推荐:第5章3节《MonkeyRunner源码剖析》Monkey原理分析-启动运行: 启动脚本

    老李推荐:第5章3节<MonkeyRunner源码剖析>Monkey原理分析-启动运行: 启动脚本   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性 ...

  7. 老李推荐:第5章5节《MonkeyRunner源码剖析》Monkey原理分析-启动运行: 获取系统服务引用

    老李推荐:第5章5节<MonkeyRunner源码剖析>Monkey原理分析-启动运行: 获取系统服务引用   上一节我们描述了monkey的命令处理入口函数run是如何调用optionP ...

  8. 老李推荐:第5章2节《MonkeyRunner源码剖析》Monkey原理分析-启动运行: 启动流程概览

    老李推荐:第5章2节<MonkeyRunner源码剖析>Monkey原理分析-启动运行: 启动流程概览   每个应用都会有一个入口方法来供操作系统调用执行,Monkey这个应用的入口方法就 ...

  9. 老李推荐:第5章1节《MonkeyRunner源码剖析》Monkey原理分析-启动运行: 官方简介

    老李推荐:第5章1节<MonkeyRunner源码剖析>Monkey原理分析-启动运行: 官方简介   在MonkeyRunner的框架中,Monkey是作为一个服务来接受来自Monkey ...

随机推荐

  1. mysql外键

    1.直接在SQLyog中创建外键: 在SQLyog中的架构设计器中拖进2张表,然后选择t_book的bookTypeId拖到另一张表t_booktype的ID位置,然后就能创建外键了. MySQL的外 ...

  2. Tornado框架简介

    -------------------简介------------------- 1.概念:     Tornado全称Tornado Web Server,是一个用Python语言写成的Web服务器 ...

  3. jvm系列 (四) ---强、软、弱、虚引用

    java引用 目录 jvm系列(一):jvm内存区域与溢出 jvm系列(二):垃圾收集器与内存分配策略 jvm系列(三):锁的优化 我的博客目录 为什么将引用分为不同的强度 因为我们需要实现这样一种情 ...

  4. Spring Cloud中负载均衡器概览

    在上篇文章中(RestTemplate的逆袭之路,从发送请求到负载均衡)我们完整的分析了RestTemplate的工作过程,在分析的过程中,我们遇到过一个ILoadBalancer接口,这个接口中有一 ...

  5. NHibernate教程(13)--立即加载

    本节内容 引入 立即加载 实例分析 1.一对多关系实例 2.多对多关系实例 结语 引入 通过上一篇的介绍,我们知道了NHibernate中默认的加载机制--延迟加载.其本质就是使用GoF23中代理模式 ...

  6. 转:【Java并发编程】之十一:线程间通信中notify通知的遗漏(含代码)

    转载请注明出处:http://blog.csdn.net/ns_code/article/details/17228213 notify通知的遗漏很容易理解,即threadA还没开始wait的时候,t ...

  7. 团队作业4——第一次项目冲刺(Alpha版本)4.24

    ·本次会议为第三次Scrum Meeting会议~ ·本次会议项目经理召开时间为15:00,在教学楼教室召开,召开时长约30分钟,探讨了昨日任务的进展.遇到的困难以及后续所要开展的工作. 1.站立式会 ...

  8. 201521123057 《Java程序设计》 第8周学习总结

    1. 本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结集合与泛型相关内容 2. 书面作业 1.List中指定元素的删除(题目4-1) 1.1 实验总结 答:remove中注意应该使用eq ...

  9. 201521123020 《Java程序设计》第6周学习总结

    本周学习总结 书面作业 1.clone方法 1.1 Object对象中的clone方法是被protected修饰,在自定义的类中覆盖clone方法时需要注意什么? 答:需要将protected改为pu ...

  10. 201521123103 《java学习笔记》 第十二周学习总结

    一.本周学习总结 1.1 以你喜欢的方式(思维导图或其他)归纳总结多流与文件相关内容. 二.书面作业 将Student对象(属性:int id, String name,int age,double ...