https://github.com/lgxqf/UICrawler
QQ 技术交流群 : 728183683
环境搭建及基本使用说明: https://testerhome.com/topics/14490 (感谢网友 harsayer 倾力之作)
Android
appium --session-override -p 4723
-p 设定appium server的端口 , 不加参数默认为4723
java -jar UICrawler.jar -f config.yml -u udid -t 4723
-u 指定设备udid
-t 指定appium server的端口(此项为可选项,默认值是4723)
java -jar UICrawler.jar -f config.yml -u udid -t 4723 -m
#小程序
MINI_PROGRAM:
MINI_PROGRAM_NAME: 此处值为待测的小程序的名字
MINI_PROGRAM_PROCESS: com.tencent.mm:appbrand1
CRITICAL_ELEMENT:
#Android 微信
ANDROID_PACKAGE: com.tencent.mm
ANDROID_MAIN_ACTIVITY: com.tencent.mm.ui.LauncherUI
#iOS 微信
IOS_BUNDLE_ID: com.tencent.xin
IOS_BUNDLE_NAME: 微信
IOS_IPA_NAME: wechat
java -jar UICrawler.jar -h
-a Android package's main activity
-b iOS bundle id
-c Maximum click count
-d Maximum crawler UI depth
-e Record performance data
-f Yaml config file
-h Print this usage information
-i Ignore crash
-l Execution loop count
-m Run monkey
-p Android package name
-r Crawler running time
-t Appium port
-u Device serial
-v Version
-w WDA port for ios
-x Write data to influxDB
查看设备udid
Android:
adb devices
iOS:
instruments -s devices
idevice_id -l
Android 查看apk 和 Main activity
./aapt dump badging "apk" | grep launchable-activity
aapt 通常在android sdk的 build-tools目录下
windows中将grep换成findstr
"apk"是apk文件路径