PhoneGap projects with a Mac

  1. Installing Phone gap:
    https://www.npmjs.com/package/phonegap#install
    But that does not work straight away:
    https://www.npmjs.com/package/phonegap#phonegap-command-not-found
  2. Old project has bower.json file.
    install bower
    install dependancies
    npm install -g bower
    # cd into directory with bower.json file (mostly the static folder)
    bower install
  3. Phonegap cli - install dependancies and build

    - cordova-plugin-inappbrowser has a changed name on npm.. (this is specific to this old project)
    - also, it seems config.xml is now outdated
    - package.json is now the standard and is the final file that determines what packages / dependancies need to be installed
  4. install xcode; accept tnc
    sudo xcodebuild -license

    If xcode not installed:
    xcode-select: error: tool \'xcodebuild\' requires Xcode, but active developer directory \'/Library/Developer/CommandLineTools\' is a command line tools instance\n
    Likely to see this error, when only cli tools are installed
  5. build for platform
    phonegap build ios
  6. Now open project in xcode (open the "project_name.xcodeproj" in xcode);
    try to build 
    run the project on an emulator
  7. If the project complains about Google-info plist file.
    - might need to generate and import the file
    - but if already generated: might have to first "add the file to project"
    - then drag it to resources (or may be sometimes it gets picked on its own from project root )
    - dragging to project root works most of the times.
  8. Creating .ipa
    https://stackoverflow.com/a/47940681
  9. Development on the browser
    http://docs.phonegap.com/references/phonegap-cli/serve/

Comments

Popular Posts