Create an iPhone PhoneGap application in 2 easy steps | October 29th, 2009
Based on Jesse’s work on PhoneGapLib, I created a PhoneGapLib installer that will install the lib unto your computer, but most importantly, it will set a Xcode global variable to allow the PhoneGap Xcode template to work. The PhoneGapLib installer will also install a PhoneGap Xcode template.
Creating a PhoneGap iPhone project has never been easier. This way also, if PhoneGap core is updated it will not affect your code. The main parts of the code should already be checked-in (see Jesse’s post for the url). This is a work in progress. [Updated: Download a preview version] See screencast below:
Download the videos: MPEG4 / H.264 “.m4v” | Ogg Theora & Vorbis “.ogv”
October 30th, 2009 at 12:55 am
Let me be the first to say: “Sweet!”
Things just keep getting better, good work.
October 30th, 2009 at 9:22 am
[...] This post was mentioned on Twitter by xno??? u???q, Shazron Abdullah. Shazron Abdullah said: Create an iPhone @phonegap application in 2 easy steps http://bit.ly/21N2Hi [...]
October 30th, 2009 at 9:51 am
This is a great idea! I think this will simplify the process quite a bit (though it’s already pretty easy to begin with).
What happens with backward compatibility when installing a new lib over an older project that relies on an older version of PG? I don’t imagine we’ll have many difficulties with incompatible code, but then again - this is software.
October 30th, 2009 at 10:09 am
Fantastic work Shaz. This is getting better with each day.
October 30th, 2009 at 10:15 am
Social comments and analytics for this post…
This post was mentioned on Twitter by Shazron Abdullah: Create an iPhone @phonegap application in 2 easy steps http://bit.ly/21N2Hi…
October 30th, 2009 at 10:16 am
That’s a good question. If there are major changes, I would think the lib and template will be versioned (eg the lib will install to PHONEGAPLIB20 for example, and the Xcode template will be a PhoneGap 2.0 based template).
October 30th, 2009 at 12:56 pm
I updated the blog post to include a download link to a preview version of the PhoneGapLib installer. Enjoy!
Note: That if you run it twice (just cos), it will say the installation failed. This is because the so-called “upgrade” can’t overwrite the Xcode template for some reason. First-time install should work.
October 31st, 2009 at 8:28 am
Setting the global variable did not seem to work for me, after setting it manually to “/Users/paul/Documents/PhoneGapLib” building worked. Trying to run gives me an error in the status bar:
“Error from Debugger: Failed to launch simulated application: Unknown error.”
libPhoneGapLib.a is marked red but I don’t get any errors whily building. Is there anything missing?
October 31st, 2009 at 9:49 pm
I will have to do more testing when I get back to work Monday. As for that error (I’ve had it happen to me too), just do a Clean and re-build (quit the Simulator also). Running it again should be ok.
November 2nd, 2009 at 10:30 am
Hey all!
FYI - I ran the installer as described here and created a project with the PhoneGap template. When the project window opened, the PhoneGap files were all flagged in red (missing) in the Groups & Files panel.
I navigated to Preferences > Source Trees and saw that the PHONEGAPLIB entry was not in the list. I added it as illustrated in the video:
Setting Name:
PHONEGAPLIB
Path:
/PhoneGapLib
After applying my changes and closing the preferences window, the files were still missing, so I went back into the Source Trees dialog and changed the PHONEGAPLIB path to:
~/Documents/PhoneGapLib
Bingo! Everything linked up.
HTH.
j
P.S. I’ve installed and uninstalled PhoneGapLib a few times, so some of the breakage behavior might have been my fault.
November 2nd, 2009 at 10:43 am
Doh! I just saw the comment from Paul above. I too am getting an error when I try to build and run.
Here is the message:
CpResource build/Debug-iphonesimulator/Kilo.app/VERSION “~/Documents/PhoneGapLib/VERSION”
cd /Users/jstark/Documents/Kilo
setenv PATH “/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -resolve-src-symlinks ~/Documents/PhoneGapLib/VERSION /Users/jstark/Documents/Kilo/build/Debug-iphonesimulator/Kilo.app
~/Documents/PhoneGapLib: No such file or directory
Command /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp failed with exit code 1
For the record, the “~/Documents/PhoneGapLib” directory does exist, assuming that the code is running as the logged in user. I even set the permissions on it to 777 to make sure it wasn’t a security issue.