Saturday, December 20, 2008

How-To compile iPhone Project in Mac using Makefile instead of Xcode and fake codesign and then install to pwned iPhone

You can use the command line xcodebuild to build and install iPhone project such as

xcodebuild -target Project_Name
xcodebuild install -target Project_Name


Here is an example to compile iPhone Project using Makefile instead of XCode.

The Makefile will compile and codesign the binary using ldid (Intel binary version) and then install the files directly to iPhone /Applications/ folder using ssh

Location of files
----------------
Classes : source code (.m .c .cpp etc)
Resources : png file and other support files
Project folder : *.xib Info.plist

(1) First you need to download this sample zip file and extract it to your Mac and cd to the directory


curl -O http://www.iphone.org.hk/attach/48150-PeoplePickerDemo.zip
unzip 48150-PeoplePickerDemo.zip
cd PeoplePickerDemo


(3) Change the IPHONE_IP in the Makefile to the IP address of iPhone, default is 10.0.2.2


Makefile: Select all

IPHONE_IP=10.0.2.2

SDKVER=2.0
SDK=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(SDKVER).sdk

CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-g++-4.0.1
LD=$(CC)

LDFLAGS += -framework CoreFoundation
LDFLAGS += -framework Foundation
LDFLAGS += -framework UIKit
LDFLAGS += -framework CoreGraphics
LDFLAGS += -framework AddressBookUI
LDFLAGS += -framework AddressBook
//LDFLAGS += -framework QuartzCore
//LDFLAGS += -framework GraphicsServices
//LDFLAGS += -framework CoreSurface
//LDFLAGS += -framework CoreAudio
//LDFLAGS += -framework Celestial
//LDFLAGS += -framework AudioToolbox
//LDFLAGS += -framework WebCore
//LDFLAGS += -framework WebKit
//LDFLAGS += -framework SystemConfiguration
//LDFLAGS += -framework CFNetwork
//LDFLAGS += -framework MediaPlayer
//LDFLAGS += -framework OpenGLES
//LDFLAGS += -framework OpenAL

LDFLAGS += -L"$(SDK)/usr/lib"
LDFLAGS += -F"$(SDK)/System/Library/Frameworks"
LDFLAGS += -F"$(SDK)/System/Library/PrivateFrameworks"

CFLAGS += -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/"
CFLAGS += -I"$(SDK)/usr/include"
CFLAGS += -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/include/"
CFLAGS += -I"/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(SDKVER).sdk/usr/include"
CFLAGS += -DDEBUG -std=c99
CFLAGS += -Diphoneos_version_min=2.0
CFLAGS += -F"$(SDK)/System/Library/Frameworks"
CFLAGS += -F"$(SDK)/System/Library/PrivateFrameworks"

CPPFLAGS=$CFLAGS


(4) install respring utility in iPhone
make install_respring

(5) run make and make install
make
make install


(6) Test launch the app Demo in iPhone
.
.
.

In order to avoid typing the password using ssh, you can install the ssh public key of your Mac to your iPhone using the following method

(a) keygen in Mac terminal and type (if you haven't generated it before)
ssh-keygen -t rsa

You will be asked to enter a passphrase, please remember that if you enter that.

(b) create .ssh directory in iPhone (assume ip address of iPhone is 10.0.2.2) and in Mac terminal and type
ssh root@10.0.2.2 'mkdir -p .ssh'
then enter iPhone root password (alpine)

(c) copy mac public key to iPhone, and in Mac Terminal type
cat ~/.ssh/id_rsa.pub | ssh root@10.0.2.2 'cat >> .ssh/authorized_keys'
then enter iPhone root password (alpine)

(d) Edit the file /etc/ssh/sshd_config in iPhone

change these

#StrictModes yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys


to


StrictModes no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys


(e)reboot iPhone

If you don't reboot, you can restart sshd using

cd /Library/LaunchDaemons/
launchctl unload com.openssh.sshd.plist ; launchctl load com.openssh.sshd.plist



To compile ldid in Power PC, do this


wget http://svn.telesphoreo.org/trunk/data/ldid/ldid-1.0.476.tgz

tar -zxf ldid-1.0.476.tgz

# this patch is for PowerPC only
wget -qO- http://fink.cvs.sourceforge.net/viewvc/*checkout*/fink/dists/10.4/unstable/crypto/finkinfo/ldid.patch?revision=1.1 | patch -p0


cd ldid-1.0.476

g++ -I . -o util/ldid{,.cpp} -x c util/{lookup2,sha1}.c

sudo cp -a util/ldid /usr/bin







30 comments:

Anonymous said...

Hi,

I've downloaded your example source code and it works perfectly.

After that I've copied your Makefile to my simple project. It has compiled ok and then copied to the iPhone.

I can see my application icon in iPhone but it doesn't work.

Could you help me? What's wrong?

javacom said...

You have to amend the Info.plist in your project
there are changes in those variables
e.g. change ${EXECUTABLE_NAME}
to your actual executable binary name

Anonymous said...

I've done this.

I've done following changes:
<key>CFBundleDisplayName</key>
<string>WSEStock Test&lt/string>

<key>CFBundleExecutable</key>
<string>WSEStock</string>

<key>CFBundleIdentifier</key>
<string>com.yourcompany.WSEStock</string>

<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>

<key>CFBundleName</key>
<string>WSEStock</string>


What I'm doing wrong?

javacom said...

when you do the "make install"
it will codesign the binary by using ./ldid_intel
please check whether there is any error in this codesign step

Anonymous said...

This looks great, if only I had a MAC... :-) On the other hand, I followed your post on how to install the toolchain on Linux (Ubuntu 8.10), and it works like a charm! I am still a noob with all this iPhone development, so I was wondering whether this Makefile you are posting here can be altered to work with the toolchain for Linux? And specifically is there an ldid executable on Linux platforms?
Thanks for all the good info!

javacom said...

In fact I have added the instruction of installing ldid in Linux in that article recently

extract as below:

Install ldid in Linux, so that you can fake codesign it

cd ~/Projects
wget http://svn.telesphoreo.org/trunk/data/ldid/ldid-1.0.476.tgz
tar -zxf ldid-1.0.476.tgz
cd ldid-1.0.476
g++ -I . -o util/ldid{,.cpp} -x c util/{lookup2,sha1}.c
sudo cp -a util/ldid /usr/bin


If you need to codesign the iPhone binary in Linux add this to your build script

export CODESIGN_ALLOCATE=/usr/toolchain2/pre/bin/arm-apple-darwin9-codesign_allocate; ldid -S $(PROJECTNAME)

Anonymous said...

Thanks for the prompt reply. I followed your instructions on compiling ldid under linux (compilation went smoothly) and I tried it on a little "Hello World" application. I get the following error message:
util/ldid.cpp(427): _assert(2:false)
util/ldid.cpp(432): _assert(0:WIFEXITED(status))
Trace/breakpoint trap

I tried to look at the source code to see if this something simple I can figure out, but... it isn't obvious to me. Any help would be much appreciated. BTW, using ldid on my iPhone fake-signs this same HelloWorld Apllication, and it runs.

Another question, if I may... I am trying to modify the Makefile you provided to comply with the Linux iPhone toolchain you provided in an earlier post (same one where the ldid now appears). I couldn't figure out which directory should I replace this one (as it appears on the Mac Makefile):
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(SDKVER).sdk/usr/include

Or should I just remove it as there is no iPhone simulator for linux?
Thanks again for all the info you are providing for novices like myself.

javacom said...

You can try this MakeFile in Linux

# Makefile for gcc compiler for Linux iPhone toolchain (SDK Headers)

PROJECTNAME=HelloWorld
APPFOLDER=$(PROJECTNAME).app
INSTALLFOLDER=$(PROJECTNAME).app

IPHONE_IP=10.0.2.2

SDK=/usr/toolchain2/sys
CC=/usr/toolchain2/pre/bin/arm-apple-darwin9-gcc
LD=$(CC)
LDFLAGS += -arch arm -lobjc
LDFLAGS += -framework CoreFoundation
LDFLAGS += -framework Foundation
LDFLAGS += -framework UIKit
LDFLAGS += -framework CoreGraphics
//LDFLAGS += -framework QuartzCore
//LDFLAGS += -framework GraphicsServices
//LDFLAGS += -framework CoreSurface
//LDFLAGS += -framework CoreAudio
//LDFLAGS += -framework Celestial
//LDFLAGS += -framework AudioToolbox
//LDFLAGS += -framework WebCore
//LDFLAGS += -framework WebKit
//LDFLAGS += -framework SystemConfiguration
LDFLAGS += -isysroot $(SDK)
LDFLAGS += -F"$(SDK)/System/Library/Frameworks"
LDFLAGS += -F"$(SDK)/System/Library/PrivateFrameworks"
LDFLAGS += -bind_at_load
LDFLAGS += -multiply_defined suppress
LDFLAGS += -march=armv6
LDFLAGS += -mcpu=arm1176jzf-s

CFLAGS += -isysroot $(SDK)
CFLAGS += -DDEBUG -Wall -std=c99
CFLAGS += -Diphoneos_version_min=2.0

BUILDDIR=./build/2.0
SRCDIR=./Classes
RESDIR=./Resources
OBJS+=$(patsubst %.m,%.o,$(wildcard $(SRCDIR)/*.m))
OBJS+=$(patsubst %.c,%.o,$(wildcard $(SRCDIR)/*.c))
OBJS+=$(patsubst %.m,%.o,$(wildcard ./*.m))
RESOURCES=$(wildcard $(RESDIR)/*)
RESOURCES+=$(wildcard ./*.png)

all: $(PROJECTNAME)

$(PROJECTNAME): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $^

%.o: %.m
$(CC) -c $(CFLAGS) $< -o $@

%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

dist: $(PROJECTNAME)
rm -rf $(BUILDDIR)
mkdir -p $(BUILDDIR)/$(APPFOLDER)
cp -r $(RESOURCES) $(BUILDDIR)/$(APPFOLDER)
cp Info.plist $(BUILDDIR)/$(APPFOLDER)/Info.plist
@echo "APPL????" > $(BUILDDIR)/$(APPFOLDER)/PkgInfo
export CODESIGN_ALLOCATE=/usr/toolchain2/pre/bin/arm-apple-darwin9-codesign_allocate; ldid -S $(PROJECTNAME)
cp $(PROJECTNAME) $(BUILDDIR)/$(APPFOLDER)

install: dist
ping -t 3 -c 1 $(IPHONE_IP)
ssh root@$(IPHONE_IP) 'rm -fr /Applications/$(INSTALLFOLDER)'
scp -r $(BUILDDIR)/$(APPFOLDER) root@$(IPHONE_IP):/Applications/$(INSTALLFOLDER)
ssh root@$(IPHONE_IP) 'respring'
@echo "Application $(INSTALLFOLDER) installed"

uninstall:
ping -t 3 -c 1 $(IPHONE_IP)
ssh root@$(IPHONE_IP) 'rm -fr /Applications/$(INSTALLFOLDER); respring'
@echo "Application $(INSTALLFOLDER) uninstalled"

clean:
@rm -f $(SRCDIR)/*.o
@rm -rf $(BUILDDIR)
@rm -f $(PROJECTNAME)

Anonymous said...

Thanks for the Makefile!!
Sorry if I am repeating myself, but do you have any ideas on what are the errors the ldid output I mentioned on my earlier comment?
Thanks again.

javacom said...

this export and ldid command must be in one line and please make sure that the path of codesign_allocate binary is correct in your system

export CODESIGN_ALLOCATE=/usr/toolchain2/pre/bin/arm-apple-darwin9-codesign_allocate; ldid -S $(PROJECTNAME)

Anonymous said...

Hi!

Thank you for posting this alternative, as I have been trying to make my app work using different methods (MobileInstallation, dpkg-deb, etc.) but nothing has worked. I have the late 2008 MacBookPro and unfortunately performed a firmware upgrade on my iPod and Mac OS. After many trials, I have come to the conclusion that the .app built (Device | Release) using XCode is not valid, although the icon is on the main menu and launches briefly (Only default.png is loaded, afterwhich the application exits.)

Now enough with the intro, I ran 'make' and got the following error:
/bin/sh: /Developer/Platform/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1: No such file or directory

I checked if arm-apple-darwin9-gcc-4.0.1 exists, and certainly, it did not. I was only able to find arm-apple-darwin9/4.0.1. Is this the same thing? If not, how can I install this?

Thanks,
chessplayer

javacom said...

You might have installed the iPhone SDK to other custom folder. Please change the path to your installation folder.

Anonymous said...

Hi!

Thanks javacom! I got it working. :) Really great advice!

I've tried uploading my test application (which works fine on the simulator) but does not work when uploaded to the device using the Makefile here. So instead, I tried uploading demo applications from Apple and other sites, for double-checking. Some demo apps worked while some did not. There's this particular app which I would like to run called TheElements application from Apple. Using the Makefile provided here, it did not compile properly. Hence the following sequence of events:

1) When I typed 'make' and 'make install' there was an error because TheElements app had no .xib file nor nib file. The UI elements in this demo app were being created dynamically.

2) Hence, I tried commenting out the Makefile's references to .xib and .nib to remove 'make install' errors. TheElements app was ssh'd properly but would just launch on SpringBoard, display its default.png then exit immediately.

3) I tried creating a "dummy" Main.xib for TheElements app, hoping that maybe, the app just needed a .nib file present. Using the unaltered Makefile, I uploaded the application again, but it still did not work.

4) Inside the Makefile, I tried to force 'ibtool' to output some warning/error messages during its creation of .nib from the .xib by commenting out the original

ibtool $< --compile $@

and replaced it with this one:

ibtool $< --errrors --warnings --notices --output-format human-readable-text --compile $@

During 'make install', I got the following (snipped) error message. I removed the xml tags due to problems in uploading comment)

com.apple.ibtool.errors
description
Illegal invocation. Try 'man ibtool' for more information.

make: *** [Main.nib] Error 1

I would like to ask the ff:
1) In the absence of an .xib or .nib file, how can we make an application run correctly on an iPod or iPhone using Makefiles?

2) Is it really possible for an .xib to be "malformed"? Since my own test application only displays 2 views with just a few text and 1 small .jpeg, I doubt that it's eating up so much memory on the device that it won't run properly. (Based on some forums, they say that memory limitations and unsupported APIs for the iPhone/iPod can cause the application to run well on a MacBook but not on an iPhone or iPod). Btw,the .xib of my test app and the dummy .xib of TheElements app were created using Xcode 3.1.

Thanks,
chessplayer

Anonymous said...

Hi!

My apologies, found the error for ibtool "Illegal invocation."

In my Makefile, I typed in '--errror' instead of '--error'.

Now, the 'make install' step works, but TheElements app icon does not appear on the SpringBoard, I assume it's because my .nib file is just a dummy one. TheElements apps is still supposed to create the UI elements programmatically, so I wonder how this can be fixed..

I would still like to ask for advice on the questions I posted earlier today, though..

Many thanks,
chessplayer

javacom said...

refer to this article for another SDK example UICatalog to use Makefile

http://iphonesdkdev.blogspot.com/2009/01/uicatalog-makefile-for-apple-sample.html

Anonymous said...

Hi,

I am new to iPhone development & was trying to compile this example, but getting errors:

Below is error log
--------------------
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 -c -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/" -I"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include" -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/include/" -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/include -DDEBUG -std=c99 -Diphoneos_version_min=2.0 -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks" -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/PrivateFrameworks" Classes/PeoplePickerDemoAppDelegate.m -o Classes/PeoplePickerDemoAppDelegate.o
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 -c -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/" -I"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include" -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/include/" -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/include -DDEBUG -std=c99 -Diphoneos_version_min=2.0 -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks" -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/PrivateFrameworks" Classes/RootViewController.m -o Classes/RootViewController.o
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 -c -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/arm-apple-darwin9/4.0.1/include/" -I"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/include" -I"/Developer/Platforms/iPhoneOS.platform/Developer/usr/include/" -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/usr/include -DDEBUG -std=c99 -Diphoneos_version_min=2.0 -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks" -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/PrivateFrameworks" main.m -o main.o
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1 -framework CoreFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework AddressBookUI -framework AddressBook -L"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/lib" -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/Frameworks" -F"/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/System/Library/PrivateFrameworks" -o PeoplePickerDemo Classes/PeoplePickerDemoAppDelegate.o Classes/RootViewController.o main.o
ld warning: in /usr/lib/crt1.o, missing required architecture arm in file
Undefined symbols:
"_OBJC_CLASS_$_NSURL", referenced from:
__objc_classrefs__DATA@0 in RootViewController.o
"__objc_empty_vtable", referenced from:
_OBJC_METACLASS_$_PeoplePickerDemoAppDelegate in PeoplePickerDemoAppDelegate.o
_OBJC_CLASS_$_PeoplePickerDemoAppDelegate in PeoplePickerDemoAppDelegate.o
_OBJC_METACLASS_$_RootViewController in RootViewController.o
_OBJC_CLASS_$_RootViewController in RootViewController.o
"_objc_setProperty", referenced from:
-[PeoplePickerDemoAppDelegate setNavigationController:] in PeoplePickerDemoAppDelegate.o
-[PeoplePickerDemoAppDelegate setWindow:] in PeoplePickerDemoAppDelegate.o
"__objc_empty_cache", referenced from:
_OBJC_METACLASS_$_PeoplePickerDemoAppDelegate in PeoplePickerDemoAppDelegate.o
_OBJC_CLASS_$_PeoplePickerDemoAppDelegate in PeoplePickerDemoAppDelegate.o
_OBJC_METACLASS_$_RootViewController in RootViewController.o
_OBJC_CLASS_$_RootViewController in RootViewController.o
"_OBJC_CLASS_$_NSNumber", referenced from:
__objc_classrefs__DATA@0 in RootViewController.o
"_objc_msgSend", referenced from:
-[PeoplePickerDemoAppDelegate applicationDidFinishLaunching:] in PeoplePickerDemoAppDelegate.o
-[PeoplePickerDemoAppDelegate applicationDidFinishLaunching:] in PeoplePickerDemoAppDelegate.o
-[PeoplePickerDemoAppDelegate applicationDidFinishLaunching:] in PeoplePickerDemoAppDelegate.o
-[PeoplePickerDemoAppDelegate dealloc] in PeoplePickerDemoAppDelegate.o
-[PeoplePickerDemoAppDelegate dealloc] in PeoplePickerDemoAppDelegate.o
-[RootViewController doSendEmail:] in RootViewController.o
-[RootViewController doSendEmail:] in RootViewController.o
-[RootViewController doSendEmail:] in RootViewController.o
-[RootViewController doSendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController sendEmail:] in RootViewController.o
-[RootViewController peoplePickerNavigationControllerDidCancel:] in RootViewController.o
-[RootViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:] in RootViewController.o
-[RootViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:] in RootViewController.o
-[RootViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:] in RootViewController.o
-[RootViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:] in RootViewController.o
-[RootViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:] in RootViewController.o
-[RootViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:] in RootViewController.o
_main in main.o
_main in main.o
_main in main.o
"_OBJC_CLASS_$_NSString", referenced from:
__objc_classrefs__DATA@0 in RootViewController.o
"_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
__objc_classrefs__DATA@0 in main.o
"_objc_msgSendSuper2", referenced from:
-[PeoplePickerDemoAppDelegate dealloc] in PeoplePickerDemoAppDelegate.o
-[RootViewController dealloc] in RootViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [PeoplePickerDemo] Error 1

--------------------
Please let me know what is wrong & what I am missing.

Thanks.

Buffer said...

Javacom, do you know anything about getting PrivateFrameworks to work for iPhone apps? I'm working on a research project which needs to access the Apple80211.Framework. Any help would be awesome!

javacom said...

Google search Apple80211 might reveal some headers for the old firmware. But I have no experience on this area.

Anonymous said...

Hi Javacom!

(In response to your 04 February, 2009 15:48 reply)
Thanks, it worked! :) Now I can upload almost any application (Sometimes I just have to change the path of the RESOURCES). I'm finding it odd that the SysSound and OalTouch apps from Apple don't behave as expected, i.e. SysSound plays a different sound from the one played in the simulator, while OalTouch doesn't play the sound.wav file at all in the device), but I guess that's a different problem altogether.

Many thanks,
chessplayer

Anonymous said...

When I run your Demo I get "The Application "Demo" cannot be opened"

This can be solved (and I didn't believe it myself) by installing a free app from the Appstore.

Anonymous said...

Hi, your example works perfectly but when I try to do it on my own application, make works but 'make install' returns error code 64, how do I overcome this? Thanks

Anonymous said...

When I run your Demo I get "The Application "Demo" cannot be opened"

firmware 2.2


help me

Anonymous said...

How to use it for an mobile substrate dylib?

Unknown said...

Hi. The blog explicitly mentions Intel-based architectures. It is also possible on PPC-based architectures using the fixed ldid package from www.finkproject.org.

javacom said...

Thanks for the fix

I have just compiled it in my PowerPC Mac Mini and PowerBook

raziiq said...

Thanks for this awesome guide. I was able to rum your app successfully in my iPhone (Firmware 3.0). I m using iPhone SDK 3.0 to develop my apps.

I have just developed a simple Hello World app and was trying to post that in my iPhone.

What i did was , i copied your MakeFile and respring_arm files into my Project Folder and then ran these commands.

make install_respring

make

make install

But i get Error 64 . what am i doing wrong, please help??

OHYEAH Movie Man said...

Hi,
I get the same error as raziiq, error 64. It worked fine for the application you provided but I get this error after "make install"
Any help?
Thanks for this by the way.

OHYEAH Movie Man said...

Hi, I get error 64 when I do "make install" It works fine for the app you provided though.
Here is the full output:
MatthewsMAC:HeadsUpUI Matthew$ make install
rm -rf ./build/3.1.2
mkdir -p ./build/3.1.2/HeadsUpUI.app
cp -r ./build/3.1.2/HeadsUpUI.app
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-pvX] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-pvX] source_file ... target_directory
make: *** [dist] Error 64

Any help appreciated.

OHYEAH Movie Man said...

Sorry for the triple post lol
I fixed it, I need to read better. I didn't put the files in the correct folders. Thanks again!

Unknown said...

Hi,

Do you have to jailbreak the iPhone to do all this?

I mean, after you compile the "Makefile" etc., can you install/transfer the App to an un-jailbroken iPhone?

Thanks,

Gary