I can't build ionic react app on IOS simulator

I’m trying to build an Ionic React project. I’m successfully compiling the project on the IOS simulator but It crashes when It opens. Error showing is

ERROR: Unable to load public/index.html
:zap: This file is the root of your web app and must exist before
:zap: Capacitor can run. Ensure you’ve run capacitor copy at least
:zap: or, if embedding, that this directory exists as a resource directory.

Please help me to get it fixed

So let’s check out the steps you’ve taken.
Normally this process looks something like this

  • run a web build: ionic build or npm run build
  • Sync/copy the assets for native: npx cap sync
  • open the native IDE: npx cap open ios
  • build for the simulator or real device.

does this match your process?

I wanted to run on a simulator, I exactly did the same process to run on the simulator.

  • ionic build
  • npx cap sync
  • run from x-code build run

It’s is working on web but not on the simulator. I have also done the steps defined here please check

Building-app-on-device

This is my project structure.

@mhartington Can you please help me out?

Can you run your build from xcode instead of from the command line.