I recently downloaded an xcode_4.3.20.for_lion.dmg file. When I installed xcode, I always indicated that the installation failed. I checked it online and changed the Mac date to 2012.1.1. The first time I wrote the IOS program, the program was quite simple. The alert event was triggered by a helloworld button.
Development Environment Mac 10.7.3 xocde4.3.1 ios5.1.x
Development procedure
1. Download and install xcode_4.3.20.for_lion.dmg
2. Run xcode
3. Create a single view application
4. After creation, double-click the mainstoryboard_ipad.storyboard file in the file to open the design interface.
5. Drag a round rect button control to the interface.
6. Modify the viewcontroller. h header file and add the code.
@ Interface viewcontroller: uiviewcontroller
{
Iboutlet uibutton * BTN;
}
-(Ibaction) btnpressed :( ID) sender;
7. Modify the viewcontroller. M file and add the code
-(Void) btnpressed :( ID) sender
{
Nslog (@" 33333333 ");
Uialertview * Alert = [[uialertview alloc] initwithtitle: @ "hello"
Message: @ "zhu"
Delegate: Self
Cancelbuttontitle: @ "OK"
Otherbuttontitles: Nil];
[Alert show];
}
8. Right-click the button added in view to add the association between touch up inside and btnpressed, referencing outlets and BTN respectively.
9. Virtual Machine Running Effect
10. If the following prompt is prompted during debugging on a real machine, xcode cracking is required.
12. Running the effect on the jailbroken Board
Note:
I. ios5.1.1 jailbreak steps
1. Download absinthe 2.0 and click jailbreak. The message "done, enjoy" is displayed! Jailbreak completed
2. Download appsync for iOS 5.0 + in cydia
Ii. xcode4.3.1 real machine debugging steps
1. Create a certificate
Utility-key string access-certificate assistant-create Certificate Name fill in: iPhone developer select let me overwrite these default values and then fill in the email address select code signature other default can be
2. Modify the sdksettings. plist file in the/applications/xcode. APP/contents/developer/platforms/iphoneos. Platform/developer/sdks/iphoneos5.1.sdk directory.
<Key> code_signing_required </key>
<String> Yes </string>
<Key> entitlements_required </key>
<String> Yes </string>
Yes to no
3. Modify xciphoneoscodesigncontext in info. PLIs in/applications/xcode. APP/contents/developer/platforms/iphoneos. Platform to xccodesigncontext
4. Execute the following code in the command prompt (networking required)
Mkdir/applications/xcode. APP/contents/developer/iphoneentitlements
CD/applications/xcode. APP/contents/developer/iphoneentitlements
Curl-O http://www.alexwhittemore.com/iphone/gen_entitlements.txt
MV gen_entitlements.txt gen_entitlements.py
Chmod 777 gen_entitlements.py
5. Disable xcode's Automatic Signature operation
6. Add a custom generated script, add a phase in build phases, add build phase in the lower right corner, click Add run script, and enter the following script
Export codesign_allocate =/applications/xcode. APP/contents/developer/platforms/iPhone OS. Platform/developer/usr/bin/codesign_allocate
If ["$ {platform_name}" = "iphoneos"] | ["$ {platform_name}" = "ipados"]; then
/Applications/xcode. APP/contents/developer/iphoneentitlements/gen_entitlements.py "My. company. $ {project_name} "" $ {built_products_dir}/$ {wrapper_name}/$ {project_name }. xcent ";
Codesign-F-s "iPhone developer" -- entitlements "$ {built_products_dir}/$ {wrapper_name}/$ {project_name }. xcent "" $ {built_products_dir}/$ {wrapper_name }/"
Fi
7. Connect to the iOS device and click product-build for-archiving to debug the device on the iOS device.
Gray when IOS devices are not connected
Iii. IPA generation steps
1. Click Show in finder.
2. Drag the file named after the project name in the Finder to iTunes.
3. Drag the app in iTunes to the desktop to generate an IPA file.
If you find anything unreasonable, need to improve the place, or you have any better implementation method mail contact 328452421@qq.com (qq perennial not online, mail contact) Zhu Xiao. Exchange with each other. Thank you.
Source http://download.csdn.net/detail/xiaoxiao108/4344399