It’s important to initially set, and later update, the version number and build string before you upload or export your app because these numbers are used throughout the system to identify the build. Specifically, the version number and build string are used to identify crash reports and dSYM files for apps distributed through TestFlight or the App Store. For iOS apps, the system recognizes that the build string changed and properly syncs the new app version to the device.
Therefore, set the version number and build string before you create your first archive. Increment the build string before you archive a new build of your app that you intend to upload to App Store Connect or export for distribution outside the App Store. Then increment the version number when you create a new app version in App Store Connect.
In the project editor, choose the target, click General, then reveal the Identity settings.
Enter the version number in the Version field, and enter the build string in the Build field.