iOS not updated on build

I am not sure if this is a capacitor question or Xcode question. In localhost on web, I am seeing all the updated UI. When I build for mobile purposes, I do not see any changes.

Following:

  • ionic build
  • npx cap copy ios (also tried npx cap sync iOS)
  • npx cap open ios

When I look at the public folder under iOS app/public to search my update, I can see the changes in main.js file.
Yes, I cleared build folder under product. I also restarted Xcode. I also removed app on physical device and also tried on different simulators. Nothing changed.

Xcode version: 12.4
ionic 6.12.4

getting a bit frustrated with this, has been weeks.
So I just tried going into the iOS folder and do pod install, it worked the first time around. (Also surprised why cap sync didn’t “install”) After the following build, it reverted back to old version on next sync.

in case anyone runs into this trouble.
You need to delete the iOS folder and restart everything, it seems. This isn’t great though since all the configuration I had under iOS gets removed. So do keep a copy/reference of your old files.

Hmm this doesn’t seem right…I can’t replicate this on my end with a testing project.

  • ionic start my-app tabs
  • ionic build
  • ionic cap add ios
  • ionic cap sync ios

Then run/build the project

I make a change to anything in my typescript…

  • ionic build
  • ionic cap sync ios

and the code is updated in xcode/device/sim.

Am i missing anything?

1 Like

Thanks. You are correct and that’s also what I was doing too but nothing changed. (This started happening recently.)
I honestly cannot figure out why it wasn’t updating. Deleting the folder and restarting all over was my last resort.

Can you share some more information? ionic info?

What’s your capacitor version?

I’m seeing the same thing happen with my current setup. I would rather not delete my iOS folder and restart this so I was wondering if you figured out where some files may be cached.

It’s like the JavaScript files are not being updated on new native builds to the device.

Once you deleted the iOS folder did your builds work correctly going forward?

Currently facing the exact same problem, have done all of the mentioned methods above except deleted IOS folder, hoping to get a solution.

You can also try to delete DeriviedData, in case your app is cached with XCode for some reason. It can just randomly happen sometimes!

Did we found a solution here?

close your editor(s) clean all build folders (no need to delete anything) and then build again (in vscode in my case) and ionic cap sync again. Worked for me

This still isn’t working for me…here’s my ionic info output

Ionic:

   Ionic CLI       : 7.2.0 (/Users/esro/.nvm/versions/node/v18.18.2/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 7.6.1

Capacitor:

   Capacitor CLI      : 5.6.0
   @capacitor/android : not installed
   @capacitor/core    : 5.6.0
   @capacitor/ios     : 5.6.0

Utility:

   cordova-res                          : not installed globally
   native-run (update available: 2.0.1) : 2.0.0

System:

   NodeJS : v18.18.2 (/Users/esro/.nvm/versions/node/v18.18.2/bin/node)
   npm    : 9.8.1
   OS     : macOS Unknown

This is happening for me, and deleting the ios folder and clearing all build folders isn’t working. The javascript build folder has the latest code which I confirmed by running it using a local web server, but the ios build is always an older version.

Try Clean/Rebuild and Removing Derived Data - iOS Troubleshooting Guide | Capacitor Documentation