英文:
Xcode not reflecting changes in the code to the real device but working properly in simulator
问题
我正在使用Xcode开发React Native应用程序。我在从Xcode运行构建到真实设备时遇到问题,它没有运行我在VSCode中进行的最新更改。但是,在Xcode模拟器中,它能够正确运行并实时显示更改。
起初,我以为可能是因为我的iPhone中有缓存,但当我更改设备时,它仍然运行旧版本。所有我所做的更改都未在真实设备上构建,而模拟器正常运行。
英文:
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
答案1
得分: 1
这可能是Xcode未能正确检测到对代码库所做更改的问题。您可以尝试以下几种方法来解决此问题:
- 在Xcode中清理项目。转到 "产品" -> "清理构建文件夹",然后尝试重新构建应用程序。
- 删除派生数据文件夹。在Xcode中,转到 "首选项" -> "位置",然后单击“派生数据”旁边的箭头。这将带您进入包含Xcode项目的派生数据的文件夹。删除包含应用程序派生数据的文件夹,然后尝试重新构建应用程序。
- 重新启动Xcode。有时候Xcode可能会卡住,简单的重新启动可以有所帮助。
- 检查您的Xcode构建设置。确保 "仅构建活动架构" 设置为 "否"。否则会导致Xcode为错误的架构构建,从而可能导致在真实设备上运行应用程序时出现问题。
- 检查您的Xcode方案设置。确保 "构建配置" 设置为 "调试" 而不是 "发布"。如果设置为 "发布",Xcode可能会使用会导致在真实设备上运行应用程序时出现问题的优化。
- 尝试在不同的设备上运行应用程序。如果问题仍然存在,可能存在Xcode项目或代码库的问题。尝试创建一个新项目或检查您的代码库以查找任何问题。
英文:
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:
- Clean the project in Xcode. Go to "Product" -> "Clean Build Folder"
and try building the app again. - 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. - Restart Xcode. Sometimes Xcode can get stuck and a simple restart
can help. - 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. - 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. - 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论