如何给Android添加可视化工具,可视化实现在手机上抓包 方便调试 OkNetworkMonitor...
OkNetworkMonitor
一個(gè)基于 stetho 的 OKhttp 抓包工具,可以實(shí)現(xiàn)在手機(jī)上面的抓包,可以方便平時(shí)開發(fā)中的調(diào)試。
目前可以看到 請(qǐng)求頭、響應(yīng)頭、響應(yīng)數(shù)據(jù) 等,后續(xù)還會(huì)再增加。
使用
導(dǎo)入
implementation project(':lib-ok-network-monitor')
添加一個(gè)攔截器
new OkHttpClient.Builder()
.addNetworkInterceptor(new OkNetworkMonitorInterceptor())
配置 AndroidManifest.xml 文件
android:name="com.linkaipeng.oknetworkmonitor.ui.NetworkFeedActivity"
android:screenOrientation="portrait"/>
android:name="com.linkaipeng.oknetworkmonitor.ui.NetworkFeedDetailActivity"
android:screenOrientation="portrait"/>
跳到抓包頁(yè)面
NetworkFeedActivity.start(this);
截圖
LICENSE
Copyright 2015 linkaipeng
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
總結(jié)
以上是生活随笔為你收集整理的如何给Android添加可视化工具,可视化实现在手机上抓包 方便调试 OkNetworkMonitor...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言分配内存空间方法,C语言之动态分配
- 下一篇: Android WebView重定向问题