6

I am trying to use a single /www folder to write a phonegap app for both iOS and Android,

My folder structure is something like this :

Code/Android/Eclipse project files

Code/iOS/xCode project files

Code/www/index.html, phonegap.js,etc.

Now i am trying within eclipse to link to the external www folder, i have trier several methods including the one proposed here : How to link assets/www folder in Eclipse / Phonegap / Android project? without any success :

When starting the app in an android virtual device reports an error if the www folder containing the index.html is not actually in Android/Project/Assets/..

Any idea how to make this work with links? Or is there maybe a way to tell eclipse to copy files to a new location upon building the project?

Thank you

PS : I will be mainly on windows so symbolic links are not an option.

Community
  • 1
  • 1
user1135233
  • 105
  • 1
  • 6

2 Answers2

9

I have resolved the same issue on windows with following command:

cd c:\code\app\android\assets\

mklink /D www c:\code\app\www

This worked for me in Windows. On Mac you can either use xcode folder referencing or ln command for the same.

(edit 3/14/2013) Windows 7: Make sure to run the command prompt as administrator

Chicowitz
  • 5,759
  • 5
  • 32
  • 38
dhaval
  • 7,611
  • 3
  • 29
  • 38
  • +1 I am most likely to use this solution myself - but could you tell me why not use hard links? – Jeff Oct 05 '12 at 06:37
  • hard links are basically actual files, as the /www folder needs to be under the /assets for android or / for iOS, I can not use the same source for both, so had to keep the source one level up and use the simlink instead – dhaval Oct 05 '12 at 21:29
0

Another possible solution to this is to use SVN externals in each directory for iOS and Android to pull in a common WWW directory.

xdumaine
  • 10,096
  • 6
  • 62
  • 103