我分析结论是,它的安全性应该还是有保障的。它只是分析放在了自己的服务器上,但你上传的就是手机里 appetizer 下的一个 Log 文件,这个 Log 被记录的内容,你可以看下,没什么的。另外,基于 python 都是开源的还,源码都给你了,还不放心就仔细调试源码看有什么猫腻操作。
@joko 看了你的源码,真乃大神也, 进程 线程 装饰器 形参 位参。。。。 adb 封装一句搞定。
logging 使用出神入化。。。 代码规范完全符合 google 工程级标准。
求继续维护,支持 h5 支持 ios 和 支持设备管理 等其它功能
不需要源码 , 只需要 android 的 apk 包,另一个条件是,混淆的 apk 可以。那种加固的好像要去掉加固的 apk 可以插住。
给你建议参考,ui 有特定业务操作流程类的,可以用 appium 来搞,但只能覆盖一定比例的前端操作流程。主要目的是做发版主要流程覆盖。拿这套来捕获 anr 或 crash 可以用其他的开源。社区里就有 appetizer。
atx.drivers.android.py.AndroidDevices(DeviceMixin) 应该是这里提供类似 wda d.session.alert.buttons() 里的方法吧 可惜没找到 alert 方法。。。。
@codeskyblue https://testerhome.com/topics/11270 我看这篇文章 应该有在 atx-agent 也就是 uiautomator2 中源码 中有什么参数开启传递 自动识别并点掉弹窗吧。 我去找找看。。。。
@codeskyblue android 系统的自动化弹窗识别 ,是用 atx 包里的方法 还是 atx-uiautomator2 包里的方法 ?
向手机端重装一下 python -m uiautomator2 init
附上第二次跑的 appium server 端 log 留存以便逆向分析 server 执行过程和调用
cmd@TR:~$ appium --session-override -p 4730
[Appium] Welcome to Appium v1.7.2
[Appium] Non-default server args:
[Appium] port: 4730
[Appium] sessionOverride: true
[Appium] Appium REST http interface listener started on 0.0.0.0:4730
[HTTP] --> POST /wd/hub/session {"capabilities":{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}},"desiredCapabilities":{"platformName":"Android","platformVersion":"7.1.1","deviceName":"MIX_2","udid":"45806625","appPackage":"com.baidu.yuedu","appActivity":"com.baidu.yuedu.splash.SplashActivity","noReset":true,"newCommandTimeout":30,"unicodeKeyboard":true,"resetKeyboard":true,"automationName":"Uiautomator2","noSign":true}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"Android","platformVersion":"7.1.1","deviceName":"MIX_2","udid":"45806625","appPackage":"com.baidu.yuedu","appActivity":"com.baidu.yuedu.splash.SplashActivity","noReset":true,"newCommandTimeout":30,"unicodeKeyboard":true,"resetKeyboard":true,"automationName":"Uiautomator2","noSign":true},null,{"firstMatch":[{}],"alwaysMatch":{"platformName":"Android"}}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1517024576592 (11:42:56 GMT+0800 (CST))
[Appium] Merged W3C capabilities {"firstMatch":[{}],"alwaysMatch":{"platformName... into desiredCapabilities object {"platformName":"Android","platformVersion":"7....
[Appium] Creating new AndroidUiautomator2Driver (v0.11.0) session
[Appium] Capabilities:
[Appium] platformName: Android
[Appium] platformVersion: 7.1.1
[Appium] deviceName: MIX_2
[Appium] udid: 45806625
[Appium] appPackage: com.baidu.yuedu
[Appium] appActivity: com.baidu.yuedu.splash.SplashActivity
[Appium] noReset: true
[Appium] newCommandTimeout: 30
[Appium] unicodeKeyboard: true
[Appium] resetKeyboard: true
[Appium] automationName: Uiautomator2
[Appium] noSign: true
[BaseDriver] Session created with session id: 24fb9178-cb4c-45b4-90e8-4613cf46664e
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_161
[ADB] Checking whether adb is present
[ADB] Using adb from /opt/android-sdk-linux/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: 45806625
[ADB] Checking whether adb is present
[debug] [ADB] Setting device id to 45806625
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","getprop","ro.build.version.sdk"]
[debug] [ADB] Current device property 'ro.build.version.sdk': 25
[debug] [ADB] Device API level: 25
[AndroidDriver] No app sent in, not parsing package/activity
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","getprop","ro.build.version.release"]
[debug] [ADB] Current device property 'ro.build.version.release': 7.1.1
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","wm","size"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","wm","density"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","getprop","ro.product.model"]
[debug] [ADB] Current device property 'ro.product.model': MIX 2
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","getprop","ro.product.manufacturer"]
[debug] [ADB] Current device property 'ro.product.manufacturer': Xiaomi
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","am","force-stop","io.appium.uiautomator2.server"]
[ADB] Checking whether aapt is present
[ADB] Using aapt from /opt/android-sdk-linux/build-tools/25.0.2/aapt
[debug] [ADB] Getting install status for io.appium.uiautomator2.server
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","pm","list","packages","io.appium.uiautomator2.server"]
[debug] [ADB] App is installed
[debug] [ADB] Getting install status for io.appium.uiautomator2.server.test
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","pm","list","packages","io.appium.uiautomator2.server.test"]
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for io.appium.uiautomator2.server
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","package","io.appium.uiautomator2.server"]
[debug] [UiAutomator2] Waiting up to 20000ms for instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' to be available
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","pm","list","instrumentation"]
[debug] [UiAutomator2] Instrumentation 'io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner' available
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","wait-for-device"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","echo","ping"]
[AndroidDriver] setDeviceLanguageCountry requires language or country.
[AndroidDriver] Got language: 'null' and country: 'null'
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Enabling Unicode keyboard support
[debug] [AndroidDriver] Pushing unicode ime to device...
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","install","/opt/nodejs/lib/node_modules/appium/node_modules/appium-android-ime/bin/UnicodeIME-debug.apk"]
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","install","/opt/nodejs/lib/node_modules/appium/node_modules/appium-android-ime/bin/UnicodeIME-debug.apk"]
[debug] [ADB] Application '/opt/nodejs/lib/node_modules/appium/node_modules/appium-android-ime/bin/UnicodeIME-debug.apk' already installed. Continuing.
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","settings","get","secure","default_input_method"]
[debug] [AndroidDriver] Unsetting previous IME io.appium.android.ime/.UnicodeIME
[debug] [AndroidDriver] Setting IME to 'io.appium.android.ime/.UnicodeIME'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","ime","enable","io.appium.android.ime/.UnicodeIME"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","ime","set","io.appium.android.ime/.UnicodeIME"]
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","pm","list","packages","io.appium.settings"]
[debug] [ADB] App is not installed
[debug] [ADB] App '/opt/nodejs/lib/node_modules/appium/node_modules/io.appium.settings/app/build/outputs/apk/settings_apk-debug.apk' not installed. Installing
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","install","/opt/nodejs/lib/node_modules/appium/node_modules/io.appium.settings/app/build/outputs/apk/settings_apk-debug.apk"]
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","package","io.appium.settings"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","pm","dump","io.appium.settings"]
[debug] [ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;,pm,grant,io.appium.settings,android.permission.SET_ANIMATION_SCALE,;,pm,grant,io.appium.settings,android.permission.CHANGE_CONFIGURATION,;
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","pm","grant","io.appium.settings","android.permission.WRITE_SETTINGS",";","pm","grant","io.appium.settings","android.permission.ACCESS_MOCK_LOCATION",";","pm","grant","io.appium.settings","android.permission.SET_ANIMATION_SCALE",";","pm","grant","io.appium.settings","android.permission.CHANGE_CONFIGURATION",";"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","ps"]
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","am","start","-W","-n","io.appium.settings/.Settings","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","appops","set","io.appium.settings","android:mock_location","allow"]
[debug] [AndroidDriver] Pushing unlock helper app to device...
[debug] [ADB] Getting install status for io.appium.unlock
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","pm","list","packages","io.appium.unlock"]
[debug] [ADB] App is not installed
[debug] [ADB] App '/opt/nodejs/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk' not installed. Installing
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","install","/opt/nodejs/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","forward","tcp:8200","tcp:6790"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","window"]
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [AndroidDriver] Extracting strings from apk null null /tmp/com.baidu.yuedu
[debug] [ADB] Extracting strings for language: default
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","getprop","persist.sys.locale"]
[debug] [ADB] Current device property 'persist.sys.locale':
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","getprop","ro.product.locale"]
[debug] [ADB] Current device property 'ro.product.locale': zh-CN
[debug] [ADB] No strings.xml for language 'zh', getting default strings.xml
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","rm","-rf","/data/local/tmp/strings.json"]
[debug] [UiAutomator2] No app capability. Assuming it is already on the device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","am","force-stop","io.appium.uiautomator2.server"]
[UiAutomator2] Starting uiautomator2 server v0.3.0
[UiAutomator2] Running command: 'adb -s 45806625 shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner'
[UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online...
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"SESSIONID\",\"status\":0,\"value\":\"Status Invoked\"}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8200/wd/hub/session] with body: {"desiredCapabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","platformVersion":"7.1.1","deviceName":"MIX_2","udid":"45806625","appPackage":"com.baidu.yuedu","appActivity":"com.baidu.yuedu.splash.SplashActivity","noReset":true,"newCommandTimeout":30,"unicodeKeyboard":true,"resetKeyboard":true,"automationName":"Uiautomator2","noSign":true},"platformName":"Android","platformVersion":"7.1.1","deviceName":"45806625","udid":"45806625","appPackage":"com.baidu.yuedu","appActivity":"com.baidu.yuedu.splash.SplashActivity","noReset":true,"newCommandTimeout":30,"unicodeKeyboard":true,"resetKeyboard":true,"automationName":"Uiautomator2","noSign":true,"deviceUDID":"45806625","deviceScreenSize":"1080x2160","deviceScreenDensity":440,"deviceModel":"MIX 2","deviceManufacturer":"Xiaomi"}}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"5cd67617-b9ae-4de5-a567-64a83e6d4887","status":0,"value":"Created Session"}
[UiAutomator2] UiAutomator2 did not start the activity we were waiting for, 'com.baidu.yuedu/com.baidu.yuedu.splash.SplashActivity'. Starting it ourselves
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","am","start","-W","-n","com.baidu.yuedu/com.baidu.yuedu.splash.SplashActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[Appium] New AndroidUiautomator2Driver session created successfully, session 24fb9178-cb4c-45b4-90e8-4613cf46664e added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1517024599978 (11:43:19 GMT+0800 (CST))
[debug] [MJSONWP] Responding to client with driver.createSession() result: {"platformName":"Android","platformVersion":"7.1.1","deviceName":"MIX_2","udid":"45806625","appPackage":"com.baidu.yuedu","appActivity":"com.baidu.yuedu.splash.SplashActivity","noReset":true,"newCommandTimeout":30,"unicodeKeyboard":true,"resetKeyboard":true,"automationName":"Uiautomator2","noSign":true}
[HTTP] <-- POST /wd/hub/session 200 23392 ms - 376
[HTTP] --> GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentActivity() with args: ["24fb9178-cb4c-45b4-90e8-4613cf46664e"]
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","window","windows"]
[debug] [MJSONWP] Responding to client with driver.getCurrentActivity() result: ".splash.SplashActivity"
[HTTP] <-- GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity 200 51 ms - 96
[HTTP] --> GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentActivity() with args: ["24fb9178-cb4c-45b4-90e8-4613cf46664e"]
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","window","windows"]
[debug] [MJSONWP] Responding to client with driver.getCurrentActivity() result: ".splash.SplashActivity"
[HTTP] <-- GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity 200 44 ms - 96
[HTTP] --> GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentActivity() with args: ["24fb9178-cb4c-45b4-90e8-4613cf46664e"]
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","window","windows"]
[debug] [MJSONWP] Responding to client with driver.getCurrentActivity() result: ".splash.SplashActivity"
[HTTP] <-- GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity 200 79 ms - 96
[HTTP] --> GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentActivity() with args: ["24fb9178-cb4c-45b4-90e8-4613cf46664e"]
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","window","windows"]
[debug] [MJSONWP] Responding to client with driver.getCurrentActivity() result: ".splash.SplashActivity"
[HTTP] <-- GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity 200 83 ms - 96
[HTTP] --> GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentActivity() with args: ["24fb9178-cb4c-45b4-90e8-4613cf46664e"]
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","window","windows"]
[debug] [MJSONWP] Responding to client with driver.getCurrentActivity() result: ".splash.SplashActivity"
[HTTP] <-- GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity 200 60 ms - 96
[HTTP] --> GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity {}
[debug] [MJSONWP] Calling AppiumDriver.getCurrentActivity() with args: ["24fb9178-cb4c-45b4-90e8-4613cf46664e"]
[debug] [ADB] Getting focused package and activity
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","dumpsys","window","windows"]
[debug] [MJSONWP] Responding to client with driver.getCurrentActivity() result: ".base.ui.MainActivity"
[HTTP] <-- GET /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/appium/device/current_activity 200 66 ms - 95
[HTTP] --> POST /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/back {"sessionId":"24fb9178-cb4c-45b4-90e8-4613cf46664e"}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/back] to [POST http://localhost:8200/wd/hub/session/5cd67617-b9ae-4de5-a567-64a83e6d4887/back] with body: {"sessionId":"24fb9178-cb4c-45b4-90e8-4613cf46664e"}
[debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"5cd67617-b9ae-4de5-a567-64a83e6d4887","status":0,"value":true}
[JSONWP Proxy] Replacing sessionId 5cd67617-b9ae-4de5-a567-64a83e6d4887 with 24fb9178-cb4c-45b4-90e8-4613cf46664e
[HTTP] <-- POST /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e/back 200 4540 ms - 76
[HTTP] --> DELETE /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e {}
[debug] [MJSONWP] Calling AppiumDriver.deleteSession() with args: ["24fb9178-cb4c-45b4-90e8-4613cf46664e"]
[debug] [BaseDriver] Event 'quitSessionRequested' logged at 1517024609935 (11:43:29 GMT+0800 (CST))
[Appium] Removing session 24fb9178-cb4c-45b4-90e8-4613cf46664e from our master session list
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[debug] [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://localhost:8200/wd/hub/session/5cd67617-b9ae-4de5-a567-64a83e6d4887] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"5cd67617-b9ae-4de5-a567-64a83e6d4887\",\"status\":0,\"value\":\"Session deleted\"}"
[debug] [UiAutomator2] Resetting IME to 'io.appium.android.ime/.UnicodeIME'
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","ime","set","io.appium.android.ime/.UnicodeIME"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","shell","am","force-stop","com.baidu.yuedu"]
[debug] [UiAutomator2] [UIAutomator2] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:.
[debug] [UiAutomator2] [UIAutomator2] Time: 14.045
[debug] [UiAutomator2] [UIAutomator2] OK (1 test)
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running '/opt/android-sdk-linux/platform-tools/adb' with args: ["-P",5037,"-s","45806625","forward","--remove","tcp:8200"]
[debug] [BaseDriver] Event 'quitSessionFinished' logged at 1517024611138 (11:43:31 GMT+0800 (CST))
[debug] [MJSONWP] Received response: null
[debug] [MJSONWP] But deleting session, so not returning
[debug] [MJSONWP] Responding to client with driver.deleteSession() result: null
[HTTP] <-- DELETE /wd/hub/session/24fb9178-cb4c-45b4-90e8-4613cf46664e 200 1206 ms - 76
咩图片 咩域名?
“ Failed at the appium-chromedriver@3.1.4 install script”
设置一个环境变量重定向 chromedriver 下载地址,方法如下:
windows:
set CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver/
Linux 或 MAC:
export CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver/
然后再执行安装命令,您会发现下载链接变成 taobao 的了
@Samuel.ZhaoY 这个要作者看了。
呵呵 和你说了 这里是个 issue 有问题啊。现象就是打开百度首页 剩下的就不跑了 但是 nosmoke log 看的到 找到了一些 a 或 input 的元素。
你那个 框起来的 是找不到 reports 目录 这个应该不用自己创建 在执行 nosmoke -c webTest.yml 的时候 会自动在同脚本目录创建,
不过我看你是 win 环境 不排除可能这个自动创建在 win 下出 bug 了,你可以自己手动创建 reports 目录先。
https://github.com/macacajs/NoSmoke/issues/38 应该这么写 见 webTest.yml 但跑起来有些问题
permissionPatterns: '[\"继续安装\",\"下一步\",\"好\",\"允许\",\"确定\",\"我知道\"]'
而这一句,是在真机测试时来捕获系统权限安装弹窗,让 android-unlock 自动许可安装通过的一步。
是 macaca 的 Desired Capabilities 是最近一个版本新加的 在官方说明中 还未有。
这是个很重要的 参数。 在真机测试时。 真棒。底层解决了。
看了下 macaca server 的日志
发现
helper.js:176:12 [master] pid:25727 Using local app form /home/cmd/app/acp4.7p.apk
checking permissionPatterns: [\"继续安装\",\"下一步\",\"好\",\"允许\",\"确定\",\"我知道\"]
uiautomator-client.js:62:14 [master] pid:25727 INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
com.macaca.android.testing.UIAutomatorWD:
uiautomator-client.js:62:14 [master] pid:25727
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=MacacaTestRunner
INSTRUMENTATION_STATUS: class="com".macaca.android.testing.UIAutomatorWD
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1uiautomator-client.js:62:14 [master] pid:25727 INSTRUMENTATION_STATUS: stream=
UIAutomatorWD->http://localhost:9002<-UIAutomatorWD
INSTRUMENTATION_STATUS_CODE: 0UIAutomatorWD http server ready
macaca-android.js:303:10 [master] pid:25727 start app with: {"package":"com.sinacp.ggaicai","activity":""}
responseHandler.js:49:14 [master] pid:25727 Send HTTP Respone to Client[2018-01-03 14:28:04]: {"sessionId":"41c53e4f-4ae4-4762-8a08-867edd515f94","status":0,"value":"{\"platformName\":\"android\",\"app\":\"/home/cmd/app/acp4.7p.apk\",\"packages\":\"com.sinacp.ggaicai\",\"activity\":\"com.aicai.pluginhost.activity.MainActivity\",\"isWaitActivity\":true,\"reuse\":3,\"udid\":45806625,\"permissionPatterns\":\"[\\\\"继续安装\\\\",\\\\"下一步\\\\",\\\\"好\\\\",\\\\"允许\\\\",\\\\"确定\\\\",\\\\"我知道\\\\"]\"}"}
是 UIAutomatorWD 负责发的这个 responseHandler ,就去找到 UIAutomatorWD 项目 发现最近 NoSmoke 的作者提交了 permissionPatterns 相关
https://github.com/macacajs/UIAutomatorWD/commit/dee4dad116995f956cdfa9fc7fbca68da8912ac3
论坛和群里 经常有问包括 appium 的 在真机测试时都是需要先权限安装 Unlock 和 appium-setting
怎么自动化的解决系统安装弹窗的问题,也有不少方案源码。
===================================================
`shell am instrument -w -r -e permissionPattern ${this.permissionPatterns} -e port ${this.proxyPort} -e class ${UIAUTOMATORWD.PACKAGE_NAME} ${UIAUTOMATORWD.TEST_PACKAGE}.test/${UIAUTOMATORWD.RUNNER_CLASS}`.split(' ');
和该句代码有关系。
https://developer.android.com/studio/command-line/adb.html?hl=zh-cn
https://developer.android.com/reference/android/app/Instrumentation.html
instrument [options] component 使用 Instrumentation 实例启动监控。通常,目标 component 是表单 test_package/runner_class。
选项包括:
-r:输出原始结果(否则对 report_key_streamresult 进行解码)。与 [-e perf true] 结合使用以生成性能测量的原始输出。
-e name value:将参数 name 设为 value。对于测试运行器,通用表单为 -e testrunner_flag value[,value...]。
-p file:将分析数据写入 file。
-w:先等待仪器完成,然后再返回。测试运行器需要使用此选项。
--no-window-animation:运行时关闭窗口动画。
--user user_id | current:指定仪器在哪个用户中运行;如果未指定,则在当前用户中运行。
支持 请尽快开源
嗯,这个前端真及时。
@Samuel.ZhaoY 可以指导下
permissionPatterns: '[\"继续安装\",\"下一步\",\"好\",\"允许\",\"确定\",\"我知道\"]'
该句的 具体源码路径 和原理吗? 这个很有用
~/.profile
后末尾追加
#Pyenv path
export PATH="/home/cmd/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
不知道为啥 每次启动 terminal
pyenv activate pyenv363 会提示找不到 pyenv
还必须再 source 一次。我把它调整到~/.bashrc 启动终端就不需要再 source 了。
@debugtalk http-archive-viewer
https://chrome.google.com/webstore/detail/http-archive-viewer/ebbdbdmhegaoooipfnjikefdpeoaidml?hl=en
This utility allows you to inspect HAR log files generated by browser's. HAR (HTTP Archive) files can be generated by most browsers and contain a log of HTTP requests and responses, they can also contain body content. Excellent for debugging HTTP sessions.
已提交,有稿费领嘛
@debugtalk 你好 git 上 https://github.com/HttpRunner/HttpRunner/tree/master/examples 下并没有你提到的 HelloWorld
“最后,在 HttpRunner 项目的 examples/HelloWorld 目录中,包含了一份完整的分层测试用例示例,相信会对大家有所帮助。”
好机会 当主管了 逼自己 即要管人 又要深入推进技术 和整合梳理测试资源了 是个好机会
祝贺你 百尺竿头更进一步
@debugtalk
你好,最近看到了 Fuzzing 模糊测试,接触了两个开源工具:
1http://hypothesis.works/
2https://github.com/google/oss-fuzz
不知道 httprunner 能否 支持这连个工具的扩展 不知道 九毫 是否考虑接入这种支持。
自问自答: 原来 appium 是支持测试 Windows 应用的 UI 测试 的
https://github.com/appium/appium/blob/71fac8d2759b18bb2a506a5c8359bfdf41a6443b/docs/cn/writing-running-appium/windows-app-testing.md
今天来补充纠正下两个参数的含义
https://github.com/seveniruby/AppCrawler/blob/master/doc/%E9%81%8D%E5%8E%86%E6%8E%A7%E5%88%B6.md
在这里我们看到了解释是这样的:
firstList 表示优先遍历元素特征
lastList 表示最后应该遍历的元素特征
那么按字面意思,我正好和作者的意思理解反了,实际作者是这么解释的。
lastList “哪一个最重要,是大类目功能的 放在最后去点击” 意思就是大多数 APP 底部都有一些大类目的功能切换,比如雪球 APP 底部的 “首页 自选 动态 行情 开户” 这些都是大类目功能。 所以之前我文章中的用法就反了,理解错 first 和 last 了。如果你想控制 APP 底部大类目的遍历顺序,应该讲配置写进 lastList。
firstList 这里的 first 呢 是指比如进入到一个大类目界面下了 比如 自选,那么这个自选界面内的哪些优先点击 是配置一个大类目功能界面内的优先。