RSS
 

Build ipa file using XCode without provisioning profile

26 Dec

To develop an application for iOS devices one should first obtain a provisioning profile by joining the iPhone Developer Program (which costs $99). However, some simple tricks can be used to build self signed applications using Xcode, that can be installed on Jailbroken devices. The steps provided below explains the detailed procedure to build ipa files without developer certificate for Jailbroken devices. This is tested on Mountain Lion 10.8, Xcode 4.5 and iOS 6 SDK.

Steps to build ipa file using Xcode:
1. Create a self signed code signing certificate.

On Mac OS X, go to Keychain Access -> Certificate Assistant -> Create a Certificate. It opens the certificate assistant window. Enter name (in my case it is securitylearn.net) and select certificate type as Code signing. Check let me override defaults option. Hit continue until it creates the certificate.

OS X self signed certificate

After creation of the certificate, the keychain looks as shown in the image below.

Certificate in keychain1

2. Copy /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Info.plist to desktop. Edit the plist file and replace all occurrences of XCiPhoneOSCodeSignContext by XCCodeSignContext (3 places – defaultproperties, runtimerequirements, overrideproperties).

Before modification:

xcode info plist before modification

After modification:

xcode info plist after modification

3. Copy the modified Info.plist file to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/ directory and replace the existing file.
4. Close and Restart the XCode.
5. Create your project in the XCode and in the project target settings choose the certificate created in step 1 as the code signing identity. Project target settings are shown below.

xcode project code signing settings

6. Build the project for iOS device (Project->Build).
7. Build creates the .app file in the build/Debug-iphoneos folder.

Xcode build app

Default location for .app file is -
/Users/[user name]/Library/Developer/Xcode/DerivedData/[your app]/Build/Products/Debug-iphoneos/

xcode build directory

8. Create a folder named Payload and copy the .app file into it.

Payload folder

9. Archive the Payload folder. It creates Payload.zip.
10. Rename the Payload.zip to [app name].ipa. We have successfully created the ipa file without developer certificate and this can be installed on a jailbroken device using iPhone configuration utility.

This comes handy for pentesters as well, if they want to create vulnerable demo apps.

Update on 16-Feb-2013: To install self signed ipa on iOS 6 devices, (Thanks to Leo for sharing this info) 
1. Go to Cydia->Manage and add http://gdeluxe.com/repo as a source.

appsync cydia

2. Download and install AppSync for iOS 6.x from Cydia.
3. Now you can install the ipa file using the iPhone configuration utility.

 
 

Tags: , , , , , , , ,

Leave a Reply

 

 
  1. eliprodigy

    January 15, 2013 at 2:06 pm

    this not work i’m getting this error all time when i try to compily
    No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination.

     
    • satishb3

      January 15, 2013 at 2:52 pm

      Did you hit build & run menu or just build menu?

       
      • eliprodigy

        January 15, 2013 at 3:10 pm

        You beat me i come to edit my commant because it’s worked
        many thanks !!

        p.s
        do you know why i’m getting this msg when i’m trying to start the build from the button in the left corner
        (emulator works but ios device give me this error above)

         
  2. Moto

    January 22, 2013 at 8:20 pm

    Thanks for the guide I have been looking for a way for a day or two now. For some reason your images are not loading in FireFox… will try in another browser.

     
    • Moto

      January 22, 2013 at 8:21 pm

      N/M after I hit submit the images loaded… strange.

       
      • satishb3

        January 22, 2013 at 9:37 pm

        It might be an issue with caching plugin. I will look into it. Thanks.

         
  3. Jesús

    February 6, 2013 at 10:23 pm

    Hello¡ I’ve followed the steps and, when i’ve builded the project i don’t have the folder Debug-iphoneos. I’ve only Debug-iphonesimulator and Release-iphonesimulator.
    Is necessary to make a build for achieving?
    Thank you in advance

     
    • satishb3

      February 7, 2013 at 6:52 am

      Build the app for device not for the simulator. Then you will see iPhoneos folder.

       
      • vince

        February 9, 2013 at 3:50 am

        I did all the steps but when i go to iphone config tool to add/install the app it wont install. it gives me a signing error

        i have iphone 4 xcode 4.6 ios 6.1

         
        • satishb3

          February 9, 2013 at 6:57 am

          Is ur phone jailbroken?

           
          • vince

            February 9, 2013 at 3:02 pm

            Yes it is

             
          • satishb3

            February 10, 2013 at 5:38 am

            strange. Try this, from terminal run the below code sign command to sign the binary with the self created cert.

            codesign -fs “your Cert’ binaryfile

            After signing, convert the binary file to ipa file.

             
          • vince

            February 10, 2013 at 7:00 am

            so i would just open Terminal and type the code

            codesign -fs “myCerttitle” binaryfile

            and after doing that i click build in xocde to make it a .app then do the payload zip and rename thing?

             
          • satishb3

            February 10, 2013 at 8:01 am

            Thats wrong.
            Build .app file (ex:abc.app)
            Now copy the .app folder to desktop
            Inside .app file there is executable file (ex:abc) . We need to sign this executable binary.
            From terminal move to desktop, type
            codesign -fs “securitylearn” abc.app\abc

            (if ur cert name is not securitylearn change it accordingly).
            Then copy the .app into payload folder and create ipa.

             
          • vince

            February 10, 2013 at 7:35 am

            So i retried this tutorial again and the exact error it get from iphone config utility is “The identity used to sign the executeable is no longer valid”

             
          • vince

            February 11, 2013 at 2:00 pm

            So it seems i can install apps on my old ipad1 running iOS 5.0. but when i try to add apps to my iphone 4 with ios 6.1 untethered jailbreak with evasion they wont sign. Ive tried the way in this tutorial, ive tried with ifunbox, and ive tried using installipa from cydia

             
          • satishb3

            February 14, 2013 at 5:21 pm

            I will check out and update you if I find anything.

             
        • Leo

          February 15, 2013 at 12:43 pm

          I got the same error
          “The identity used to sign the executable is no longer valid”

          iPhone5 with iOS 6.1 evasion jailbreak.

          hope u could figure out the solution for this….. waiting for your good news.

           
          • Leo

            February 15, 2013 at 10:23 pm

            just found the solution.

            we need to install app sync for ios 6.x

            then should be able to install self developed app.

             
          • satishb3

            February 16, 2013 at 5:05 am

            you are awesome. Thank you. I will update the post.

             
  4. Jasmin

    February 19, 2013 at 6:22 pm

    Thank you so much, worked like a charm ! :-)

     
  5. Daniel Avram

    February 19, 2013 at 9:16 pm

    You my friend are a life saver. A billion thanks! :)

     
  6. Jasmin

    February 20, 2013 at 11:49 am

    I am not getting what to do with that iOS6 device..please tell me step by step.

    Thank you ! :-)

     
    • satishb3

      February 21, 2013 at 10:08 pm

      Updated steps for ios 6. Checkout

       
  7. Jonathan

    February 21, 2013 at 10:27 am

    I followed your steps from start to finish twice, and both times I am unable to install the IPA using iPhone Configuration Utility, or other methods such as AppCake. I get the following error: is not a valid mobile application. http://puu.sh/25YnA Any idea?

     
  8. Sun Vul

    March 5, 2013 at 6:47 am

    I am trying to install my app on JB iPhone 3gs ios6.1.2 and I keep getting this error “This application does not support this device’s CPU type.”. I did setup the supporting architecture to armv6 as mentioned in other posts on StackOverflow – No luck. What could I be doing wrong.

     
    • satishb3

      March 5, 2013 at 9:07 am

      May be edit the info.plist file and change the default build options. That might help.

       
  9. Fred

    April 10, 2013 at 1:46 am

    GOD I LOVE YOU GUYS…TOOK AGES BUT I DID IT…

     
  10. Felix

    May 5, 2013 at 12:31 am

    I follow the steps to the letter and worked perfectly to the first try.
    Thankssss.
    Ipad4/Mini, iOS 6.1.2 jailbroken.
    gdeluxe repo looks that it is dead, but AppSync for 5+ in Cydia woks OK.