xcode 无需运行即可部署到 iPhone
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9013053/
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
Deploy to iPhone without running
提问by Jason Marcell
How do I deploy my app down to the iPhone (for testing purposes) from XCode without actually running the app?
如何在不实际运行应用程序的情况下从 XCode 将我的应用程序部署到 iPhone(用于测试目的)?
回答by DougW
Edit your launch Scheme, open the section titled "Run myApp.app" and toggle ON the option to "Wait for myApp.app to launch".
编辑您的启动方案,打开标题为“运行 myApp.app”的部分并将选项切换为“等待 myApp.app 启动”。
It will then just install, and not run the app. If you do run it yourself, the debugger should attach. This is useful for when you want to test how your applications works when launched via a URL, amongst other things.
然后它只会安装,而不是运行应用程序。如果你自己运行它,调试器应该附加。当您想测试通过 URL 启动时应用程序的工作方式时,这非常有用,等等。
NOTE- To be fair, this answer is the same as the one for this question. I didn't mark this question as a duplicate though, because you might have a different reason for wanting to do this. Still, if you want a more detailed explanation, look there.
注意- 公平地说,这个答案与这个问题的答案相同。不过,我没有将此问题标记为重复,因为您可能有不同的原因想要这样做。不过,如果您想要更详细的解释,请查看那里。
回答by ethanneff
Xcode -> Product -> Scheme -> Edit Scheme -> Run -> Info -> Wait for executable to be launched
Xcode -> Product -> Scheme -> Edit Scheme -> Run -> Info -> Wait for executable to belaunch
回答by Rayfleck
You can create an archive, drag that .ipa onto iTunes and sync the device.
您可以创建档案,将该 .ipa 拖到 iTunes 上并同步设备。
Or you can just run it from XCode, and then kill the XCode process, and run it from the SpringBoard, though I assume you need the virgin case or you wouldn't have asked the question.
或者你可以从 XCode 运行它,然后终止 XCode 进程,然后从 SpringBoard 运行它,尽管我假设你需要处女情况,否则你不会问这个问题。
回答by hotpaw2
If you time it just right by watching the Xcode console, you can kill the debugger after the app is completely downloaded, but before any code in the app is executed.
如果您通过观察 Xcode 控制台恰到好处地计时,您可以在应用程序完全下载后,但在应用程序中的任何代码执行之前终止调试器。
If you don't want to depend on timing, and don't need to consider the app to be running until it hits some Cocoa Touch or Objective C runtime code, you could set a breakpoint on an NSLog inserted as the first line of main() and kill the app after it hits that breakpoint.
如果您不想依赖时间,并且在遇到 Cocoa Touch 或 Objective C 运行时代码之前不需要考虑应用程序正在运行,您可以在作为第一行 main 插入的 NSLog 上设置断点() 并在应用程序到达该断点后终止该应用程序。
回答by Melvin Lai
Connect your device, set the Scheme on your top left to iOS Device.
连接您的设备,将左上角的 Scheme 设置为 iOS 设备。