Install the iPhone app on a real machine without IDP

Source: Internet
Author: User
Tags install openssl sha1 macbook

I tried a lot of materials, so this article is not just reprinted.
I recorded all the methods and final steps.
If there are few or too old online materials
I tested it in IOS SDK 4.1.
Environment is
Mac OS X 10.6.4
IPhone 1, 1, whited00r 3.1.5 (firmware 3.1.3)
IOS sdks 4.1 final

After testing, neither method 1 nor method 2 can pass compilation.
The two methods cannot be combined.
Later, we found method 3.
Method 3 can finally be compiled. The release code is generated.
But after copying the data to the iPhone, you only need to execute the command and exit immediately.
When executed under SSH, killed is directly returned.
After checking whether the signature is correct or not, Springboard will directly kill it.
Tried to execute ldid on iPhone
However, the following error is returned:

codesign_allocate: for architecture armv6 object: ./test malformed object (unknown load command 4)
util/ldid.cpp(582): _assert(0:WEXITSTATUS(status) == 0)

Disable the iPhone certificate detection using the following method:
Sysctl-W security. Mac. proc_enforce = 0
Sysctl-W security. Mac. vnode_enforce = 0

======================================== Conclusion: really run your own app process ============================
1. Install OpenSSL and OpenSSH on the iPhone to facilitate subsequent connection operations. Of course, you can also use file management such as 91 to release the compiled program.

2. the default password for iPhone SSH is Alpine. Do not use passwd to change the password. directly modify the/etc/passwd file and backup file. The specific method is not mentioned here.

3. Modify the developer/platforms/iphoneos. Platform/developer/sdks/iphoneos [SDK version]. SDK/sdksettings. plist file and set the value of code_signing_required to No.

4. Open the project, select building item in info in the upper right corner of xcode, select release in configuration, and set "code signing-> code signing identity-> Any iOS device" to "Don't code sign ".

5. In this case, you can select device for the project to compile normally.

6. Upload the file. SCP is used here. You can use other methods.
Mac $ SCP-R [project name. app] root @ [IP address of your iPhone]/Applications

7. log on to the iPhone to give the program executable permissions and restart the springboard so that the program icons can appear.
Mac $ SSH root @ [IP address of your iPhone]
IPhone $ CD/Applications
IPhone $ chmod + X [project name. app]
IPhone $ killall springboard

8. Disable the iPhone validity check.
IPhone $ sysctl-W security. Mac. proc_enforce = 0
IPhone $ sysctl-W security. Mac. vnode_enforce = 0

9. The program is successfully executed.

======================================== Conclusion: test process =================================
1. Install OpenSSL and OpenSSH on the iPhone to facilitate subsequent connection operations. Of course, you can also use file management such as 91 to release the compiled program.

2. the default password for iPhone SSH is Alpine. Do not use passwd to change the password. directly modify the/etc/passwd file and backup file. The specific method is not mentioned here.

3. Modify the developer/platforms/iphoneos. Platform/developer/sdks/iphoneos [SDK version]. SDK/sdksettings. plist file and set the value of code_signing_required to No.

4. Open the project, select building item in info in the upper right corner of xcode, select release in configuration, and set "code signing-> code signing identity-> Any iOS device" to "Don't code sign ".

5. In this case, you can select device for the project to compile normally.

6. Download The ldid from Mac OS X. The following uses MAC $ to identify the commands executed on Mac, and iPhone $ to identify the commands executed on iPhone.
Mac $ wget http://svn.telesphoreo.org/trunk/data/ldid/ldid-1.0.610.tgz

7. decompress the package and compile it.
Mac $ tar-zxf ldid-1.0.610.tgz
Mac $ CD ldid-1.0.610
Mac $ g ++-I.-O util/ldid {,. cpp}-x C util/{lookup2, sha1}. c

8. Go to the [project directory]/build/release-iphoneos/

9. Use ldid to sign the application
Mac $ ldid-s [project name. app]/[project name]

10. Upload the file. SCP is used here. You can use other methods.
Mac $ SCP-R [project name. app] root @ [IP address of your iPhone]/Applications

11. log on to the iPhone to give the program executable permissions and restart the springboard so that the program icons can appear.
Mac $ SSH root @ [IP address of your iPhone]
IPhone $ CD/Applications
IPhone $ chmod + X [project name. app]
IPhone $ killall springboard

12. Execute the program on the iPhone and exit directly.

13. Search for and download the ldid from cydia on your mobile phone. log on to SSH and run
IPhone $ ldid-s [project name. app]/[project name]
Error

codesign_allocate: for architecture armv6 object: ./test malformed object (unknown load command 4)
util/ldid.cpp(582): _assert(0:WEXITSTATUS(status) == 0)

14. Find the official ldid method from cydia website
Check can only be disabled
IPhone $ sysctl-W security. Mac. proc_enforce = 0
IPhone $ sysctl-W security. Mac. vnode_enforce = 0

15. The program is successfully executed.

================================ Method 1: make your own certificate ============================
1. production certificate
Because all versions after xcode require that the application must have been deployed, you must
I spent $99 to join Developer Program (black). I didn't pay for the app store anyway. I just wanted to use it with my own certificate.

Open the key access tool (in the application program> tool Program ), create a certificate for the "iPhone developer" Name (do not change this name, otherwise you have to change it in the case)

Type-based selection "selected category names"
Renew your ICP filing information
The last option is stored in the system (not "Log on", otherwise it will not be found)
You have saved $99!

2. After the project is established, open the project setting and enter the following in user-defined settings:
Provisioning_profile_allowed = No
Provisioning_profile_required = No

3. open info. plist: This case mainly stores the Related Description of the application. Press add row on the right and add signeridentity = "Apple iPhone OS application signing" (the same is true, zookeeper does not seem to work)

11. select the desired device. Here we select device-iPhone OS 2.2. xcode will assist us in deploying the device, press "Allowed" (cannot press "Always Allowed") to launch your iPhone (Security Policy error may occur during the first run and then run again ).
)

===================================== Method 2: directly generate app ===============================
Development and installation environment Mac OS, and WiFi, iPhone or iPod Touch that has been jailbroken (cracked.
The SCP mentioned below is the terminal command of Mac OS.
Ssh, ldid, and chmod are the command lines for iPhone terminals. They need to be installed, cydia, and other tools.

To compile directly, an error message is displayed:
Codesign error: no certificate found in keychain for code signing identity 'iphone developer'

Next, we will skip the xcode signature check. open *. xodeproj is a file with the suffix (right-click to display the package content "show package contents"). Generally, three files are displayed and the project is opened in text mode. pbxproj file,
At this time, open the project file under *. xcodeproj is the file named "show package contents" (right click here and select "show package contents"). Search for the iPhone developer and delete the file. There are two parts in total, and save the file, re-compile xcode to generate the app. the generated result is in the build directory.

Copy the compiled release for device program to the iPhone
First enter the directory where MyApp. app is located, and then execute the following command
Siu-andrewde-MacBook: release-iphoneos siuandrew $ SCP-r MyApp. app root@192.168.0.2:/Applications
Prompt for Password
Root@192.168.0.2's password:
Then start copying.

After the copy is complete, log on to the iPhone again:
Siu-andrewde-MacBook: release-iphoneos siuandrew $ SSH root@192.168.0.2
Root@192.168.0.2's password:
Sign in and execute the signature
IPhone :~ Root # cd/Applications
IPhone:/applications root # ldid-s MyApp. APP/MyApp
The ldid step is very important. Note that-S should be capitalized and the signature should be completed patiently.

After the signature is complete, set the entire directory permission to 755.
IPhone:/applications root # chmod + x MyApp. app
This step is also required to set permissions, or use chmod-r 755 MyApp. app

The upload and signature are complete. If the iPhone has 91 shutdown assistant installed, log out and fix the icon. Otherwise, delete the installation. plist file on the iPhone.
IPhone :~ Root # rm/private/var/mobile/library/caches/COM. Apple. Mobile. Installation. plist
Then restart the phone to see the program icon.

Run your self-compiled app.

============================== Method 3: no signature app, use ldid =

If you are not an iPhone developer, but you happen to have a Mac and an iPhone, you happen to be an IT migrant worker who likes "Hello World, then you will definitely want to Hello world on your iPhone. Because you only play with tickets, you will certainly not get the iPhone Development Program. The official documents naturally do not have any information for your reference, at present, most of the methods for SDK versions on the network have been ineffective or confusing, so a simple description is provided:

Test environment: snow leopard 10.6.3 + xcode 3.2.2 + iPhone 3G (3.1.2 firmware)

Prerequisites: In xcode, there are already Hello World programs that can run normally on the simulator + the iPhone has been jailbroken + itself is a little white that has not been developed by the iPhone.

Solution: Build an application that does not require signature. Use ldid to forge a signature on the Mac and upload it to the iPhone through SSH.

Procedure:
Sudo VI/developer/platforms/iphoneos. Platform/developer/sdks/iphoneos [SDK version]. SDK/sdksettings. plist: set the value of code_signing_required to No. -This indicates that you do not need to sign the application when using this SDK build;
In xcode, change "info"-> "build"-> "release"-> "code signing identity" to "Don't code sign ", select "iPhone device-[SDK version] | release" as the build target, and the build should prompt no error. (In the first step, you need to restart xcode to take effect.)-In this step, an app without a signature is created, and the path is [project location]/build/release-iphoneos/helloworld. App.
Install ldid
Wget http://svn.telesphoreo.org/trunk/data/ldid/ldid-1.0.610.tgz
Tar-zxf ldid-1.0.610.tgz
CD ldid-1.0.610
G ++-I.-O util/ldid {,. cpp}-x C util/{lookup2, sha1}. c
Util/ldid The following is the ldid program we need to use to forge the signature.
Sign the program
Ldid-s [project location]/build/release-iphoneos/helloworld. APP/helloworld (note that the execution file under. App should be written here)
Upload the SSH file to the/applications of the iPhone. respring will see and use the helloworld application. (SSH should be installed during jailbreak. If not, it can be installed in cydia or rock, restart the iPhone without respring)

References:

Http://bbs.weiphone.com/read-htm-tid-222380.html

Http://www.blogjava.net/sealyu/archive/2010/09/14/331968.html

Http://blog.robaggio.net/2010/04/idpiphone.html

Http://techxter.com/62/code-signing-iphone-applications-using-ldid/

Http://www.saurik.com/id/8

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.