iOS App在Ionic 2上未更新 [英] iOS App doesn't update on ionic 2
问题描述
我开始在Mac上开发ionic 2 cordova应用程序,但未更新ios Application.我的电脑规格是节点v8.9.1npm v5.5.1科尔多瓦v7.1.0离子v3.17.0VSCode编辑器
如果我想更改ionic-v1中的某些代码,则可以编辑 platform->ios->www-> .js
文件或 platform->ios->www-> .html
文件并重新加载xcode,然后更改就会显示在真实设备上.
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.
但是在ionic 2应用程序 platform->中;ios->www
文件夹包含缩小的文件,并且无法编辑这些文件.所以我遵循这个过程,但是代码没有改变.
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.
- 使用
cordova platform add ios
将ios平台添加到项目中,并在xcode上运行ios应用程序.初始应用运行正常 - 然后转到
project->src->页面-> home-> home.component.ts
编辑home.component.ts和home.component.html - 运行
cordova prepare
将更改添加到ios平台 再次 - 停止xcode和
clean-> build-> run
项目.更改不会出现. - 使用
cordova平台删除ios平台删除ios
,并使用cordova平台添加ios
读取它,然后出现新的更改.
- 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.
我在Windows上开发了ionic-v1和ionic 2应用程序,并且在设备上运行良好.在Mac上开发ionic 2应用程序并正确创建它的正确过程是什么?任何帮助,不胜感激.谢谢.
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.
修改请注意,我在物理iPhone上运行的ionic 2应用程序中遇到此问题
Edit Please note that I’m facing this issue in ionic 2 app run on my physical iPhone
推荐答案
步骤3是问题所在.您正在直接运行 cordova prepare
命令.
Step 3. is the problem. You are directly running cordova prepare
command.
使用离子cli .
ionic cordova prepare ios
将资产复制到Cordova平台,为本地构建做好准备
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.
您应该使用
ionic cordova build ios
要运行,您可以运行 ionic cordova运行ios
或 ionic cordova模拟ios
.
For running you can do ionic cordova run ios
or ionic cordova emulate ios
.
这篇关于iOS App在Ionic 2上未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!