xcode 无法在设备上启动应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11010523/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:35:26  来源:igfitidea点击:

Can not launch the app on device

iosxcode

提问by Luca

When i try to launch my application from Xcode to the device, i get this error:

当我尝试将我的应用程序从 Xcode 启动到设备时,出现此错误:

error: failed to launch '/Users/Luca/Library/Developer/Xcode/DerivedData/myapp-bmsyknqfiyjuechenbmjnbfmpnsn/Build/Products/Debug-iphoneos/myapp.app/myapp' -- No such file or directory (/Users/Luca/Library/Developer/Xcode/DerivedData/myapp-bmsyknqfiyjuechenbmjnbfmpnsn/Build/Products/Debug-iphoneos/myapp.app/myapp)

I am using Xcode 4.3.2 and iOS 5.1 for my iPhone.

我的 iPhone 使用的是 Xcode 4.3.2 和 iOS 5.1。

回答by Jeff Grimes

  1. Disconnect your device.
  2. Delete the app from your device.
  3. Quit Xcode completely.
  4. Go to ~/Library/Developer/Xcode/DerivedData and look at the folders there ($ ls).
  5. Find the one with the app's name in front of it and delete the folder ($ rm -rf ).
  6. Reopen Xcode.
  7. Connect your device.
  8. Build and Run the app (cmd + R).
  9. Boom.
  1. 断开您的设备。
  2. 从您的设备中删除该应用程序。
  3. 完全退出Xcode。
  4. 转到 ~/Library/Developer/Xcode/DerivedData 并查看那里的文件夹($ ls)。
  5. 找到前面有应用程序名称的那个并删除文件夹 ($ rm -rf )。
  6. 重新打开 Xcode。
  7. 连接您的设备。
  8. 构建并运行应用程序 (cmd + R)。
  9. 繁荣。

回答by Paks

Clean your application folder and rebuild it

清理您的应用程序文件夹并重建它

回答by unexpectedvalue

Cleaning, quiting XCode, relaunching XCode and recompiling helped me with an indentical issue.

清理、退出 XCode、重新启动 XCode 和重新编译帮助我解决了一个相同的问题。

回答by raffjones

I also ran into this problem compiling a Cocos2D project on an iPhone 4. That was after having followed all the steps suggested by Jeff Grimes but to no avail. Everything had been working fine, so I was a bit stumped.

我在 iPhone 4 上编译 Cocos2D 项目时也遇到了这个问题。那是在遵循 Jeff Grimes 建议的所有步骤之后,但无济于事。一切都很好,所以我有点难住了。

The fail was a caused by change of the UIRequiredDeviceCapabilitiesfor accelerometerfrom YESto NO(as the app isn't using accelerometer I decided to just drop the requirement). I changed it back and everything is fine - compiling again.

失败是由UIRequiredDeviceCapabilitiesforaccelerometerYESto的更改引起的NO(因为该应用程序没有使用加速度计,所以我决定放弃该要求)。我把它改回来了,一切都很好 - 再次编译。

Incidentally - I thought that changing the value of the key to NOmeant that the accelerometer would just not be required. This is wrong - this breaks the compiler as it checks to make sure the device has NOT got an accelerometer, which of course returns true for most devices. So you just need to delete that row entirely if you don't need accelerometer support.

顺便说一句 - 我认为将键的值更改为NO意味着不需要加速度计。这是错误的 - 这会破坏编译器,因为它会检查以确保设备没有加速度计,这对于大多数设备当然返回 true。因此,如果您不需要加速度计支持,您只需要完全删除该行。

回答by MadhavanRP

I encountered this problem when I tried to run my app on a device with an iOS version below the deployment target set in Target->Summary->Deployment Target. The deployment target was set to 6.0 and my device had iOS 5.1 . Changing the Deployment Target to 5.1 fixed it for me.

当我尝试在 iOS 版本低于 Target->Summary->Deployment Target 中设置的部署目标的设备上运行我的应用程序时遇到了这个问题。部署目标设置为 6.0 并且我的设备有 iOS 5.1 。将部署目标更改为 5.1 为我修复了它。

回答by parametr

For me restarting of Xcode, cleaning DerivedData and restaring device wasn't enough in most cases, until I had figured out that iTunes was also running, and after quitting iTunes everything worked fine!

对于我重新启动 Xcode,在大多数情况下清理 DerivedData 和重新启动设备是不够的,直到我发现 iTunes 也在运行,并且在退出 iTunes 后一切正常!

So my steps now are simple:

所以我现在的步骤很简单:

  1. Quit Xcode.
  2. If iTunes is running, quit iTunes.
  3. Reopen project.
  1. 退出 Xcode。
  2. 如果 iTunes 正在运行,请退出 iTunes。
  3. 重新打开项目。

It works without cleaning and device restarting.

它无需清洁和设备重启即可工作。

回答by user2987408

I have the same problem. In my case, I just upgraded the iPhone from iOS 6.1 to iOS 7.0.4. I can install the app from Xcode 5 onto the device but it could not be launched. I did a lot the above suggestion in disconnecting, removing app, remove folder and restart Xcode. It still could not work, until I reboot the iPhone. After restarting iPhone, I repeat the above and now it works.

我也有同样的问题。就我而言,我刚刚将 iPhone 从 iOS 6.1 升级到了 iOS 7.0.4。我可以将 Xcode 5 中的应用程序安装到设备上,但无法启动。我在断开连接、删除应用程序、删除文件夹和重新启动 Xcode 方面做了很多上述建议。它仍然无法工作,直到我重新启动 iPhone。重新启动 iPhone 后,我重复上述操作,现在它可以工作了。

回答by RainCast

I just wanted to add one more tip to prevent this from happening:

我只是想再添加一个提示来防止这种情况发生:

DO NOT detach your physical device before you hit the stop debugging button from xCode. This is actually the most common case after which I met the "could not launch" issue. In my case, 80% of the issue is caused by this... just accidentally detached the device during debugging...

在您点击 xCode 的停止调试按钮之前,请勿分离您的物理设备。这实际上是我遇到“无法启动”问题后最常见的情况。在我的情况下,80% 的问题是由这个引起的......只是在调试过程中不小心分离了设备......

Keep in mind. :P

记住。:P

回答by Avinash

I too faced this problem. I tried with options which were listed above.

我也遇到了这个问题。我尝试使用上面列出的选项。

But in my case problem was the device having iOS version 6.0 and the build target was set to 6.1. Version of simulator is iOS 6.1 so it is running on simulator but on phone it failed to install.

但在我的情况下,问题是设备的 iOS 版本为 6.0,并且构建目标设置为 6.1。模拟器的版本是iOS 6.1,所以它在模拟器上运行,但在手机上安装失败。

After changing the build target version it executed and installed on device

更改构建目标版本后,它会在设备上执行并安装

May this will help...

可能这会有所帮助...

--Avinash

——阿维纳什

回答by Dan

The only way I was able to fix this was to hard-boot my iPhone (hold down power and menu button until it powers off) and restart Xcode.

我能够解决这个问题的唯一方法是硬启动我的 iPhone(按住电源和菜单按钮直到它关闭)并重新启动 Xcode。