Xcode 4 显示“已完成运行<我的应用程序>”在目标设备上——没有任何反应我的应用程序>
该应用程序既不会在我的设备上安装也不会运行。所有配置文件都是最新的。我已经尝试删除并重新安装它们。
状态栏显示 Xcode 正在构建我的项目,然后显示在 上运行我的项目,然后显示“已完成运行”。在整个期间,iPod 屏幕始终保持黑色。 iPod 正在管理器中被检测到,我没有发现其配置有任何问题。就在几天前,使用 Xcode 3 一切都工作得很好。
它在模拟器上不起作用,但值得注意的是,在模拟器中,它似乎卡在“附加到”上,并且模拟器拒绝启动。
The app neither installs nor runs on my device. All provisioning profiles are up to date. I've already tried deleting and re-installing them.
The status bar shows that Xcode is building my project, then it says running my project on , then it says "finished running ." Throughout this entire period, the iPod screen stays black. The iPod is being detected in the Organizer and I don't see anything wrong with its configuration. Everything was working perfectly just a couple days ago with Xcode 3.
It doesn't work on the simulator, but it may be important to note that in the simulator it appears to get stuck on "Attaching to " and the simulator refuses to start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(25)
对于那些仍在苦苦挣扎的人,我必须做的另一件事是使调试和发布配置的目标产品的名称相同。它一直在“运行”调试版本,而我没有构建该版本。
For those still floundering, another thing that I had to do was make the name of my target's product the same for Debug and Release configurations. It had been "running" the Debug version, which I was not building.
添加armv6架构为我解决了这个问题。
adding armv6 architecture fixed this for me.
有时也会发生在我身上。执行清理(产品菜单 -> 清理)和运行(项目菜单 -> 运行)总是可以修复它。
Happens to me sometimes as well. Doing clean (Product menu -> Clean) and run (Project menu -> Run) always fixes it.
我遇到了同样的问题:将项目从 xcode3 迁移到 xcode4,构建应用程序后,xcode 不想在我的手机上安装并启动该应用程序。
我的解决方案(对我有用)是:
为我工作,从现在开始我可以使用:
'产品->执行操作 ->无需构建即可运行”,用于运行最新版本。这比简单地按“运行”更快,因为不会执行任何构建操作。
I had the same problem: migrated a project from xcode3 to xcode4, and after building the app, xcode did not want to install and start the App on my phone.
My solution (that worked for me) is:
Worked for me, and from now on I can use:
'Product -> Perform Action -> Run without building', for running the latest build. This is faster then simply pressing Run, as no build actions will be taken.
只需重新启动设备即可。做一个干净的项目。从设备中删除应用程序并重建。
Just restart the device. Do an clean project. Delete the app from the device and Rebuild.
项目和目标的构建设置不同。
我只需在这两个部分中按“构建产品路径”和“中间构建文件路径”上的“suppr”,它就解决了我的问题。
Build settings were different for project and targets.
I just press suppr on Build Products Path and Intermediate Build Files Path in both sections and it solved my problem.
我使用 Cocos2D 的游戏项目也遇到了同样的问题。模板中的“Hello world”工作正常,我的项目在模拟器中工作正常,但在设备上运行失败,并显示消息:“已完成运行”。
我已将项目中的 Info.plist 替换为模板中的第一个 Info.plist,这对我有用!
I had the same problem with my game project using Cocos2D. "Hello world" from template worked fine, my project worked fine in simulator, but running failed on device with message: "Finished running".
I've replaced Info.plist in my project by the initial one from template and that worked for me!
当迁移到最新的 Xcode 版本时,我在两个不同的应用程序中经历了两次这种情况。第一次,有效的是使用 GCC LLVM 编译器编译应用程序。第二次,有效的方法是将armv6架构作为受支持的架构添加回来,因为当Xcode自动更新项目时它已被删除。
I experienced this twice with two different apps when moving to the most recent Xcode version. The first time, what worked was compiling the app with the GCC LLVM compiler. The second time, what worked was adding back in the armv6 architecture as a supported architecture since it had been removed when Xcode automatically updated the project.
我通过在 Info.plist 中将“加速度计”从“NO”更改为“YES”解决了这个问题。
Apple 的信息属性列表键参考说如果“您的应用程序仅检测到设备方向变化”,您可以完全删除“加速度计”设置。
I solved this by changing "accelerometer" from "NO" to "YES" in my Info.plist.
Apple's Information Property List Key Reference says that you can remove the "accelerometer" setting entirely if "your application detects only device orientation changes."
我的解决方案是将
UIInterfaceOrientationPortrait
添加到 Info.plist 中的UISupportedInterfaceOrientations
数组,即使我的应用程序不支持纵向。My solution was to add
UIInterfaceOrientationPortrait
to theUISupportedInterfaceOrientations
array in Info.plist, even though my app does not support portrait.一个名为“应用程序需要 iPhone 环境”的字段不知何故进入了我的 plist。我把它去掉了,瞧!它在我的 iPod 上运行。
A field called "Application requires iPhone environment" had made it's way into my plist somehow. I removed it and voila! It ran on my iPod.
我的 Info.plist 将其目标成员资格设置为我的构建目标。将其从目标成员资格中删除解决了问题。
My Info.plist had it's target membership set to my build target. Removing it from the target membership solved the problem.
我使用了 Info.plist 的备用名称,但没有在目标上正确设置
Info.plist File
构建设置。我通过查看应用程序包并发现它不包含 Info.plist 发现了这一点。I was using an alternate name for Info.plist but had not correctly set the
Info.plist File
build setting on my target. I discovered this by looking at the Application Bundle and seeing that it did not contain an Info.plist.确保部署目标版本 <= 您设备上的 iOS 版本。这就是我解决这个问题的方法。
Make sure that the deployment target version is <= the iOS version on your device. This is how i solved this problem.
我遇到同样的问题大约 45 分钟。清理没有帮助,重新创建项目没有帮助,arm 版本没有帮助。我打开了一些以前没有看到的“无法同步到 iTunes”消息。单击“确定”似乎已经解决了问题:(
I was having the same problem for about 45 minutes now. Cleaning didn't help, re-creating the project didn't help, the arm version didn't help. I had some "Could not sync to iTunes" messages open that I didn't see before. Clicking OK on those seemed to have fixed the issue :(
XCode 构建、运行并完成,但应用程序无法部署,甚至没有复制到设备。
事实上,XCode项目中应该有一些东西被破坏了。最好的举措是从头开始构建一个新项目。不要忘记添加 armv6 支持,如上一篇文章中所述。
这对我来说效果很好!
XCode build, run and finished but the app failed to be deployed and was not even copied to the device.
In fact, there should be something in the XCode project that is broken. The best move is to build a new project from scratch. Don't forget to add armv6 support as stated in a previous post.
It works well for me!
我尝试在设备上运行 watchOS 应用程序时发生了这种情况,因为我的 Apple Watch 的 watchOS 版本高于我当前安装的 Xcode 支持的版本。 我升级到了最新的 Xcode(这也要求我升级到最新的 macOS),之后运行良好。
This happened to me trying to run a watchOS app on device, because my Apple Watch's watchOS version was higher than my currently-installed Xcode supported. I upgraded to the newest Xcode (which did also require me to upgrade to the newest macOS), and it ran fine after that.
对于那些阅读有关 Xcode 4.2 的文章并尝试在早期设备(例如 iPhone 3G、2G、iPod 第一代等)上运行的人,我有另一个解决方案。默认情况下,在 Xcode 4.2 中创建的新项目在“所需设备功能”中指定“armv7”。如果想要支持运行armv6的设备(例如iPhone 3G),您需要删除它。
从 yourProjectName-Info.plist 中的“所需设备功能”中删除 armv7
您可能还需要更改构建设置以使用armv6而不是armv7进行编译。
这是默认值:
双击“标准 (armv7)”添加另一个,然后单击“ +' 在弹出窗口中输入 'armv6':
单击完成,它应该如下所示:
For those reading this in regards to Xcode 4.2, and attempting to run on an earlier device (e.g. iPhone 3G, 2G, iPod 1st gen, etc) I have another solution. New projects created in Xcode 4.2 by default specify 'armv7' in the 'Required Device Capabilities'. You'll need to remove this if wanting to support devices that run armv6 (e.g. the iPhone 3G).
Delete armv7 from the 'Required device capabilities' in yourProjectName-Info.plist
You may also need to change the build settings to compile with armv6 instead of armv7.
This is the default:
Double click on 'Standard (armv7)' to add another, then click the '+' in the popup, and type in 'armv6':
Click done and it should look like this:
我刚刚遇到了这个问题,但对我来说,这是因为我在架构中只指定了armv7,但3G是armv6。确保两者都有。
I just had this problem, but for me it was because I only specified armv7 in my architectures, but the 3G is armv6. Make sure you have both.
我遇到了这个问题,结果发现 XCode 将部署目标默认为 4.3,而我的手机是 4.2.1。将部署目标更改为 4.0 似乎解决了这个问题。
I had this issue, and it turns out that XCode was defaulting the Deployment Target to 4.3, whereas my phone is 4.2.1. Changing the Deployment Target to 4.0 seemed resolve it.
将“armv6”添加到项目和目标的体系结构后,请确保 info.plist 的“所需设备功能”部分中没有“armv7”。如果是这样,只需将其删除即可工作!
After you add "armv6" to the Project and Targets' architectures, make sure you don't have "armv7" in your "Required device capabilities" section of your info.plist. If so just remove it and it should work!
应用程序未在设备上运行也存在同样的问题。从设备中删除该应用程序没有帮助。项目->清理然后项目 ->再次运行也没有帮助。事实证明,只需退出并重新启动 Xcode 4 即可解决该问题。
Same problem here with the app not running on the device. Deleting the app from the device didn't help. Project -> Clean then Project -> Run again didn't help either. Turned out that just Quitting and restarting Xcode 4 solved it.
我刚刚也有这个。我在 info.plist 中添加了一个 UIRequiredDeviceCapability 部分,需要 gamekit,并且该应用程序不会被复制到运行 iOS 4.2 的 iPhone 3G 上。删除所需的功能,一切都很好。
I just had this too. I had added a UIRequiredDeviceCapabilities section to info.plist, requiring gamekit, and the app would not get copied onto an iPhone 3G running iOS 4.2. Removed the required capability, all is well.
尝试删除设备上的应用程序(就像通常的应用程序卸载一样)并再次从 Xcode 运行它。
帮助我解决了同样的问题,除了模拟器无法工作。
Try deleting the app on the device (just like your usual app uninstall) and running it from Xcode again.
Helped me with the same problem, apart from the simulator not working.
我的情况:我错误地设置了:
所需的设备功能 ->加速度计设置为 NO(在 Info.plist 中)。
只需将其设置回 YES
另外:确保所需设备功能的类型正确:即布尔值或字符串。错误的类型总是会导致测试失败,并且应用程序无法加载。
Mine case: I mistakenly set the:
Required device capabilities -> accelerometer to NO (in Info.plist).
Just have to set it back to YES
Also: Make sure that the Required device capabilities is of the proper type: i.e. Boolean or String. The wrong type will invariably make the test fail, and the app not load.