Currently I am using the Phonegap CLI in 2 places; on a windows PC and on a mac. I use the CLI to create a project for each platform using the following command:
cordova platform add [android/ios]
At that point, I either open the project in the platforms folder with Android Studio or Xcode. Then I set it all up and publish the application following each platform's respective process.
Before the CLI, this was more or less the same process I was doing; maintaining 2 seperate native projects and publishing them. With the introduction of the CLI, I have just been using it to setup the native project and nothing more. Are there any problems with this approach (besides having to maintain 2 different sources)? I favored this approach because its what I have been doing in the past and I am familiar with using xcode and eclipse/android studio.
I know you can use Phonegap build now to maintain one source for a multiple platform project, but when I tried this my application did not function as intended across both platforms (errors in iOS). I scanned through the phonegap docs multiple times and it does say you can take this approach if you want, but reading through online posts from other phonegap users, it seems this approach is not as often used. Is this due to the fact that maintaining 2 different sources for the application is bad practice or because theres other issues with this approach?
Thanks!
Well, if it works for you, I don't think there is anything wrong with it. At least I would find it very annoying keeping up 2 separate sources for same purpose since it is Cordova and it's idea is to help to use one source for all platforms. I don't still quite though understand why do you need to keep 2 sources, since it generally is just the platform configuration etc. that is about the differ. Also in those rare cases, it is almost always to handle the differences on JavaScript level by making conditionals based on platform.
About PhoneGap Build, you didn't specify too exactly what was the actual problem. I am using PGB for all my projects and I just couldn't even think about using CLI anymore as it makes your life so easy. Sure there are flaws within it such as really bad documentation, some problems with plugins, lack of proper GitHub integration for building when certain branch receives push and the fact that Adobe owns it (they really suffer from being such a massive company with a lot of legacy stuff), but it still beats CLI. Please try it still, I promise to answer every question you post here about it that I can see!