Skip to Navigation | Skip to Content



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]

To download the code and build the installer, go to http://github.com/phonegap/phonegap-iphone and read the README.md for build instructions. No binaries are provided at this time.

See screencast below:


Download the videos: MPEG4 / H.264 “.m4v” | Ogg Theora & Vorbis “.ogv”

Posted in PhoneGap | 16 Comments » | Add to Delicious | Digg It

This entry was posted on Thursday, October 29th, 2009 at 7:48 pm and is filed under PhoneGap. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

16 Responses to “Create an iPhone PhoneGap application in 2 easy steps”

  1. Jesse Says:

    Let me be the first to say: “Sweet!”
    Things just keep getting better, good work.

  2. Tweets that mention Shazron @ Nitobi » Blog Archive » Create an iPhone PhoneGap application in 2 easy steps -- Topsy.com Says:

    [...] 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 [...]

  3. Cameron Perry Says:

    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.

  4. sintaxi Says:

    Fantastic work Shaz. This is getting better with each day.

  5. uberVU - social comments Says:

    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...

  6. shazron Says:

    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).

  7. shazron Says:

    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.

  8. Paul Says:

    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?

  9. shazron Says:

    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.

  10. Jonathan Stark Says:

    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.

  11. Jonathan Stark Says:

    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.

  12. shazron Says:

    My apologies for all the problems, seems to be a permissions error with when the PhoneGapLib is packaged. Investigating and fixing.

  13. shazron Says:

    The binary zip and link for the preview version download has been updated, build 20091103. This release fixes: (1) Folder permission problems (2) Failed to launch simulated application: Unknown error.

  14. patrick Says:

    wow…i just did this…is it really this easy to build native apps?

  15. shazron Says:

    I have removed the download link for the preview version, don’t want it to proliferate before the initial release maybe end of this week or so.

  16. shazron Says:

    This code has been merged into the trunk at http://github.com/phonegap/phonegap

Leave a Reply


Search Posts

Archives

Categories

Get Adobe Flash playerPlugin by wpburn.com wordpress themes