简体   繁体   中英

Phonegap cordova.js on pc

I'm developing app with PhoneGap .

Most of the things I test on pc in normal browser rather than on my device .

But now I need to test things that uses cordova.js stuff that is not included in www directory. There is different cordova.js file for each platform so I'm not sure what to include to www index.html file so I can test in on pc?

Is it possible and am I doing it right?

I'm aware that cordova.js is included during building process, but I've found testing on pc useful and thats why I would like to include it (for development time at least)

Even if you add a cordova.js it will be useless without the native code it calls.

I don't think it makes any sence trying to test native functionnalities in your pc. You should really test either on real devices or in emulators.

You could have a look at ripple to be able to test cordova functions in chrome : http://emulate.phonegap.com/

But again, it will not replace testings in real devices (cordova tends to have different behaviours with each version of android for example)

You always want to make any changes in the base www folder. There should be a platforms folder , plugin folder and www folder in the root of the project. The reason you want to modify that www folder in the root of the project is because anytime you rebuild the application is clears out everything in the platforms folder

So for an example I have a platforms/ios and a platforms/android that contains a www folder inside of those as well but each time I run phonegap build android or phonegap build ios it recreates every file within those directories

So you'd want to make code changes in the root www folder and copy over the changes to the platforms/android/assets/www folder or platforms/ios/www then navigate to that directory in the browser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM