IPhone Development Environment ConstructionIs the content to be introduced in this article, mainly about balancingEnvironment Construction, Which is detailed for friendsIphone DevelopmentFirst, let's look at the details.
1. Determine the Mac OS version
Version: Mac OS X version 10.5.5
- CPU: Processor 1 GHz PowerPC G4
- iPhone SDK:iPhone_sdk_for_iPhone_os_2.2.19m2621afinal.dmg
Note: Each IPhone SDK may be compatible with different Mac OS versions. This SDK supports Versions later than 10.5.3. In addition, different CPU configuration files for Intel and PowerPC are also different. For details, see the following section.
Important: the official iPhone SDK only supports Intel Mac with OSX 10.5.
2. Install the IPhone SDK
1. the suffix of the iPhone sdk is. dmg: double-click the file. In the dialog box that appears, click "skip". Three files are displayed, namely, About iPhone SDK.pdf and iphone sdk. mpkg, Packages. for example:
2. Double-click the iPhone sdk. mpkg and press Custom Install on "Macintosh HD,
This shows that the iPhone SDK is not optional and you don't know what the problem is. You don't have to worry about it. There are solutions below. We chose all the options, install all packages in the default path.
Note: The installation path of the Developer Tools essenessenpackage is/Developer by default). You must install the SDK in the same path when installing the iPhone SDK.
In fact, Xcode3.1 has been installed in this step.
3. Install the iPhone SDK.
Go to the Packages folder in the. mdg package, that is, the Packages folder in the first figure. Select the following five Packages to install them one by one. Each package name starts with iphone.
Note:
To install it in the same directory as Developer Tools essen, that is,/Developer
If it has been installed in another directory, you do not need to reinstall it. Go to the installation directory. The default value is/Platforms. Then copy the iPhone. platform and iPhone simulator. platform to/Developer/Platform. Be careful not to copy the entire/Platforms.
Currently, you cannot build an iphone project, even if it is built, it cannot be compiled. The following error occurs:
- No architectures to compile for (ONLY_ACTIVE_ARCH = YES, active arch = ppc, i386 VALID_ARCHS =)
Further configuration files are required.
4. Configure the ubuntures. xcspec File
Because the official iPhone SDK only supports Intel Mac with OSX 10.5 .. Therefore, you need to change the configurations of all intel.
Go
- /Developer/Platforms/iPhoneSimulator.platform/Developer/
- Library/Xcode/Specifications/
You will see three files, and modify the ubuntures. xcspec file.
Note: Do not use the copy internal Page code. manually enter the code because the webpage encoding is inconsistent.
The specific modification is as follows:
- (
- // 32-Bit
- {Type = Architecture;
- Identifier = Standard;
- Name = "Standard (iPhone Simulator: i386, ppc )";
- Description = "32-bit iPhone Simulator ubuntures ";
- ListInEnum = YES;
- SortNumber = 1;
- Real‑tures = (i386, ppc );
- Ubunturesetting = "ARCHS_STANDARD_32_BIT ";
- },
- // Old-style Debug
- {Type = Architecture;
- Identifier = Native;
- Name = "Native Architecture of Build Machine ";
- Description = "32-bit for build machine ";
- ListInEnum = YES;
- SortNumber = 101;
- Ubunturesetting = "NATIVE_ARCH ";
- },
- // G3
- {Type = Architecture;
- Identifier = ppc;
- Name = "Minimal (32-bit PowerPC only )";
- Description = "32-bit PowerPC ";
- PerArchBuildSettingName = "PowerPC ";
- ByteOrder = big;
- ListInEnum = No;
- SortNumber = 201;
- },
- // G4. This is the model of my server.
-
- {Type = Architecture;
- Identifier = ppc7400;
- Name = "PowerPC G4 ";
- Description = "32-bit PowerPC for G4 processor ";
- ByteOrder = big;
- ListInEnum = NO;
- SortNumber = 202;
- },
- // G5 32-bit
- {Type = Architecture;
- Identifier = ppc970;
- Name = "PowerPC G5 32-bit ";
- Description = "32-bit PowerPC for G5 processor ";
- ByteOrder = big;
- ListInEnum = NO;
- SortNumber = 203;
- },
- // Intel
- {Type = Architecture;
- Identifier = i386;
- Name = "Intel ";
- Description = "32-bit Intel ";
- PerArchBuildSettingName = "Intel ";
- ByteOrder = little;
- ListInEnum = NO;
- SortNumber = 105;
- },
- )
Note: Do not copy. You can only enter the above Code by hand. Otherwise, an error occurs !!
This completes the settings.
Simple Interface Builder project to implement Hello World.
Double-click/Developer/Applications/Xcoide. app
Remember to go To the shortcut bar hidden below to find the newly started Xcode, and then File-> new project.
Select View-Based Application.
Then, name the project.
Expand the Resources directory under Groups & Files and double-click MainWindow. xib. The xib Main Window and libery window will pop up. If not, you can use Tools to bring up the window. There are different controls in Libery. You can drag and drop them to the View window, click the selected control, and choose Tools> inspetor to open the Properties window and modify the control properties.
Then
- File->Save,Build->build and run.
Summary:IPhone Development Environment ConstructionI hope this article will help you with the introduction of this tutorial!