If you’ve decided to venture into tweak development for your jailbroken device, you’ve probably noticed that you can create an application through NIC.pl. This instance template is used to create native iOS applications, but the tools provided are subpar at best restricting you to no easy interface builder, no Swift support, no autocompletion, and loosely bounded files. All of these problems can be solved by simply going through Xcode to create your project rather than stumbling over files generated by THEOS. In this guide, I’ll walk from creating your application in Xcode to installing the Debian file via SSH.

To start off, open Xcode and create a project as usual. I’m going to create a Single View Application, but all templates are supported. Any of the settings you decide to use when creating your project (including Swift development) is unrestricted as long as the iOS version you’re developing for supports it, so don’t be hesitant to experiment! Once you’ve created your project and saved it to the designated location, you’ll see your standard Xcode starter project including Storyboard files and your Assets.xcassets container! The benefits are becoming quite clear as to why you should use Xcode rather than the flimsy NIC.pl template.

I’m not going to walk you through how to build your application, but as a “proof” I’ll add a label to the screen in my Main.storyboard:

Now we need to tell Xcode to give us a(n) .ipa file. But before we do that, let’s ensure that our Deployment Target is set to a version equal to or below the devices you want to deploy to; otherwise the device won’t be able to run it. To change the Deployment Target, find your project in the file window, select your target application, and change it from the latest iOS version to the desired Deployment target; in my case I’ll change it to 8.0 so it’ll support my device on 9.0.2 as well as a number of devices on 8.4 and 8.4.1.

Exporting our .ipa file:

In Xcode, do Product > Archive Window > Organizer Find your application and press “Export…” Select iOS App Store Deployment Deselect “Include app symbols for your application to receive symbolicated crash logs from Apple” as this isn’t deployed through the App Store Deselect “Include bitcode” as your application won’t know what device it’s targeting through Cydia Press “Export” Finder will open with the .ipa file selected, go ahead and decompress this .ipa file using Archive Utility (or any other archive manager that supports .zip decompression) Copy the application within the Payload folder to a new folder on your Desktop, give this folder the name of your application Within this folder create two new folders: “DEBIAN” and “Applications” Move the application into the Applications folder Create a file named “control” in the DEBIAN folder

After completing these steps your folder structure should look something like:

|-MyApp |---Applications |-----MyApp.app |---DEBIAN |-----control 1 2 3 4 5 |-MyApp |---Applications |-----MyApp.app |---DEBIAN |-----control

Inside the control file I told you to make, you’re going to want to include the following:

Package: com.ZaneHelton.MyApp Name: My App Depends: mobilesubstrate Version: 1.0.0 Architecture: iphoneos-arm Description: This is a demo for building applications in Xcode and deploying through Cydia Maintainer: Zane Helton Author: Zane Helton Section: Apps 1 2 3 4 5 6 7 8 9 Package: com.ZaneHelton.MyApp Name: My App Depends: mobilesubstrate Version: 1.0.0 Architecture: iphoneos-arm Description: This is a demo for building applications in Xcode and deploying through Cydia Maintainer: Zane Helton Author: Zane Helton Section: Apps

Except customize each line for your own use, this is the bear minimum for control files, and a complete list can be found at: http://www.saurik.com/id/7

Now we need to convert this folder into a .deb file by doing the following:

Open Terminal Ensure you have dpkg-deb installed cd into your the enclosing folder containing the Applications folder and DEBIAN folder, in my case it’s the Desktop Run: dpkg-deb -Zgzip -b [folder name] replacing [folder name] with the folder containing your Applications and DEBIAN folder

We now have a .deb file in the directory we ran the command in, this .deb file can be installed on your device by transferring it through any means (SFTP, AFC 2, etc.) and installing it by SSHing into your device, finding the .deb file and running dpkg -i [filename].deb .

FAQ:

Q: My icon isn’t showing up on the home screen Run the uicache command through SSH

Q: My application crashes on launch Look at your system logs, it’s probably still running from when you debugged through Xcode so either kill the old process or reboot your device

