storesafe / cordova-sqlite-storage

A Cordova/PhoneGap plugin to open and use sqlite databases on Android, iOS and Windows with HTML5/Web SQL API
Other
2.15k stars 715 forks source link

PhoneGap developer app integration #427

Open brodycj opened 8 years ago

brodycj commented 8 years ago

From this question: litehelpers/cordova-sqlite-ext#10

ref:

jcrowthe commented 5 years ago

I realize this is an old ticket, but I'd thought I'd share a workaround I've been successful with. In my case, I'm specifically using cordova-sqlite-ext in order to use preexisting databases, but this should work the same for the other variants.

There are just a few simple steps to take to get this working in a dev environment:

  1. Clone the Phonegap Developer app: https://github.com/phonegap/phonegap-app-developer This is already necessary for iOS (since Apple has removed the app from their App Store) in order to use the phonegap dev app on iOS. However, we're going to modify it slightly.
  2. phonegap plugin add cordova-sqlite-ext -- add the plugin to the phonegap dev app (NOT to your project app, but rather the phonegap dev app)
  3. (If using the -ext variant of this plugin) Copy your database into the www directory of the phonegap dev app
  4. phonegap build ios and phonegap run ios

At this point, on the iOS device (or simulator), use the phonegap dev app as normal. You'll need to run phonegap serve on your dev machine, then put in your machine's IP address/port to the phonegap dev app. Since this plugin (and optionally the preexisting database) already exist on the filesystem due to your adding them to the phonegap dev app, the app you're building should just detect this and use it.

I hope this helps others attempting to use Phonegap Developer app with this plugin. Cheers!