I should note again that I just reposted it from an anonymous comment on a blog, I wasn't clever enough to spot those plist entries and change them :-)
How do I remove the self signing script and the wildcard developers certificate. Do you need to do this to build and go with just editing of the plist file.
How do I remove the self signing script and the wildcard developers certificate. Do you need to do this to build and go with just editing of the plist file.
There are two ingredients for build-and-go.
The first is that, by default, Xcode does not allow you to build an iPhoneOS application that is not signed with a valid certificate. You must bypass this in some way. Editing the plist acheives this.
The second is that the device itself checks the signature of applications at some key points, eg, installation (disabled via installd aka MobileInstallation patching) and debugging. That's what the self signing script is for: to make sure the application has a signature.
If you skip that step, you will not be able to debug your applications on device (predictive assumption, since I'm not inclined to verify my claim :-)
OK. I'm trying to install an ipa file onto a non jailbroken iphone os 3.0.1 with xcode 3.2. I have edited the sdksettings.plist file so that code singing and entitlements are set to no. I have also edited the info.plist file in the application so that it is set to don't code sign. I get an unknown error after it tries to install the files. There are reports that it is possible to self sign or bypass provisioning on a non jailbroken phone. the 3.1 jailbreak isn't out yet for the 3gs so any help would be appreciated.
Hi all, here's all what you need to do for enabling device debug on iPhone OS 3.1 and Xcode 3.2:
Change SDKSettings.plist (backup first)
- backup it first (terminal command)
sudo cp -p /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/SDKSettings.plist /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/SDKSettings.plist.bak
- now edit it (terminal command)
sudo pico /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/SDKSettings.plist
- edit instructions:
change DefaultProperties/CODE_SIGNING_REQUIRED and ENTITLEMENTS_REQUIRED - set to NO.
from now on, don't use code signing in project settings!
Turn off code signing in the project settings
Here's the gen_entitlements.py code, just save it as file somewhere.
Code:
#!/usr/bin/env python
import sys
import struct
if len(sys.argv) != 3:
print "Usage: %s appname dest_file.xcent" % sys.argv[0]
sys.exit(-1)
APPNAME = sys.argv[1]
DEST = sys.argv[2]
if not DEST.endswith('.xml') and not DEST.endswith('.xcent'):
print "Dest must be .xml (for ldid) or .xcent (for codesign)"
sys.exit(-1)
entitlements = """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>%s</string>
<key>get-task-allow</key>
<true/>
</dict>
</plist>
""" % APPNAME
f = open(DEST,'w')
if DEST.endswith('.xcent'):
f.write("\xfa\xde\x71\x71")
f.write(struct.pack('>L', len(entitlements) + 8))
f.write(entitlements)
f.close()
Insert new run script build phase in the project (project/new build phase/new run script build phase)
Make sure you set the right path to gen_entitlements.py
Code:
export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
/Users/tadija/Documents/Tutorialz/iPhone/DeviceDebug/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
Thanks to all the others in this thread who contributed to this solution.
I have changed that script so it shouldn't look for "ResourceRules.plist" (because in xcode 3.2 projects that file is missing), and that solved my problem.
I don't really know why this doesn't work for you, so I'll attach my file for you to try (maybe it can't just be copy/pasted & saved).
I can't get to this error, everything is working fine for me...
Doublecheck that you did all the steps I wrote..
Can someone post printscreen of whole error or maybe few printscreens with all the settings (SDKSettings.plist, xcode project settings, run script build phase) so I can compare them with mine?
ok, i got it, when you use a jailbroken iPhone and want to use XCode 3.1.2 and iPhone SDK 3.2.1 (guess it works with 3.0 too) you dont need the gen_entitlements.py and also you dont need the run script. Just change the values of CODE_SIGNING_REQUIRED and ENTITLEMENTS_REQUIRED in SDKSettings.plist to NO and install the installd patch on the iPhone through Cydia (it wont work without it). Then just run + go and your app is on your phone
knigge has reason, you dont need the gen_entitlements.py and also you dont need the run script.
Sorry for my backwardness friends.
In the same day of my last reply i got it too but, after this i need pay attention to other this.
But now, i will explain the procedures i needed to make it works:
- in the Properties of the project, inside the guide(tab) 'Build', switch the CODE_SIGN_IDENTITY to 'Don't Code Sign' and in his internal option select 'Any iPhone OS Device' and his value to 'Don't Code Sign' too. Save the project.
- before i make this alteration, i include some keys(PLIST_FILE_OUTPUT_FORMAT and PROVISIONING_PROFILE_ALLOWED) at the Info.plist in '/Developer/Platforms/iPhoneOS.platform/' and maybe makes some difference:
Anyway, im attaching my Info.plist for you to see.
This 2 changes made my XCode just install the app in Device, and in the time to make it run this error occurs:
"Error from Debugger: Error launching remote program: failed to get the task for process 261."
This error occurs to the Release and Debug modes but, before the error occurs the app is successfully installed and just need to be started by the icon on the SpringBoard of Device. I dont have installed the Installd (as knigge has recommended) perhaps this solves the problem, anyway, i will try to install and test again.
Ah, i cant remember if i made the CODE_SIGNING_REQUIRED and ENTITLEMENTS_REQUIRED changes in SDKSettings.plist, i really like to know the path to this file.
Just remembering: im using iPhoneOS 3.1.0 on my device(Pwned), iAtkOS 7.0 on my VAIO (a image of Leopard 10.5.7) and the XCode 3.1.4
---------------
FerrariX: I hope this procedure helps you, if not, please explain better what part of what I found out you would like to know.
If is the tutorial to the 2.0 fw version, here is the link: 246tNt's corner of web - iPhone stuff
---------------
Thanks for all friends! And sorry again for the backwardness - and for my english, send greetings from Brazil. =)
Hi all, here's all what you need to do for enabling device debug on iPhone OS 3.1 and Xcode 3.2:
[...]
[...]
[...]
Thanks to all the others in this thread who contributed to this solution.
o/
Tadija... Hvala, brat! Mnogo, mnogo!
Your solution works perfectly on Xcode 3.2.1 on OS X 10.6.2 and iPhone 3.0 JB!
(partly) Thanks to you I won't have to use VB6 to code that college project, but be able actually learn something that I can use in the real world!
So yeah, thanks a lot to you and the rest who made this possible!
Update: Still works after updating firmware to 3.1.2 (as expected). Thanks again Tadija!
Last edited by =qp=; 01-18-2010 at 04:36 PM.
Reason: Update
I edited info.plist
and the other one (code_sign, provisioning, etc)
I edited the settings in xcode
I have 3.1.2 and 3.2.1
This is the error message I get:
I remember doing this sort of this when 2.2.1 was around, and it was simple. Now, it obviously isn't.
I'm at the point where, when building, it says:
Code Sign error: a valid provisioning profile matching the application's Identifier 'com.yourcompany.blabla' could not be found
Any ideas with this??? Don't want to pay $99 when I'm still in the very early stages of learning these things.
Hey guys. The Gumball Tech article doesn't fully work. It will get you as far as loading the app onto the device, but it doesn't properly accomplish the debugger attaching. Here's the correct method:
credit to you guys, all the steps were here, they just weren't put together right.
The problem is that you have to disable Xcode code signatures entirely. legitimate but fake code signature seems to cause a segfault in whatever app you're trying to run as soon as the debugger tries to launch it. It'll run manually, but the debugger can never attach. On the other hand, using gen_entitlements.py is the correct route, those signatures don't cause the same segfault. However, in the current version of xcode, the run script build phase is executed before the CODESIGN, meaning that xcode just stomps on the script's signature.
Basically, you have to disable real signature then enable fake signature via that run script build phase. Then, assuming you have Installd Patch on your device, you're good to go.
I haven't been refreshing/testing my method for the past few weeks both because I've been studying abroad (which is time consuming) and because iOS 4 was so close to dropping anyway. The correct thing to do now is to not waste time and effort trying to get 3 to work. Just give it a while and a method for 4 will, I'm sure, get pieced together.