简体   繁体   English

当应用程序在iPhone上运行并连接到xcode时捕获网络流量

[英]Capturing network traffic while the application is running on iPhone and connected to xcode

Is there any way I can capture network traffic (using application like Ethereal, on Mac ) while the application is running on iPhone and connected to xcode 当应用程序在iPhone上运行并连接到xcode时,有什么方法可以捕获网络流量(使用Mac上的Ethereal这样的应用程序)

Thanks 谢谢

Connect you mac using an ethernet cable. 使用以太网电缆连接Mac。 Share your network connection on the mac over your AirPort. 通过AirPort在Mac上共享网络连接。 Attach the iPhone to your Mac's ad-hoc network. 将iPhone连接到Mac的临时网络。

Run Wireshark or HTTPScoop on your mac and you will be able to see all traffic from the iPhone. 在Mac上运行Wireshark或HTTPScoop,您将能够查看来自iPhone的所有流量。

I'm no aware of any way to do this for the WAN connection though. 不过,我不知道有什么方法可以进行WAN连接。 I'd be surprised if it is possible. 如果可能的话,我会感到惊讶。

To capture packets from your iPhone using Wireshark, you have to first get your device id for the phone from iTunes. 要使用Wireshark从iPhone捕获数据包,必须首先从iTunes获取手机的设备ID。 Plug in your iPhone via USB to your Mac...then open iTunes and click the iPhone icon in top navbar. 通过USB将iPhone插入到Mac ...然后打开iTunes,然后单击顶部导航栏中的iPhone图标。

在此处输入图片说明

You can't copy the UUID, so you have to write it down manually. 您无法复制UUID,因此必须手动将其写下来。 After you have the UUID, you'll need to mount the device. 拥有UUID之后,您需要安装设备。

Open a terminal and type: rvictl -s <device-id> 打开一个终端并输入: rvictl -s <device-id>

I created an alias in ~/.bash_aliases as alias mntios='rvictl -s <device-id>' -- as long as you have the same phone your device UUID won't change, even if you re-install the OS. 我在~/.bash_aliases创建了一个别名,作为alias mntios='rvictl -s <device-id>' -只要您拥有的手机相同,即使重新安装操作系统,设备的UUID也不会更改。

Once you have the device mounted startup wireshark. 安装设备后,启动wireshark。 brew install wireshark (see: http://brew.sh ) brew install wireshark (请参阅: http : //brew.sh

One of the network adaptors should be rvi0 -- this is the network interface for your iPhone. 网络适​​配器之一应该是rvi0这是iPhone的网络接口。

Now you can capture packets -- double click it to start capturing. 现在您可以捕获数据包-双击以开始捕获。

If you want to filter for specific urls you can type a filter like: http.request.full_uri contains <string-in-url> to filter requests. 如果要过滤特定的URL,可以键入类似以下的过滤器: http.request.full_uri contains <string-in-url>来过滤请求。

On your computer, run an HTTP debugging proxy like Charles (Mac) or Fiddler2 (Windows). 在您的计算机上,运行HTTP调试代理,例如Charles (Mac)或Fiddler2 (Windows)。 In the phone's wi-fi settings, turn on the HTTP proxy, entering your computer's IP address and the port number of the proxy. 在手机的wi-fi设置中,打开HTTP代理,输入计算机的IP地址和代理的端口号。 Make the sure the proxy is configured to allow connections from your phone. 确保将代理配置为允许通过电话进行连接。 (It may allow localhost-only by default.) (默认情况下,它可能只允许本地主机。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS/Xcode:与之后打开已安装的应用程序相比,在连接到 Xcode 的情况下在 iPhone 上运行应用程序有区别吗? - iOS/Xcode: is there a difference between running the App on an iPhone while connected to Xcode compared to opening the installed App afterwards? 使用Fiddler捕获到iPhone的传入流量 - Capturing incoming traffic to IPhone with Fiddler 仅当 iPhone 与 xcode 连接时,后台任务才会运行 - Background task is running only when iPhone is connected with xcode Xcode应用程序在Iphone上运行但在Ipad上崩溃 - Xcode application running on Iphone but crashing on Ipad 在Xcode上运行应用程序时记录iPhone屏幕 - Recording iphone screen while running app on xcode 在Xcode 5中开发的iPhone应用程序,在iPad上运行时不显示图标和启动图像 - iPhone application developed in Xcode 5, not showing icon and launch image while running on iPad 在iPhone上以编程方式测量网络流量 - Measure network traffic programmatically on iPhone 从Xcode(和仪器)在iPhone上运行iPhone应用程序时出现问题 - Problem running iPhone application on iPhone from Xcode (and in Instruments) 在应用程序运行时下载并安装iphone中的字体 - to download and install font in iphone while application running 在应用程序运行时阻止 Iphone 中的呼叫 - Block calls in Iphone while application running
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM