The following instructional steps to accomplish this purpose are taken from:
http://iphonedevwiki.net/index.php/Xcode
My findings and actions are provided under each step.
1. Create a self-signed code-signing certificate with the name “iPhone Developer” on the “login” (default) keychain using Keychain Access.
- I took screenshots as I followed the above instruction.
- I left most fields blank or at their default value.
2. Open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist
(4.2 or below: /Developer/Platforms/iPhoneOS.platform/Info.plist
). You may need root permission.
- I'm using Xcode 4.6, so I opened the former
.plist
file.
3. Replace all occurrences of XCiPhoneOSCodeSignContext
by XCCodeSignContext
. There are three of them (XCode Version 3.2.4+).
- I made three modifications as the screenshots indicate.
4. Save the file and restart Xcode.
5. Make sure you have ldid on your Mac. Place a copy somewhere e.g. in /usr/local/bin
.
6. Create the a Python script ldid3.py right next to the ldid program. Make it executable. Fill it with:
#!/usr/bin/env python
from sys import argv
from subprocess import check_call
from os.path import basename, dirname, splitext, join
from tempfile import NamedTemporaryFile
app = argv[-1]
ldid_path = join(dirname(__file__), 'ldid')
obj_path = join(app, splitext(basename(app))[0])
if '-gta' not in argv:
check_call([ldid_path, '-S', obj_path])
else:
with NamedTemporaryFile('w+b', 0) as f:
f.write("""
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>get-task-allow</key>
<true/>
</dict>
</plist>
""")
check_call([ldid_path, '-S' + f.name, obj_path])
- I created a new plain text file and copy-pasted the above code into it.
- I saved this file as
ldid3.py
and stored it in the /usr/local/bin
directory.
- In terminal, ran
chmod 777 /usr/local/bin/ldid3.py
.
7. Open iPhoneCodeSign.xcspec
. This file can be found in [For Xcode 4.6: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneCodeSign.xcspec
]:
8. Change the entry in the file from calling codesign
to ldid3.py
.
- As per instruction official instruction, converted the spec file to plain text by typing in console:
sudo plutil -convert xml1 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneCodeSign.xcspec
- I opened the file with TextEdit.
- Replaced
<key>CommandLine</key><string>/usr/bin/codesign</string>
with <key>CommandLine</key><string>/usr/local/bin/ldid3.py</string>
.
9. Save the file and restart Xcode.
- I saved the file and quit TextEdit.
10. Create a file /var/mobile/tdmtanf
on the device, to enable Apple's "TDMTANF bypass" in installd (warning: doing so will also put you in a sandboxed GameCenter).
- I create an empty text file in Windows, named it
tdmtanf
, SSH'd into my iPod, uploaded it to /var/mobile/
, and reboot my iPod.
Now that all that is over with...
I open my existing Xcode project and hit Run. It works in the iOS Simulator without any problems.
I make sure that Code Signing is set to use the certificate set up in step 1.
I build the app (Project > Build). A success message follows.
I grab my app folder TicTacToe.app
from /Libary/Developer/Xcode/DerivedData/TicTacToe-cjgzmoxtflyegtfypsbxbuiuwxns/Build/Products/Debug-iphoneos/
and transfer it to my Windows machine to install onto my iPod.
In an attempt to install the app to my iPod, I drag TicTacToe.app
onto the applications section of iPhone Configuration Utility, but I received this error message saying that my app "is not a valid mobile application."
I have also tried manually installing the app using iFunbox and the AppCake app found in Cydia. Both fail.
As a point of interest, because as I've Googled around, I've noticed many people mention the importance of this: I do have AppSync installed. (Sorry for the huge screenshot. If I should take it down, please let me know!)
Conclusion
So despite following the instructions closely, several times, my app is not recognized by iPhone Configuration Utility as a valid app. I cannot install the app manually using programs like iFunbox, or Cydia apps like AppCake.
I suspect the app is indeed invalid, but having followed the instructions carefully, I'm not sure why.
Can anyone tell me why my app is not valid, and what I can do to fix this, besides coughing up money that is?
You don't need to pay for an Apple's developer want the $99 option for a store certificate, billing and general code signing certificates.
Your personal AppleID is good enough to sign apps in Xcode and load them on a limited number of devices (5 or so) from your Mac to get started with developing. Once you need TestFlight or want to make a signed app that is reviewed - you need to pay, but get started for free.
Here’s how I would undo a previous paid AppleID - you might need Apple Developer support to help you release your AppleID from the paid program if you are reusing the same AppleID (and I encourage always reusing the same and not making new accounts when you run into a hiccup like this).
Instead, delete all Xcode copies you might have installed earlier - whether they are from the Mac App Store or downloaded and then install Xcode 7 from the Mac App store:
Once it downloads, run the app and go to the settings:
- click Accounts
- click the + in the lower left and add an Apple ID
- enter a personal Apple ID, the one you use for the App Store is fine to reuse
- you're done
When you build an app for iOS, connect the iOS device and choose that AppleID to sign the app when asked.
Best Answer
Enterprise and other certificates have to be manually trusted on iOS 9 when they didn't have to on iOS 8 and earlier.
If you don't see "Profiles & Device Management" then your device needs to reinstall the app or get the appropriate profile from MDM / other enrollment. Also, if your network or system blocks any outbound traffic to Apple servers for time sync, OCSP/CRL or notarization checks, you will see errors or potentially have other challenges to run apps.