用 Wireshark 抓 iPhone 网络请求的数据包

开发过程中经常可能遇到网络问题,这时候我们需要抓包来定位问题所在。那么如何用 Wireshark 抓取 iPhone 真机网络请求的数据包呢?

iOS does not support packet tracing directly. However, if you’re developing for iOS you can take a packet trace of your app in a number of different ways:

If the problem you’re trying to debug occurs on Wi-Fi, you can put your iOS device on a test Wi-Fi network. See Wi-Fi Capture for details.
If your app uses HTTP, you can configure your iOS device to use a debugging HTTP proxy (such as Charles HTTP Proxy).
In iOS 5 and later you can use the remote virtual interface facility.

继续阅读

Web 开发问题汇总(一)

1. What is href=“#” and why is it used?

Solution:

1
2
3
4
5
6
A hashtag - # within a hyperlink specifies an html element id to which the window should be scrolled.  
href="#some-id" would scroll to an element on the current page such as <div id="some-id">.

href="//site.com/#some-id" would go to site.com and scroll to the id on that page.  

href="#" doesn't specify an id name, but does have a corresponding location - the top of the page. Clicking an anchor with href="#" will move the scroll position to the top.

Reference:http://stackoverflow.com/questions/4855168/what-is-href-and-why-is-it-used

2. How to debug your web page, technology stack is LAMP.

Solution:View log, figure out what cause problems.

1
2
3
4
$ tail -f /var/log/apache2/error_log
[Fri Dec 11 21:34:57.003657 2015] [:error] [pid 17465] [client ::1:50505] PHP Parse error:  parse error, expecting `','' or `';'' in /Users/dongmeiliang/Sites/knowledgeispower/includes/header.html on line 7
[Fri Dec 11 21:34:57.003701 2015] [:error] [pid 17465] [client ::1:50505] PHP Stack trace:
[Fri Dec 11 21:34:57.003723 2015] [:error] [pid 17465] [client ::1:50505] PHP   1. {main}() /Users/dongmeiliang/Sites/knowledgeispower/index.php:0
继续阅读

iOS 项目持续集成和部署笔记

本文是我做 iOS 项目持续集成和部署的笔记。

安装工具

  1. jenkins;

     $ brew update && brew install jenkins
    
  2. fastlane;

     $ sudo gem install fastlane --verbose
    
  3. fir-cli;

     $ sudo gem install fir-cli
    
继续阅读