appium启动运行log分析

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

时间: 2024-07-31 00:10:05

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

appium在真机上运行IOS实例要注意的几点:包括python和java运行log 和部分关键代码

最近在研究appium对于IOS的自动化测试,发现在真机上运行appium提供的开源的例子遇到了几个block,询问了一个这个方便面的高手并且总结网上搜到的帖子,现在综合一下. appium 在模拟器中跑,只需要注意app=path appium真机上运行:1:运行的时候要将APP安装到真机上面 2:运行的时候,不能再开instrument 3:命令行里面启动的时候,参数写错了应该是 appium -U 3d2cad7288a64a5445aa98a2cc220132f2cddd1c --app

appium界面运行过程(结合日志截图分析)

appium界面运行过程: 1.启动一个http服务器:127.0.0.1:47232.根据测试代码setUp()进行初始化,在http服务器上建立一个session对象3.开始调用adb,找到连接上的设备,设置设备id4.等待设备准备好响应命令5.开启logcat日志监控6.将生成的apk属性信息文件strings.json存到了设备 /data/local/tmp目录下7.读取apk安装情况8.端口映射,发给appium httpserver的内容,经过httpserver后直接发给设备 f

Appium Server源码分析之作为Bootstrap客户端

Appium Server拥有两个主要的功能: 它是个http服务器,它专门接收从客户端通过基于http的REST协议发送过来的命令 他是bootstrap客户端:它接收到客户端的命令后,需要想办法把这些命令发送给目标安卓机器的bootstrap来驱动uiatuomator来做事情 通过上一篇文章<Appium Server 源码分析之启动运行Express http服务器>我们分析了Appium Server是如何作为一个http服务器进行工作的.那么今天我们就要分析第二点,Appium S

Log中&#39;main&#39;, &#39;system&#39;, &#39;radio&#39;, &#39;events&#39;以及android log分析

在Android中不同的log写到不同的设备中,共有/dev/log/system, /dev/log/main, /dev/log/radion, /dev/log/events四中类型.其中默认Log.v等写入/dev/log/main中.Slog写入/dev/log/system中. 我们在使用logcat 抓去日至的时候, 可以指定buffer,来请求不同的环形缓冲区 ('main', 'system', 'radio', 'events',默认为"-b main -b system&q

第8章6节《MonkeyRunner源码剖析》MonkeyRunner启动运行过程-启动Monkey

大家可能会觉得奇怪,为什么启动目标设备端的monkey进程会放在"运行测试脚本"这一节之后来阐述. 纵观前面整个MonkeyRunner的启动流程,我们看到并没有提及到monkey进程启动的地方.那么就奇怪了,monkey是什么时候被MonkeyRunner启动起来的呢? 我们的测试脚本一开始时几乎毫无例外的都需要执行一个调用:MonkeyRunner.waitForConnection(),如果有多个设备连接到主机的话还需要指定设备序列号,还可以指定等待连接的Timeout时间,比如

Android之rild进程启动源码分析

Android 电话系统框架介绍 在android系统中rild运行在AP上,AP上的应用通过rild发送AT指令给BP,BP接收到信息后又通过rild传送给AP.AP与BP之间有两种通信方式: 1.Solicited Response:Ap向Bp发送请求,Bp给Ap发送回复,该类型的AT指令及其回调函数以数组的形式存放在Ril_commands.h文件中: {数组中的索引号,请求回调函数,响应回调函数} [plain] view plaincopy {0, NULL, NULL},      

Openstack学习笔记之——Neutron-server服务加载与启动源码分析(三)

本文是在学习Openstack的过程中整理和总结,由于时间和个人能力有限,错误之处在所难免,欢迎指正! 在Neutron-server服务加载与启动源码分析(二)中搞定模块功能的扩展和加载,我们就回到Neutron-server服务加载与启动源码分析(一)中的_run_wsgi函数 <span style="font-size:14px;">def _run_wsgi(app_name): app = config.load_paste_app(app_name) ifno

Android应用程序组件Content Provider的启动过程源代码分析

文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6963418 通过前面的学习,我们知道在Android系统中,Content Provider可以为不同的应用程序访问相同的数据提供统一的入口.Content Provider一般是运行在独立的进程中的,每一个Content Provider在系统中只有一个实例存在,其它应用程序首先要找到这个实例,然后才能访问它的数据.那么,系统中的Conten

netstat--查看服务器[有效]连接数--统计端口并发数--access.log分析

简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多播成员 (Multicast Memberships) 等等. 输出信息含义 执行netstat后,其输出结果为 ? ? Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 2 210.