How to use phonegap developer app on ionic


#1

hey guys is there any way to use PhoneGap Developer App for ionic project ? if yes how ?
i have tried
ionic serve
it generated this but i can’t access it through developer app on my phone…
is there any method to change the http://0.0.0.0 to my IP address ?
Running dev server at http://0.0.0.0:8100

Running live reload server at http://0.0.0.0:35729

your help is appreciated thanks !


#2

I’m assuming you’re talking about the iOS/Android app that connects through a local proxy. I’ve been able to get this to work by using phonegap serve inside the cordova build folder (/www)

I also had to use a different port, since my server is running on the default port that phonegap uses, you can change this as expected: phonegap serve -p 4000


#3

Hi notmatt, thanks for your reply.
i have encounter this error when i tried your approach

[Error: project directory could not be found]
[error] project directory could not be found

may i know what is the difference between cordova build and ionic build ?
all I did just followed what the intrusction on http://ionicframework.com/

I build my app by using these commands

$ ionic start myApp tabs
$ cd myApp
$ ionic platform add ios
$ ionic build ios
$ ionic emulate ios

should i replace the ionic command to cordova in order to get it works ? if yes which part of the code/directory should i modify in order to get all the ionic build missing file into corodova build app.


#4

can anyone help me with this ?


#5

The terms ‘Ionic build’ and ‘cordova build’ are essentially same thing (correct me if I’m wrong, Mike), the www/ directory is what cordova uses to compile the app for iOS/Android devices. I’m not sure why you’re getting this error. I’ll try to re-create what you did and see what happens.


#6

Ah, what is missing is the .cordova directory which contains a config.json file, mine looks something like this:

{
    "lib": {
        "www": {
            "id": "com.myapp.namespace",
            "version": "0.0.1",
            "uri": ""
        }
    }
}

I’m a complete cordova noob but I believe it should be generated at some point… I’ll be honest and say I have no idea how.


#7

how come i don’t have any .cordova folder inside my root folder, am i missing something ?

or i’m using wrong commands ?

$ ionic start testApp sidemenu
$ cd testApp
$ ionic platform add android
$ ionic build android


#8

I don’t think those commands were intended to be used alongside the phonegap developer app. You could google around to figure out how to generate that folder or you could just create yourself and add the config.json file manually.


#9

Thanks for your time !
one last question, do you mind to tell me how you build your cordova/phonegap project with command and how you integrate it with ionic framework ?


#10

I’ve created a separate /app directory for my files (I use coffeescript and scss). http://imgur.com/v099k3P

And I customized the gulpfile from this repo: https://github.com/shedd/ionic_build_tools to build my assets from my app/ directory into the www/ directory

I develop locally using gulp serve and with the emulator using gulp build --run --ios

Another alternative is to use this generator: https://github.com/diegonetto/generator-ionic which people have had success with as well.


#11

I hacked my way there like this: I created the ionic “loyalty” demo project. Independently, I created a phonegap project. I built the phonegap project and made sure it came up on my phone running the phonegap developer app. Then I merged the loyalty project files into the phonegap project: I copied over everything that didn’t exist in the phonegap project, and I copied over everything in the www directory. Finally, I did an ionic build ios and a phonegap build ios, phonegap serve, and the loyalty app came up on my phone. It’s a hack, but I’m just starting out.

By the way, here is another way to do the same sort of thing: Go to http://apps.ionicframework.com/, you can upload your project there and then run it on your iPhone using an iPhone app called Ionic View (not sure if they have an Andriod yet), which is similar to the phonegap developer app.


#12

thanks ! , i guess ionic view is the solution


#13

It’s actually very easy. You just need to create a .cordova directory inside the app root.

$ionic start myApps
$ionic platform add ios
$cd myApps
$mkdir .cordova
$phonegap serve

#14

PERFECT!!! this is what is missing


#15

No actually its just a file > .cordova not a directory


#16

I don’t use the IP address that phonegap gave me, I use my own IP address