iOS build not updating with Xcode

I am all of a sudden experiencing an issue where building and running on my device via Xcode is not building with the most recent changes. Ionic serve reflects the changes and Xcode was previously working. I am not sure what has gone wrong (I did recently create an archive, so I am not sure if that messed anything up). Anyways here the process I generally follow:

  1. ionic build ios --prod (I have also tried “cordova prepare ios” or “npm run build ios --prod” here instead)
  2. hit the “play” button on Xcode to run on my device

I have tried to delete the “www” folder of my project and have also tried to delete /users//Library/Developer/Xcode/DerivedData/ without any luck.

Here is the output of “ionic -info”:

Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.1
ios-sim version: 5.1.0
OS: macOS Sierra
Node Version: v6.9.5
Xcode version: Xcode 8.3.2 Build version 8E2002

Thanks for any help/thoughts you can offer.

You Ionic CLI is quite old, especially [quote=“ssridhar582, post:1, topic:96919”]
Ionic App Scripts Version: 1.0.0
[/quote]
might cause problems in general in the build process. You might want to update this.

Have you tried ionic cordova run ios --prod (without cordova for your current CLI)? Doesn’t this run the app directly on your iPhone without the detour to Xcode?

I just figured it out…I just realized that ionic deploy was updating it to a previous snapshot (stupid me! - I didnt catch that earlier). I performed an ionic upload and it appears to be working.

Thanks for letting me know about my cli/app scripts being outdated. Will updating the CLI update the app scripts? Also is the most recent version of the CLI stable or should I get a slightly older one?

Also, you are right ionic run ios --prod does work (detouring around Xcode) although I want to have Xcode working for when I want to deploy to the app store (I feel like signing is more straightforward that way).

Thanks again.

No, the CLI is global and app-scripts part of your project.
Run npm install -g ionic and npm install --save-dev @ionic/app-scripts to update both.[quote=“ssridhar582, post:3, topic:96919”]
Also is the most recent version of the CLI stable or should I get a slightly older one?
[/quote]

Pretty stable. Some commands changed in 3.x, so read the changelogs.[quote=“ssridhar582, post:3, topic:96919”]
Also, you are right ionic run ios --prod does work (detouring around Xcode) although I want to have Xcode working for when I want to deploy to the app store (I feel like signing is more straightforward that way).
[/quote]

Fair enough. For me Xcode sometimes messes stuff up though.

Ok sounds good, thanks again for the help and quick response.

1 Like

5 posts were split to a new topic: “ionic run ios --prod” , code is not updating

it seems that you use ionic cordova plugin and that’s why it runs the version uploaded to ionic branch master so the solution is to remove the plugin with running :
ionic cordova plugin rm ionic-cordova-plugin
otherwise you have to commit you changes to ionic repository (production/dev)

cheeers.

I it necessary to have a project connected to xCode? Its infuriating. It constantly reverts my builds to random old versions or makes them listen to different deploy channels and changes update methods. And reverts to old app store icons :roll_eyes:

I can’t remember why it was necessary in the first place, but it must have been for a good reason? It seems to make development twice as long trying to chase down whatever it has done now.