下面介绍appium日志的大概分析
//启动appium服务成功
2017-03-24 11:22:49:218 - info: [Appium] Welcome to Appium v1.6.3
2017-03-24 11:22:49:221 - info: [Appium] Non-default server args:
2017-03-24 11:22:49:222 - info: [Appium] log: 'C:\\Users\\LXG\\Desktop\\appium.log'
2017-03-24 11:22:49:270 - info: [Appium] Appium REST http interface listener started on 0.0.0.0:4723
//收到从脚本传递的post请求,将desiredCapabilities参数全部传递给服务端
2017-03-24 11:23:57:842 - info: [HTTP] --> POST /wd/hub/session {"capabilities":{"desiredCapabilities":{"app":"C:\\Users\\LXG\\Desktop\
\zhihunew1.apk","noSign":true,"newCommandTimeout":600,"unicodeKeyboard":true,"platformName":"Android","deviceName":"xxx","resetKeyboard":true},"requiredCapabilities":
{}},"desiredCapabilities":{"app":"C:\\Users\\LXG\\Desktop\
\zhihunew1.apk","noSign":true,"newCommandTimeout":600,"unicodeKeyboard":true,"platformName":"Android","deviceName":"xxx","resetKeyboard":true},"requiredCapabilities":
{}}
//调用appiumdriver创建session
2017-03-24 11:23:57:845 - info: [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"C:\\Users\\LXG\\Desktop\
\zhihunew1.apk","noSign":true,"newCommandTimeout":600,"unicodeKeyboard":true,"platformName":"Android","deviceName":"xxx","resetKeyboard":true},{},
{"desiredCapabilities":{"app":"C:\\Users\\LXG\\Desktop\
\zhihunew1.apk","noSign":true,"newCommandTimeout":600,"unicodeKeyboard":true,"platformName":"Android","deviceName":"xxx","resetKeyboard":true},"requiredCapabilities":
{}},null,null]
2017-03-24 11:23:57:849 - info: [Appium] Creating new AndroidDriver session
2017-03-24 11:23:57:849 - info: [Appium] Capabilities:
2017-03-24 11:23:57:851 - info: [Appium] app: 'C:\\Users\\LXG\\Desktop\\zhihunew1.apk'
2017-03-24 11:23:57:852 - info: [Appium] noSign: true
2017-03-24 11:23:57:853 - info: [Appium] newCommandTimeout: 600
2017-03-24 11:23:57:853 - info: [Appium] unicodeKeyboard: true
2017-03-24 11:23:57:853 - info: [Appium] platformName: 'Android'
2017-03-24 11:23:57:854 - info: [Appium] deviceName: 'xxx'
2017-03-24 11:23:57:855 - info: [Appium] resetKeyboard: true
//获取androiddriver版本,创建一个session id,但此时实际上还没有真正的创建成功
//Androiddriver版本1.10.38
2017-03-24 11:23:57:858 - info: [debug] [AndroidDriver] AndroidDriver version: 1.10.38
//生成的sessionid
2017-03-24 11:23:57:899 - info: [BaseDriver] Session created with session id: bbdf133b-9332-4b26-9556-6249f006d3a0
//获取java版本
2017-03-24 11:23:57:901 - info: [debug] [AndroidDriver] Getting Java version
2017-03-24 11:23:58:007 - info: [AndroidDriver] Java version is: 1.8.0_40-ea
//检查adb是否存在,通过配置的环境变量ANDROID_HOME去固定路径下查找
2017-03-24 11:23:58:011 - info: [ADB] Checking whether adb is present
2017-03-24 11:23:58:016 - info: [ADB] Using adb.exe from D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe
//查找当前连接的设备,通过【adb devices】命令,找到后并将该设备的udid设置为要使用的
2017-03-24 11:23:58:017 - info: [AndroidDriver] Retrieving device list
2017-03-24 11:23:58:018 - info: [debug] [ADB] Trying to find a connected android device
2017-03-24 11:23:58:020 - info: [debug] [ADB] Getting connected devices...
//查询到有一个设备连接
2017-03-24 11:23:58:046 - info: [debug] [ADB] 1 device(s) connected
//使用这个设备,获取udid
2017-03-24 11:23:58:046 - info: [AndroidDriver] Using device: 127.0.0.1:62001
2017-03-24 11:23:58:048 - info: [ADB] Checking whether adb is present
2017-03-24 11:23:58:051 - info: [ADB] Using adb.exe from D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe
2017-03-24 11:23:58:053 - info: [debug] [ADB] Setting device id to 127.0.0.1:62001
//要安装本地应用zhihunew1.apk,先检查这个app是否实际存在,存在则继续
2017-03-24 11:23:58:054 - info: [BaseDriver] Using local app 'C:\Users\LXG\Desktop\zhihunew1.apk'
2017-03-24 11:23:58:056 - info: [debug] [AndroidDriver] Checking whether app is actually present
2017-03-24 11:23:58:059 - info: [AndroidDriver] Starting Android session
//检查设备是否能够正常响应adb命令,通过【adb shell echo ping】来检查,设备能够正常响应打印出"ping"则认为设备正常,这里响应有个超时时间(默认是5秒)
2017-03-24 11:23:58:062 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62001","wait-
for-device"]
2017-03-24 11:23:58:089 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:23:58:114 - info: [debug] [ADB] 1 device(s) connected
//adb shell echo ping 检查设备状态
2017-03-24 11:23:58:115 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","echo","ping"]
2017-03-24 11:23:58:144 - info: [debug] [Logcat] Starting logcat capture
//安装unicode.APK输入法并将该输入法设备为当前默认的输入法,因为unicodeKeyboard设置为true,安装前先判断是否已经存在于设备上(注意这里是因为修改了源码所以才会去判断,没改
过源码的是不判断的,而是每次都会安装)
2017-03-24 11:23:58:179 - info: [debug] [ADB] Getting install status for io.appium.android.ime
2017-03-24 11:23:58:187 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:23:58:233 - info: [debug] [ADB] 1 device(s) connected
2017-03-24 11:23:58:234 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","getprop","ro.build.version.sdk"]
2017-03-24 11:23:58:294 - info: [debug] [ADB] Device API level: 19
2017-03-24 11:23:58:296 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:23:58:347 - info: [debug] [ADB] 1 device(s) connected
2017-03-24 11:23:58:353 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","pm","list","packages","-3","io.appium.android.ime"]
2017-03-24 11:23:59:109 - info: [debug] [ADB] App is not installed
2017-03-24 11:23:59:110 - info: [debug] [AndroidDriver] Enabling Unicode keyboard support
2017-03-24 11:23:59:113 - info: [debug] [AndroidDriver] Pushing unicode ime to device...
//安装UnicodeIME-debug.apk 安装IME,就是我们所说的输入法,存放地址为
2017-03-24 11:23:59:117 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","install","C:\\Users\\LXG\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-android-ime\\bin\\UnicodeIME-debug.apk"]
2017-03-24 11:24:00:219 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:24:00:260 - info: [debug] [ADB] 1 device(s) connected
//adb shell settings get secure default_input_method 获取当前的输入法
2017-03-24 11:24:00:261 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","settings","get","secure","default_input_method"]
2017-03-24 11:24:01:004 - info: [debug] [AndroidDriver] Unsetting previous IME com.example.android.softkeyboard/.SoftKeyboard
//设置输入法为appium所用的输入法
2017-03-24 11:24:01:006 - info: [debug] [AndroidDriver] Setting IME to 'io.appium.android.ime/.UnicodeIME'
2017-03-24 11:24:01:007 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:24:01:041 - info: [debug] [ADB] 1 device(s) connected
2017-03-24 11:24:01:042 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","ime","enable","io.appium.android.ime/.UnicodeIME"]
2017-03-24 11:24:01:857 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:24:01:892 - info: [debug] [ADB] 1 device(s) connected
2017-03-24 11:24:01:893 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","ime","set","io.appium.android.ime/.UnicodeIME"]
//安装settings app,辅助设置设备的网络,因为unicodeKeyboard设置为true,安装前先判断是否已经存在于设备上(注意这里是因为修改了源码所以才会去判断,没改过源码的是不判断的
,而是每次都会安装)
2017-03-24 11:24:02:657 - info: [debug] [ADB] Getting install status for io.appium.settings
2017-03-24 11:24:02:658 - info: [debug] [ADB] Device API level: 19
2017-03-24 11:24:02:661 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:24:02:691 - info: [debug] [ADB] 1 device(s) connected
2017-03-24 11:24:02:692 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","pm","list","packages","-3","io.appium.settings"]
2017-03-24 11:24:03:536 - info: [debug] [ADB] App is not installed
2017-03-24 11:24:03:540 - info: [debug] [AndroidDriver] Pushing settings apk to device... this is shamo
2017-03-24 11:24:03:541 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","install","C:\\Users\\LXG\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\io.appium.settings\\bin\\settings_apk-debug.apk"]
//安装unlock app,辅助设备解锁,因为unicodeKeyboard设置为true,安装前先判断是否已经存在于设备上(注意这里是因为修改了源码所以才会去判断,没改过源码的是不判断的,而是每
次都会安装)
2017-03-24 11:24:04:762 - info: [debug] [ADB] Getting install status for io.appium.unlock
2017-03-24 11:24:04:763 - info: [debug] [ADB] Device API level: 19
2017-03-24 11:24:04:765 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:24:04:803 - info: [debug] [ADB] 1 device(s) connected
2017-03-24 11:24:04:804 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","shell","pm","list","packages","-3","io.appium.unlock"]
2017-03-24 11:24:06:037 - info: [debug] [ADB] App is not installed
2017-03-24 11:24:06:038 - info: [debug] [AndroidDriver] Pushing unlock helper app to device...
2017-03-24 11:24:06:038 - info: [debug] [ADB] Running 'D:\android-sdk_r24.4.1-windows\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-
s","127.0.0.1:62001","install","C:\\Users\\LXG\\AppData\\Roaming\\npm\\node_modules\\appium\\node_modules\\appium-unlock\\bin\\unlock_apk-debug.apk"]
2017-03-24 11:24:07:914 - info: [ADB] Getting device platform version
2017-03-24 11:24:07:914 - info: [debug] [ADB] Getting connected devices...
2017-03-24 11:24:07:965 - info: [debug] [ADB] 1 device(s) connected
//到此为止三个辅助apk已经安装完毕和设计完毕
//adb shell getprop ro.build.version.release 获取Android系统属性,系统版本
2017-03-24 11:24:07:970 -
appium的log详细分析
最新推荐文章于 2024-07-09 15:25:37 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)