整理吧-Android测试

来源:互联网 发布:疯狂java讲义百度云 编辑:程序博客网 时间:2024/06/05 17:04

1. adb logcat
  a. priority(优先级别)
    i. V — 明细 (最低优先级)
    ii. D — 调试
    iii. I — 信息
    iv. W — 警告
    v. E — 错误
    vi. F — 严重错误
    vii. S — 无记载 (最高优先级, 在这个级别上不会打印任何信息


2. adb install
3. adb push
4. adb pull
5. 获取包名的方式
      a. adb shell dumpsys window w | findstr \/ | findstr name=
      b. appt dump bedging your-path -to-apk
PS:http://blog.csdn.net/jane1229/article/details/39937015

6. 无线调试
    a. adb tcpip 5555
    b. adb connect 192.168.203.238

7. 赋予包所需权限
    a. adb shell pm grant com.guoying.smscode android.permission.READ_SMS
    b. aapt d permissions /your-path/app-debug.apk

8. 清除数据
adb shell pm clear package-name
9. 端口被占用时的解决方法
    a. windows:
        i. netstat -ano | findstr "5037"
        ii. kill -9 pid
    b. mac:
        i. lsof -i:5037
        ii. kill -9 pid

10. 截图
    a. adb shell screencap /sdcard/a.png
11. 录视频
    a. adb shell screenrecord /sdcard/demo.mp4

PS:https://developer.android.com/studio/command-line/adb.html?hl=zh-cn

2、monkey 命令行
基本参数https://developer.android.com/studio/test/monkey.html
3、appium Android
1. 环境搭建
 2. Appium-doctor
 3. 获取h5 元素
 4. Uiautomatorviewer获取原生元素
 5. PS:
https://anikikun.gitbooks.io/appium-girls-tutorial/content/2_install_appium.html
https://github.com/appium/sample-code


4、Charles安装配置
1. 安装配置
      a. http://zhangmingwei.iteye.com/blog/2035602
  2. 限制网络
      a. ios自带限制网路:http://www.jianshu.com/p/6949c2ecb401

5、番外篇
  1. CPU 的查看
      a. http://blog.csdn.net/kittyboy0001/article/details/38562515
  2. 内存的查看
      a. https://my.oschina.net/shaorongjie/blog/128442
  3. 启动时间的查看
      a. adb shell am start -W -n your-pakcage-name/your-activity-name(需要root)
      b. 开发在程序里插log,adb logcat里看log
      c. 拿计时器,自己记时间

原创粉丝点击