iOS App doesn't update on ionic 2

旧城冷巷雨未停 提交于 2021-02-11 14:21:38

问题


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.

  1. Add ios platform to project using cordova platform add ios and run ios app on xcode. initial app runs fine
  2. then go to project -> src -> pages ->home ->home.component.ts edit home.component.ts and home.component.html
  3. run cordova prepare to add changes to ios platform
  4. stop xcode and clean->build->run project again.. changes doesn't appear.
  5. remove ios platform using cordova platform remove ios and readd it using cordova 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!