如何在 XCode 6 iOS 模拟器中运行/录制 iOS 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26523622/
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
How can I run / record an iOS app in the XCode 6 iOS Simulator?
提问by Vinny Troia
I might be going about this wrong, but I am trying to run an iOS app in the Xcode 6 iOS simulator in order to record a video tutorial of the app. I have xCode installed and can launch the iOS simulator, but there seems to be no way to install an .app file. The ~/Library/Developer/CoreSimulator folder is a complete mystery and there is no clear location to drop the app files.
我可能会出错,但我正在尝试在 Xcode 6 iOS 模拟器中运行 iOS 应用程序,以便录制该应用程序的视频教程。我已经安装了 xCode 并且可以启动 iOS 模拟器,但似乎无法安装 .app 文件。~/Library/Developer/CoreSimulator 文件夹完全是个谜,没有明确的位置可以放置应用程序文件。
Any ideas?
有任何想法吗?
Alternatively, is there an easier way to record a video of your iOS app? People must do it all the time for tutorials...
或者,有没有更简单的方法来录制 iOS 应用的视频?人们必须一直这样做才能获得教程......
Thanks
谢谢
回答by squarefrog
If you were running the app on a device, you could use the new Yosemite feature to record over USB to QuickTime.
如果您在设备上运行该应用程序,则可以使用新的 Yosemite 功能通过 USB 录制到 QuickTime。
However, as you are using the simulator, you will need to a partial screen recording in QuickTime.
但是,当您使用模拟器时,您需要在 QuickTime 中进行部分屏幕录制。
Using QuickTime
使用 QuickTime
Launch QuickTime then go to File > New Screen Recording. You can either click to select the whole screen, or drag to only record a portion of the screen.
启动 QuickTime,然后转到文件 > 新建屏幕录制。您可以单击以选择整个屏幕,也可以拖动以仅录制屏幕的一部分。
Alternatives
备择方案
If you want more flexibility, you will need to use 3rd party software like ScreenFlow.
如果您想要更大的灵活性,则需要使用ScreenFlow等 3rd 方软件。
回答by Abhijith
From Xcode 8.2,You can take a screenshot or record a video of the simulator window using the xcrun command-line utility.
从Xcode 8.2 开始,您可以使用xcrun 命令行实用程序截取模拟器窗口的屏幕截图或录制视频。
Launch your app in Simulator.
Launch Terminal (located in /Applications/Utilities), and enter the appropriate command:
To take a screenshot, use the screenshot operation:
xcrun simctl io booted screenshot
You can specify an optional filename at the end of the command.
To record a video, use the recordVideo operation:
xcrun simctl io booted recordVideo <filename>.<extension>
To stop recording, press Control-C in Terminal.
Note: You must specify a filename for recordVideo.
The default location for the created file is the current directory.
For more information on simctl, run this command in Terminal:
xcrun simctl help
For more information on the io subcommand of simctl, run this command:
xcrun simctl io help
Check this linkfor more details.
查看此链接了解更多详情。
回答by Jeremy Huddleston Sequoia
You can use 'Build & Run' in Xcode to install and run your app in the iOS Simualtor.
您可以使用 Xcode 中的“Build & Run”在 iOS Simualtor 中安装和运行您的应用程序。
Alternatively, you can run xcrun simctl install <Device UDID> <Path to app>
to install your app. See xcrun simctl help
for more information.
或者,您可以运行xcrun simctl install <Device UDID> <Path to app>
以安装您的应用程序。请参阅xcrun simctl help
以获取更多信息。
Regarding recording a screen capture video, you should use QuickTime.
关于录制屏幕截图视频,您应该使用 QuickTime。