Open ryaa opened 9 years ago
Yup, that's about what's expected, unfortunately! The only platform you can develop iOS apps on, even when using a Cordova based framework, is OS X. Cordova requires Xcode command line tools to do the business, so you won't even be able to add the platform on a Windows machine.
See the relevant Cordova platform documentation: http://cordova.apache.org/docs/en/4.0.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide
Sorry!
It does not work on MacOS as well
Alexs-MacBook-Pro:src alex$ grunt platform:add:ios Running "platform:add:ios" (platform) task
/Volumes/BOOTCAMP/Git/SmartMeteoMobileApp/src/node_modules/cordova/bin/cordova.cmd: line 1: @node: command not found Warning: Task "platform:add:ios" failed. Use --force to continue.
Aborted due to warnings.
Execution Time (2015-03-28 08:04:00 UTC) loading tasks 59ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 69% platform:add:ios 26ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 30% Total 86ms
I'm wondering why it uses cmd on MacOS
Okay, but this time you got a different error! And you're right, it really shouldn't use the .cmd binary...
As far as can see, the grunt script determines which binary to use based on the process.platform nodejs global variable. If that says your platform is win32, then you get the .cmd commands, otherwise it goes with the linux variant. I'm guessing it might be wrong for you, because you have the project under a bootcamp folder. You could try running node -e 'console.log(process.platform)' in there to see if that's the case. You could also try cloning your repo under OS X, and seeing if you get the same problem there.
running node -e 'console.log(process.platform)' seems to show correct result - see below
Alexs-MacBook-Pro:src alex$ node -e 'console.log(process.platform)' darwin
Well, bummer... Sorry, I'm out of ideas then.
I could not make grunt platform:add:ios to work. However cordova platform add ios worked fine
Alexs-MacBook-Pro:src alex$ cordova platform add ios Adding ios project... iOS project created with cordova-ios@3.8.0 Installing "com.megster.cordova.bluetoothserial" for ios Installing "org.apache.cordova.device" for ios
grunt build:ios
or grunt build:android
those will not work on my Mac.
What the reason to wrap the build command with the grunt? Or just remove them if they won't work correctly.
Below is the error when I try to execute grunt platform:add:ios on Windows
PS C:\Git\SmartMeteoMobileApp\src> grunt platform:add:ios Running "platform:add:ios" (platform) task Creating ios project...
Aborted due to warnings.
Execution Time (2015-03-28 06:40:00 UTC) loading tasks 13ms ■■ 1% platform:add:ios 1s ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 99% Total 1s