Posts Tagged xcode

Using Apple’s XCode for open application development

When developing iOS application for jailbroken devices, you have to take care of many dirty details of application deployments on iOS.  In particular, you have to take care of creating and registering your own development certificate, as detailed below.

This is where IOSOpenDev comes into the game, this packages a set of XCode plugins that automates most of this process.  More than that : it also provides templates (aka empty project) to build your own Widgets, command line applications, SBSettings etc …

IOSOpenDev is a must use if you are serious about jailbroken app development on iOS.

But just for the sake of archiving – or if you want to do it manually, here is the process to code sign an application without using Apple’s provided certificate.

1/ generate self signed certificate using the Certificate Assistant in KeyChain Access application

2/ tell Xcode to use that identity

 

3/ change XCode signature method (and restart XCode)

marsu:Contents sst$ sudo cp Developer/Platforms/iPhoneOS.platform/Info.plist Developer/Platforms/iPhoneOS.platform/Info.plist.orig
Password:
marsu:Contents sst$ sudo /usr/bin/sed -i .bak 's/XCiPhoneOSCodeSignContext/XCCodeSignContext/' Developer/Platforms/iPhoneOS.platform/Info.plist
marsu:Contents sst$ ls Developer/Platforms/iPhoneOS.platform/Info.plist*
Developer/Platforms/iPhoneOS.platform/Info.plist      Developer/Platforms/iPhoneOS.platform/Info.plist.orig
Developer/Platforms/iPhoneOS.platform/Info.plist.bak

 

4/ create, compile and deploy your application
scp -r MyApp.app root@ip_address:/Applications

 

5/ restart SpringBoard (Respring) or reboot

 

Enjoy !

, , , ,

No Comments

Using MacPorts with Xcode 4.3.x

If you recently updated to the MacAppStore distribution of Xcode, you certainly noticed that the /Developer directory is not used anymore.  Xcode now lives in standard /Applications directory.

This confuses tools relying on Xcode, such as some MacPorts package relying on Xcode to compile code on your machine before installation.

For example :

---> Fetching archive for zlib
---> Attempting to fetch zlib-1.2.6_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/zlib
---> Fetching zlib
---> Attempting to fetch zlib-1.2.6.tar.bz2 from http://lil.fr.distfiles.macports.org/zlib
---> Verifying checksum(s) for zlib
---> Extracting zlib
Error: Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version').

(more line stripped for clarity)

This can be solved with a single command line terminal, to tell Xcode command line tools the new location of Xcode.

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/

I am still unsure this an Apple bug or a MacPort bug … I am keen to read your opinion about this.

Enjoy !

 

, ,

10 Comments

MacPort on Mac OS X Lion

If you have performed a fresh install of Mac OS X Lion or if you plan to install MacPort after having installed Lion, you will soon realize that the MacPort team does not distribute (yet) a Lion installer.  Snow Leopard installer will fail when detecting Lion.

Question is therefore : how to install MacPort on Lion ?  Answer : install it from the sources.

It might be scarry, but it is very easy, here are the details.

Preriquisite : install Aple’s development tool XCode.  It is freely available from the App Store (be patient it is a 3.5 Gb download)

  • Open a terminal
  • create a directory for the sources
mkdir macport.sources
  • Fetch the sources

cd macport.sources
sudo svn checkout http://svn.macports.org/repository/macports/trunk

  • Compile
cd trunk/base
sudo ./configure --enable-readline
sudo make install
  • Install
sudo make distclean
  • Change your profile to include MacPort in the PATH
vi $HOME/.profile
#!/usr/bin/bash
# MacPort
export PATH=$PATH:/opt/local/bin
  • Source your profile to include the changes
. $HOME/.profile

That’s it ! Easy as I promised.

You can now search for package with

sudo port list | grep <your search>

and install packages with

sudo port install <package name>

Enjoy !

, , , ,

5 Comments