How to Build iPhone SDK Based on Cygwin Development Environment on Windows

Source: Internet
Author: User

WindowsPlatformIPhone SDKBased onCygwinThe method for building the development environment is described in this article. Let's look at the detailed steps first.

1. Download prebuilttoolchain.rar and winChain 1.0.1.zip from http://code.google.com/p/winchain/website.

2. Decompress prebuilttoolchain.rar to the root directory of drive D. The decompressed directory is as follows:

3. Decompress winChain 1.0.1.zipand then run the winchain.exe program. This program requires the. net 2.0 environment. If an error occurs during running, the system prompts that the. net environment is missing, for example:

You need to first install. NET Framework v2.0.50727, this can be from the http://ishare.iask.sina.com.cn/cgi-bin/fileid.cgi? Fileid=2058162download. After downloading the file, you can run the winchain.exe program normally. After running, the interface is as follows:

4. Install the iphone Toolchain

Click "Browse", select the Directory d: \ preBuildToolchain to be decompressed in step 1, and click "Copy Toolchain Files into Place: move all files and directories under the \ preBuildToolchain directory to d: \ cygwin.

5. Install cygwin

Because of a bug in winChain 1.0.1, "Install Cygwin Environment" is still unavailable. The author of winChain said that the bug will be modified in version 1.0.2, but no release exists in version 1.0.2. At that time, I was confused about this problem for a while and thought that winChain could not be correctly installed. Later, I carefully read the description of winChain to find out that we only need to install cygwin in the next step. Run installcygwin.exe in the \ winChain 1.0.1 \ resourcesin the decompressed winChain 1.0.1.zip Directory, and then press "Next" to change the Root Directory column to D when "installation Directory" is selected: \ cygwin, this is because we extract preBuildToolchain to drive D. If we extract it to drive C, we do not need to modify it.

Click "Next" until you select to download the source, for example:

Enter http://www.cygwin.cn/pub/in the URL. Click "addmediawork" and click "Next". Then, cygwininstalls successfully!

6. Configure cygwin

Because cygwin is installed on disk d, you need to modify d: \ cygwin. bat file. Use the text editing tool to change c: To d: In this case, the iPhone Development Environment on Windows is complete.
7. Verify cygwin

Run d: \ cygwin. bat. The following interface is displayed. commands such as cd, ls, and dir are supported.

8. Verify the iPhone Development Environment on windows

The mongod: \ cygwin \ iphone-apps \ hello directory contains the following files:

HelloApplication. h Hello. m HelloApplication. m Info. plist makefile Hello. o HelloApplication. o hello.

Run d: \ cygwin. bat, enter cd/iphone-apps, cd hello, and then input make clean to delete the originally compiled file. Then input make to display the following interface:

Indicates that the compilation is successful. The hello file will appear in the hello directory. This file is an executable file that can be compiled on the iphone after compilation. plist File Uploaded to iphone hello. app directory, and then restart the phone to see the hello program. This indicates that the iPhone is successfully built based on the cygwin Development Environment on Windows !!

First download iphone-sdk-cygwin-3.0_iphonetw.rar

Size: 159 MB. After downloading, decompress the package to d :\.

First, we need to set the environment variables, use NotePad to open the profile file under d: \ cygwin \ etc \ and find

 

Add a red string and run the cygwin. bat file under the d: \ Cygwin folder to enter the development environment of cygwin. Next, we will use some simple Linux commands. If you are not familiar with these commands, use Google to query them. I will not describe them here.

If you see the hello folder on the cygwin screen, congratulations! Welcome to the iPhone creation world. For any programming language, let's write our first app helloworld on the iPhone!

Switch to the "hello" directory and you will find that there are currently eight files in the "hello" folder, I will introduce the functions and usage of these eight archives in the following column, the file list here shows that the directories and files you see in the Windows File Manager are the same, as shown in

/Opt/iphone/hello equals D: \ cygwin \ opt \ iphone \ hello

In addition, because the iPhone program is a descriptive language, we can directly write the code using a text processor (notepad or NotePad ++). Now we can open HelloApplication. m file:

You can change the above text to whatever you want. Here, you can change Hello world to My First iPhone Apps, and then archive the text before returning to the cygwin operation screen.

First, clear the existing temporary archives. Please go to the command column.

 

Then we start to compile and generate the formats of native software available for the iPhone.

 

If the compilation is correct, it will not generate any error message, and the process picture will be the same.

Congratulations, you have completed the first native program on your iPhone. Now you only need to upload your program to the iPhone.

There are eight files in the hello folder, some of which are the original code and some are the links and execution files generated after compilation. If you do not want to show your original code to others, then you must pick out the "necessary" file of the program.
Create a folder named hello. app and upload Hello and Info. plist to the Application directory of your iPhone.

After uploading, remember to modify the archive and folder permissions of hello. app. You must open the apply check in the lower left corner.

Next, Restart the iPhone (or use the Restart SpringBorard function in the SummberBoard), and you will be able to see the hello program you just uploaded on the desktop, because we have not specified a software diagram, so now you see a question mark. Please click it.

Perfect! Although currently, you can only select the upstream and downstream functions, this is an authenticIPhoneNative programs are there any Feel that is so touched? If you are really interested inIPhoneThere is still a long way to go after software development. For webmasters, they are still learning. Let's work together!

Summary:WindowsPlatformIPhone SDKBased onCygwinI hope this article will help you with the development environment setup method.

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.