从命令行完全构建 Monotouch 应用程序包的完整步骤是什么? [英] What are the complete set of steps to fully build a Monotouch app bundle from the command line?
问题描述
我想知道构建 MonoTouch C# 应用程序的完整步骤集是什么,该应用程序由包含 xib 文件的主应用程序程序集和一组可能包含 xib 文件的库程序集组成.
I'd like to know what the complete set of steps is to build a MonoTouch C# app consisting of the main application assembly containing xib files and a set of library assemblies that also possibly contain xib files.
出于各种原因,我们正在尝试通过适当的 MSBuild 脚本(MonoTouch 尚未支持)自动执行这些步骤,我不会在这里重点讨论这个问题.
We're trying to automate these steps via a proper MSBuild script (which MonoTouch has yet to support) for various reasons which I won't go into, to focus on the question here.
到目前为止,这是我想出的:
So far, here's what I've come up with:
1) 使用 smcs 编译每个程序集,例如
1) Compile each assembly using smcs, e.g.
/Developer/MonoTouch/usr/bin/smcs /noconfig
"/out:/Users/bright/src/MonoTouchAppWithLib/AppLib/bin/Debug/AppLib.dll
"/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll"
"/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll"
"/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll"
"/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll"
/nologo /warn:4 /debug:+ /debug:full /optimize- /codepage:utf8
"/define:DEBUG"
/t:library "/Users/bright/src/MonoTouchAppWithLib/AppLib/Class1.cs"
2) 编译接口定义:在每个程序集中的每个 xib 文件上运行 ibtool,例如
2) Compile interface definitions: run ibtool on each xib file in each assembly, e.g
/Developer/usr/bin/ibtool
--errors --warnings --notices --output-format human-readable-text
"/Users/bright/src/App/App/ViewController_iPhone.xib"
--compile "/Users/bright/src/App/App/bin/Debug/App.app/ViewController_iPhone.nib"
--sdk "/Developer/Platforms/iPhoneSimulator.platform/Developer/
SDKs/iPhoneSimulator4.3.sdk"
3) 编译为本机代码:
3) Compile to native code:
/Developer/MonoTouch/usr/bin/mtouch
-sdkroot "/Applications/Xcode.app/Contents/Developer"
-v --nomanifest --nosign -sim
"/Users/bright/src/App/App/bin/iPhoneSimulator/Debug/App.app"
-r "/Users/bright/src/App/AppLib/bin/Debug/AppLib.dll"
-r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll"
-r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll"
-r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll"
-r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll"
-debug -profiling -nolink -sdk "5.0"
"/Users/bright/src/App/App/bin/iPhoneSimulator/Debug/App.exe"
但是,尚不清楚如何执行以下操作(取自 MonoDevelop 的构建输出窗口)以及执行顺序:
However, it isn't clear how to do the following (taken from MonoDevelop's build output window), and in what order:
1) 提取嵌入的内容.MonoDevelop 只是输出这个:
1) Extract embedded content. MonoDevelop just outputs this:
Extracted HelloWorldScreen_iPhone.nib from MtLib.dll
Extracted HelloWorldScreen_iPad.nib from MtLib.dll
2) 更新应用程序清单:MonoDevelop 构建输出窗口中没有给出命令行.
2) Update application manifest: There's no command line given in the MonoDevelop build output window.
3) 更新调试配置文件:MonoDevelop 构建输出窗口中没有给出命令行.
3) Update debug configuration file: There's no command line given in the MonoDevelop build output window.
4) 更新调试设置文件:MonoDevelop 构建输出窗口中没有给出命令行.
4) Update debug settings file: There's no command line given in the MonoDevelop build output window.
以及我尚未完成的其他步骤,例如应用签名和资源.
And other steps I haven't gotten do yet like app signing and resources.
希望我们能在这里得到足够的信息来尝试一下.
Hopefully we can get enough information here to make a go of it.
推荐答案
您可以从终端窗口或 MSBuild 任务中运行 /Applications/MonoDevelop.app/Contents/MacOS/mdtool代码> MonoDevelop 提供的工具.例如
You can run, from a terminal window or from within an MSBuild task, the /Applications/MonoDevelop.app/Contents/MacOS/mdtool
tool that is supplied with MonoDevelop. E.g.
/Applications/MonoDevelop.app/Contents/MacOS/mdtool -v build -t:Build "-c:Debug|iPhoneSimulator" /path/to/your/app.csproj
这将构建 MonoTouch 应用程序,包括您上面的所有步骤以及将添加的任何未来功能.
That will build the MonoTouch application, including all your steps above and any future feature that will be added.
这篇关于从命令行完全构建 Monotouch 应用程序包的完整步骤是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!