xcode xcodebuild 安装路径?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4861102/
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
xcodebuild install path?
提问by Sailesh
I am developing an iphone app using xcode. I would like to automate the "build and run" process, and so want to know if there is any way to install the built app on simulator or device.
我正在使用 xcode 开发一个 iphone 应用程序。我想自动化“构建和运行”过程,所以想知道是否有任何方法可以在模拟器或设备上安装构建的应用程序。
There is xcodebuild install
command but i don't know how to set the installation directory DSTROOT
to simulator/device. Please help me there.
有xcodebuild install
命令,但我不知道如何将安装目录设置DSTROOT
为模拟器/设备。请在那里帮助我。
I have looked through many forums where people suggest just to use xcode GUI to do the stuff, and I do that too, but I would really like to know the command-line way.
我浏览了许多论坛,人们建议只使用 xcode GUI 来做这些事情,我也这样做了,但我真的很想知道命令行方式。
Thanks
谢谢
采纳答案by woodleader
All you need to do is copy the built .app from wherever XCode puts it to ~/Library/Application Support/iPhone Simulator/User/Applications/[somefolder]/, with a file named [somefolder].sb (alongside the folder, not in it) containing the following:
您需要做的就是将构建的 .app 从 XCode 放置的任何地方复制到 ~/Library/Application Support/iPhone Simulator/User/Applications/[somefolder]/,以及一个名为 [somefolder].sb 的文件(在文件夹旁边,不在其中)包含以下内容:
(version 1)
(debug deny)
(allow default)
Then launch /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator. And select your App. Without Jailbreaking it's NOT possible to install it from outside the GUI.
然后启动/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator。并选择您的应用程序。如果没有越狱,就不可能从 GUI 外部安装它。
回答by Jasarien
The install
build action for Xcode will only copy the built product to the install path specified in the xcode project.
install
Xcode的构建操作只会将构建的产品复制到 xcode 项目中指定的安装路径。
This is used for frameworks and libraries that need installing after being built so that other apps can link against them from a common location.
这用于在构建后需要安装的框架和库,以便其他应用程序可以从公共位置链接到它们。
I don't think you'll be able to use this build action to automate the Build and Run process - that is going to have to be done manually by each developer. There is no way to push apps onto a device without using Xcode, iTunes or the iPhone Configuration utility. As for the Simulator, it's as woodleader says. But for the device, without jailbreaking and writing your own code, you can't do this.
我认为您无法使用此构建操作来自动化构建和运行过程 - 这将必须由每个开发人员手动完成。如果不使用 Xcode、iTunes 或 iPhone 配置实用程序,就无法将应用程序推送到设备上。至于模拟器,正如woodleader所说。但是对于设备来说,不越狱,自己写代码,是做不到这一点的。
What you can do is use xcodebuild to generate daily/nightly builds for continuous integration. You can write a script that checks out the source form version control, runs xcodebuild and puts the built product in an easy to reach location. The installtion onto devices will still need to be done manually however.
您可以做的是使用 xcodebuild 生成每日/每晚构建以进行持续集成。您可以编写一个脚本来检查源表单版本控制,运行 xcodebuild 并将构建的产品放在易于访问的位置。然而,安装到设备上仍然需要手动完成。