问题
I started to develop ionic 2 cordova app on mac and doesn't update ios Application.
My pc specs are,
node v8.9.1
npm v5.5.1
cordova v7.1.0
ionic v3.17.0
editor VSCode
if I want some code change in ionic-v1 then I can edit platform -> ios -> www ->.js
files or platform -> ios -> www ->.html
files and reload xcode then changes appear on real device.
But in ionic 2 app platform -> ios -> www
folder contain minified files and cannot edit these files. so I follow this process but code doesn't change.
- Add ios platform to project using
cordova platform add ios
and run ios app on xcode. initial app runs fine - then go to
project -> src -> pages ->home ->home.component.ts
edit home.component.ts and home.component.html - run
cordova prepare
to add changes to ios platform - stop xcode and
clean->build->run
project again.. changes doesn't appear. - remove ios platform using
cordova platform remove ios
and readd it usingcordova platform add ios
then new changes are appear.
I develop ionic-v1 and ionic 2 apps on windows and those are working perfectly on device. what is the correct procedure to develop ionic 2 app on mac and dedug it correctly. any help could be appreciated. Thank you.
Edit Please note that I’m facing this issue in ionic 2 app run on my physical iPhone
回答1:
Step 3. is the problem. You are directly running cordova prepare
command.
Use the ionic cli.
ionic cordova prepare ios
Copies assets to Cordova platforms, preparing them for native builds
which means it copies resources from your assets folder to your platforms. This doesnt update your build with the code changes.
You should be using,
ionic cordova build ios
For running you can do ionic cordova run ios
or ionic cordova emulate ios
.
来源:https://stackoverflow.com/questions/47177404/ios-app-doesnt-update-on-ionic-2