debug技巧
通过进程信息,检查内存泄露
原理: 在linux 的 /proc 目录下, 有与系统进程同名的目录, 其中有此进程的各种相关信息. 通关查看这些信息,获取就能找到问题线索.
- 找到要调试的进程pid
ps -elf | grep [pname] - 查看内存使用情况
cat /proc/[pid]/status - 打印时间戳和内存占用
clear;date;cat /proc/[pid]/status | grep VmData;sleep 3;echo "######";date;echo "######";cat /proc/[pid]/status | grep VmData - 查看进程当前使用的文件句柄
ls -anl /proc/[pid]/fd
lua 单元测试 工具 (busted)
linux系统分析工具
web 调试
weinre
weinre with https
通过ngrok使weinre支持https
jsconsole
jsconsole更专注于console.log和数值运算。使用起来比weinre更简单
#ngrok
可以代理任意一个web server,并提供一个新的域名, 支持https;
whistle
doc
whistle是基于Node实现的跨平台web调试代理工具,可以作为普通的http代理或者用来抓包、修改、操作http、https、websocket、tunnel请求。
内部封装了weinre.
支持https.
spy-debugger
spy-debugger原理是集成了weinre,简化了weinre需要给每个调试的页面添加 js 代码。spy-debugger原理是拦截所有 html 页面请求注入weinre所需要的 js 代码。让页面调试更加方便
github
#微信清除浏览器缓存
设置==>退出登录==>重新登录
fiddler
charles
chrome 浏览器
chrome://inspect 页签可对安卓手机上的chrome浏览器进行调试
可配置host文件, 无需翻墙即可调试
61.91.161.217 chrome-devtools-frontend.appspot.com
61.91.161.217 chrometophone.appspot.com
[webgl inspector插件]
adb 查看手机内存
adb shell top -m 10 查看当前系统进程前十位
adb shell top -t -m 10 查看当前系统线程前十位
游戏内预留输入面板,可动态执行代码, 用于查看信息
由后端协议控制面板开放。
eval执行,alert显示信息
h5 测试
http://teamcapybara.github.io/capybara/
https://www.seleniumhq.org/
https://github.com/ariya/phantomjs