Search code examples
iosiphonexcodereact-native

Xcode not reflecting changes in the code to the real device but working properly in simulator


I am developing a react native app using xcode. I am having problem in running build from xcode to real device where it is not running the latest changes that I make in vscode. But, for xcode simulator it is running properly with realtime changes.

At first I thought maybe it is because cache in my iphone, but when I change the device, it still running the old version. All the changes that I make are not build in real device while the simulator is working fine


Solution

  • This could be an issue with Xcode not properly detecting changes made to your codebase. There are a few things you can try to resolve this issue:

    1. Clean the project in Xcode. Go to "Product" -> "Clean Build Folder" and try building the app again.
    2. Delete the derived data folder. In Xcode, go to "Preferences" -> "Locations" and click on the arrow next to "Derived Data". This will take you to the folder containing the derived data for your Xcode projects. Delete the folder containing the derived data for your app and try building the app again.
    3. Restart Xcode. Sometimes Xcode can get stuck and a simple restart can help.
    4. Check your Xcode build settings. Make sure that the "Build Active Architecture Only" setting is set to "No". This can cause Xcode to build for the wrong architecture, which can lead to issues with running the app on a real device.
    5. Check your Xcode scheme settings. Make sure that the "Build Configuration" setting is set to "Debug" and not "Release". If it's set to "Release", Xcode may be building the app with optimizations that can cause issues with running the app on a real device.
    6. Try running the app on a different device. If the issue persists, it's possible that there's an issue with your Xcode project or codebase. Try creating a new project or checking your codebase for any issues.