Xcode 4 错误:启动可执行文件时出错
当我将应用程序上传到我的实际设备(iPhone 和 iPad)时,我在 iOS 和 Xcode 上测试我的应用程序时遇到了问题,我想知道是否有人知道这个问题并可以帮助我:
通常当我在我的设备,该应用程序已在我的设备上安装并启动。但当我准备提交我的第一个应用程序时,我正在测试并更改捆绑标识符、应用程序 ID 和开发规定(因此问题可能与之有关),现在,当我尝试在我的设备,虽然它安装在我的设备上很好,但 Xcode 将不再启动该应用程序。相反,我收到此错误消息:
启动可执行文件时出错。 启动远程程序时出错:没有这样的文件 或目录。
有谁知道问题是什么?这个派生数据文件夹是关于什么的?
非常感谢!
I ran into problem with testing my app on iOS and Xcode when I am uploading it to my actual devices (iphone and iPad), and I'm wondering if someone knows the issue and can help me out:
Normally when I build my app on my devices, the app is installed and launched on my devices. But as I am preparing for submitting my first app I was testing around and changing the Bundle Identifier, App ID, and Development Provisions (so the issue may have something to do with it), and now, when I try to build my app on my devices, although it's installed on my devices fine, Xcode will not launch the app anymore. Instead, I got this error message:
Error Starting Executable.
Error launching remote program: No such file
or directory.
Does anyone know what the issue is? And What is this derived data folder about?
Much thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(15)
我也遇到过这个问题。我已经关闭并重新启动 Xcode;从设备中删除该应用程序并重新安装,然后问题就消失了。
I have also faced that problem. I have closed, restarted Xcode; deleted the application from device and reinstalled it again, then the problem has gone.
从头开始运行应用程序
对于我来说,直到我按以下顺序执行以下操作后,问题才得到解决:
步骤 3 的应用构建文件夹指的是应用程序的构建文件夹,它是“DerivedData”的子级。要找到它,您可以在查找器中显示您的应用程序,然后回溯直到到达“DerivedData”文件夹并删除上面的文件夹,例如“MyApp-crazylongweirdletters”。如果没有这一步(3),我就无法调试,所以这是关键的一步,在执行这一步之前你必须退出 XCode。
对于某些人来说,似乎只需重新启动 XCode 就可以解决问题,但对我来说则不然。
我只是发布这个答案,因为之前的答案对我不起作用。希望其他人能找到这个答案并松一口气。 :)
注意:
Running App from a Clean Slate
For me the problem did not resolve until I did the following in this order:
The app build folder of step 3 refers to your app's build folder that is a child of "DerivedData". To find this you can reveal your app in finder, then backtrack until you get to "DerivedData" folder and delete the folder above that like "MyApp-crazylongweirdletters". Without this step (3), I could not debug, so this is a critical step and you must quit XCode before you do this step.
For some it appears simply restarting XCode does the trick, but not for me.
I only post this answer because the earlier answers did NOT work for me. Hopefully others banging their heads will find this and get a sigh of relief. :)
Notes:
如果我没记错的话,你无法调试(从 Xcode 启动)使用分发配置文件签名的应用程序......然后你会收到这样的消息,gdb 无法附加到进程。
You cant debug (start from Xcode) an application signed with a distribution profile if I remember well... And then you get such messages, gdb failling to attach to process.
我终于发现我的错误了!
我正在摆弄我的 info.plist 文件,我更改了可执行文件名称、捆绑包和捆绑包显示名称!当我将它们改回默认值(分别为 EXECUTABLE_NAME、PRODUCT_NAME、PRODUCT_NAME)后,它就完美运行了。
I finally found my error!
I was playing around with my info.plist file, and I changed the Executable Name and Bundle and Bundle Display name! As soon as I changed those back to the Defaults (EXECUTABLE_NAME, PRODUCT_NAME, PRODUCT_NAME respectively) it worked perfectly.
从设备中删除应用程序(点击并按住然后删除),然后重试。
Delete the app from the device (tap-and-hold then delete) and try again.
对我来说,这些都不起作用。同样的错误,但解决方案不同。
我的问题是由于我不小心将“部署目标”(ios 版本)更改为比我尝试运行代码的手机上的版本更高的版本。
修复很简单 - 将部署目标降低到低于或等于我手机上的 ios 软件版本:)
For me, none of those worked. Same error, but different solution.
My problem was cause by me accidently changing the "Deployment Target" (ios version) to a version higher than what was on the phone I tried to run the code on.
The fix was simple - drop the deployment target to below or equal to the ios software version on my phone :)
由于代码签名不正确,我遇到了同样的错误。
转到您的项目>目标>构建设置>检查调试状态的代码签名。
I got the same error by not having my code signing correct.
Go to your project > Targets > Build Settings > Check code signing for debug state.
我偶然发现这是另一个问题的解决方案,该问题是尝试在新的 4.3.5 设备上构建应用程序时发出的警告。
如果我将配置文件设置为分发,则在构建应用程序时不会收到警告消息,但调试器将附加到设备。
如果我将代码签名设置为分发配置文件,我在构建过程中不会收到警告,但调试器不会附加。所以上面关于基于签名的答案似乎是正确的。这也可能仅是使用 xcode 的较新 4.3.5 设备上的问题
I stumbled upon this as a solution to another issue whch was a warning when trying to build an app on a new 4.3.5 device.
If i set the profile to distribution I do not get a warning message when building the app, but the debugger will attach to the device.
If i set the code signing to the distribution profile, i get no warnings in the build process, but the debugger will not attach. So the answer above about being signing based seems to be correct. This might also only be an issue on newer 4.3.5 devices with xcode
产品->菜单栏中的清理
Product -> Clean in the menubar
有时会发生此错误,因为您的设备的“恢复”或“同步”过程不完整,导致 .app 文件被锁定。
我所做的我必须越狱我的设备才能在 /User/Applications/XXXXX-XXXX-XXX/ 下找到该应用程序并以物理方式删除 .app
对于其中一个可以运行的应用程序,对于另一个我意识到它无法运行的应用程序GDB 自动运行,因此错误消息完全具有误导性,因此我将 GDB 设置为手动,它可以正常工作,并且没有给我该错误,但当然我必须手动运行应用程序才能启动调试会话。
它还可能需要我之前做过的一些其他事情,例如检查配置文件,但这是使其发挥作用的最后一步。
在此之前,我尝试了所有解决方案对我来说都不起作用,显然,简单地通过按住屏幕上的手指来删除应用程序是行不通的,因为它删除了图标,但所有文件仍然存在。 (因为它是一个开发应用程序而不是下载的 App Store 应用程序)
This error some times happen due to incomplete "Restore" or "Sync" process of your device which keeps the .app files locked up.
What I did I had to jailbreak my device to go find the app under /User/Applications/XXXXX-XXXX-XXX/ and phisically delete the .app
For one of the apps it worked and for other one I realized it just does not run GDB automatically so the error message is totally misleading, so I set the GDB to manual and it worked and did not give me that error, but of course I have to run the app manually for the debug session to start.
It also may have required some other stuff that I did before like checking the provision profile, but this was the last step that made it work.
Before this I tried all the solutions did not work for me, and obviously simply deleting the app by holding down your finger on the screen did not work, as it removed the icon but all the files were still there. ( Since it was a development app not a downloaded App Store app )
有同样的问题,
退出 XCode...从设备中删除应用程序...再次运行该程序..
我就是这样解决的......我的一个朋友不得不重新启动设备。
had same problem,
quit the XCode...delete app from device...run the program again..
i solved that way..one of my friends had to restart the device.
我有同样的问题。我通过更改项目的目录名称然后再次启动应用程序解决了这个问题。
I have the same problem. I solved it by changing the project's directory name and then launching the app again.
我在最近恢复的设备上遇到了这个问题,其中我正在开发的应用程序尚未重新安装 - 它们在 Springboard 上显示为“正在等待”从 App Store 下载。从 Springboard 删除该应用程序解决了该问题。
I had this problem on a recently restored device where my in-development apps had not been reinstalled—they were showing up on Springboard as "Waiting" to be downloaded from the App Store. Deleting the app from Springboard fixed the problem.
从昨天开始,我在两个不同的设备(均为 iOS 4.x)上遇到了这个问题。删除 DerivedData 文件夹、删除应用程序、重新启动 Xcode 以及清理代码都不起作用。除了重新启动设备之外,重复所有步骤为我解决了这个问题。
I've faced this issue since yesterday on two different devices, both iOS 4.x. Deleting the DerivedData folder, deleting the app, restarting the Xcode, and cleaning the code did NOT work. Repeating all the steps, in addition to rebooting the device fixed it for me.
我在这里发布该问题的更新。可能对有同样问题的人有帮助。我有 Xcode 4.4 并在 iOS 5.0 的设备上启动了它。如果 Xcode 没有 5.0 模拟器
Here I am posting an update to the issue. Might be helpful for someone with the same problem. I have Xcode 4.4 and launched it on a device with iOS 5.0 . If Xcode doesnt have the 5.0 simulators