HRPlugin For Xcode released (with source code)

Source: Internet
Author: User

This plug-in introduced today is a collection of ideas I have developed on the IOS platform. I often feel that, in the development process, regardless of GOOGLE data search and SQL database query, regular expression testing, SVN, and so on, these frequent operations have delayed me a lot of time, it may even interrupt my thinking on the business and affect my understanding of the program.
I decided to create some tools by myself to avoid the impact of frequent switching of forms on developers' thinking.

Now, let's start with today's text!

The first thing to declare is that I suspect that Apple does not support developers to develop plug-ins for XCODE. However, without some underlying APIs, some plug-in functions cannot be implemented, these APIs may be modified or even removed in the next version. Therefore, I cannot guarantee that all XCODE versions can run this plug-in. The current XCode version is 4.6.2 (4H1003 ).


There are two ways to install this plug-in:
I: download the file (http://files.cnblogs.com/daizhj/HRPlugin.dmg.zip) in this link, double-click unzip, run the DMG file inside. Run the "install. command" file in the pop-up window to complete the installation.
II: Download the project source code (https://github.com/daizhenjun/HRXcodePlugin), and then open the Build with XCODE.

After the installation is complete, exit XCode completely (right-click the XCODE icon on the DOCK and select exit)

The following describes the running effect of the plug-in:



The following is an introduction:
The first is the search function. When a file is selected in the Code, such as NSRegularExpression:


Click GoogleSearch in the plug-in to start the browser. For example, the Stackoverflo keyword is added to the plug-in ):



You can also use BaiduSearch. However, since Baidu does not find any decent dry goods in most cases, this is not explained.


The SVN function is described below. First, use the command line or other methods to initialize the local version library and related user information (including passwords. Then you can use the following window to set the SVN path of the local source code:



In this way, you only need to put your project source code in this path, use XCode to open the relevant source code file, and perform operations such as modifying or adding files, you only need to click the SVN-related menu item operation in the HRPlugin menu. For example:


If there is a problem with the SVN settings or a problem occurs during the submission process, the plug-in will display the relevant error information to you, for example:




Likewise, you can complete GIT settings. In fact, during the writing of this plug-in, I have been using this plug-in to submit code to GITHUB. Almost no problems found (welcome to the feedback bug ).

Next, let's take a look at the support for the SQLITE database. Click "Sqlite Helper" in the plug-in menu to start the assistant.


It should be noted that when the assistant starts for the first time, you will be asked to select a local SQLITE database file. If no selection is made, the plug-in constructs an SQLITE file for you, add two tables, student and teacher, for example:


You can see that the table and its related structure information in the current database are listed on the left.

Enter the corresponding SQL script, for example, and click "run SQL:


The following table shows the records of the table, including the record just inserted. The input box also supports executing the selected SQL script, as shown below:


You can see that the result of "select * from teacher" is displayed here (Note: enter multiple lines of scripts, press "command or option", and then press the Enter key ).

In addition, this assistant also supports exporting table creation scripts and code generation (object-c, c #, and java languages are supported). You only need to right-click the corresponding table node:




Next, we will introduce the HTTP Proxy Server Function to facilitate the development of mobile client applications. Click "Http Proxy" in the plug-in menu to view its interface, for example:


It listens to HTTP requests on port 8000 of the current machine. For testing convenience, we can set the corresponding proxy service in Firefox, chrome, and safari to point to the local port 8000. Then, visit websites such as BAIDU in the corresponding browser, this interface displays the HEADER and other information of the local HTTP request, as well as the data obtained at the end of the website. This makes it easy for us to check whether the submitted and returned information is valid during the development process.

Of course, in the code, we can use it like this. For example, when using the third-party open-source software ASIHTTPRequest, set the corresponding proxy field:

// Manually set the proxy server NSURL * url = [NSURL URLWithString: @ "http://www.baidu.com"]; ASIHTTPRequest * request = [ASIHTTPRequest requestWithURL: url]; [request setProxyHost: @ "Wagner. 0.0.1"]; [request setProxyPort: 8000];

 


If it is in, it can be used as follows:

#! /Usr/bin/env pythonimport urllibimport sysimport getoptshortargs = 'f: t' opts, args = getopt. getopt (sys. argv [1:], shortargs) port = "8000" if (len (sys. argv) = 2): port = args [0] try: proxy = {"http": "http: // 127.0.0.1:" + port} f = urllib. urlopen ("http://www.baidu.com", proxies = proxy) # Add the proxy settings print 'HTTP header:/N', f.info () print 'HTTP status: ', f. getcode () print 'url: ', f. geturl () for line in f : Print line, f. close () failed T: print "proxy fails! "


The following information is available:



Finally, the uninstall function is as follows:




Well, today's content is here. If you have any ideas, you can propose them so that I can further improve them.

Source code: https://github.com/daizhenjun/HRXcodePlugin

Installation Package download: http://files.cnblogs.com/daizhj/HRPlugin.dmg.zip

 









Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.