从 appium server 中的 log 日志提取的 adb 相关操作.
shell getprop ro.build.version.release
out:6.0
shell pm list packages com.xueqiu.android
out: package:com.xueqiu.android
wait-for-device
shell echo ping
shell dumpsys package io.appium.settings
out: more app infomation
shell getprop ro.build.version.sdk
out:23
包名/启动类
shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
-S是强行关闭app参数
shell am start -W -n com.xueqiu.android/.view.WelcomeActivityAlias -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000
appops set io.appium.settings android\:mock_location allow
install UnicodeIME-debug.apk
shell settings get secure default_input_method
out:io.appium.android.ime/.UnicodeIME
shell ime enable io.appium.android.ime/.UnicodeIME'
shell wm size
out:Physical size: 480x800
shell getprop ro.product.model
out:Samsung Galaxy S6 - 6.0.0 - API 23 - 1440x2560
shell getprop ro.product.manufacturer
out:Genymotion
shell am force-stop com.xueqiu.android
shell pm clear com.xueqiu.android
forward tcp:4724 tcp:4724
push 本地文件路径/手机设备文件夹路径
push /usr/local/lib/node_modules/appium/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar /data/local/tmp/
shell ps
out:
shell 2757 268 698820 59108 ep_poll f731dd75 S com.android.shell
u0_a61 2791 268 1209988 198016 ep_poll f731dd75 S com.xueqiu.android
u0_a61 2844 268 1114452 125092 ep_poll f731dd75 S com.xueqiu.android:pushservice
shell dumpsys window
out:
Surface: shown=true layer=21015 alpha=1.0 rect=(0.0,0.0) 480.0 x 800.0
Window #2 Window{b1145d7 u0 com.xueqiu.android/com.xueqiu.android.common.MainActivity}:
input keyevent 3 home键
input keyevent 4 back键