【问题标题】:Visual Studio Mac, build from command line?Visual Studio Mac,从命令行构建?
【发布时间】:2019-08-21 15:41:05
【问题描述】:

我正在考虑使用 Visual Studio 和 Xamarin 来构建跨平台应用程序,但我更喜欢使用 Sublime Text 作为我的编辑器。目前我找不到任何关于 3rd 方工具与 Visual Studio 集成的信息。

Visual Studio 是否可以像 Xcode 那样使用“xcodebuild”实用程序从命令行构建?理想情况下,我想制作一个 shell 脚本,它可以像我在 VS 中按下构建按钮一样构建,并返回我可以解析并在 Sublime Text 中显示的错误。

非常感谢任何建议。

【问题讨论】:

  • Visual Studio 的另一个替代品是 JetBrains Rider。我自己用。

标签: macos visual-studio sublimetext3


【解决方案1】:

我们使用如下命令行: msbuild /p:Configuration="AppStore" /p:Platform="iPhone" /p:IpaPackageDir=bin/iPhone/AppStore /p:BuildIpa=true /target:xxxxxxx.sln

通过 Google 查找所需选项的 doco 需要花费一些时间。希望这会有所帮助。

【讨论】:

  • 我还在 Mac 上的“Visual Studio.app/Contents/MacOS/vstool”中找到了“vstool”,它似乎做了类似的事情。不过,两者都比在 Visual Studio 中构建要慢,而且我看不到不返回 Visual Studio 就可以实际运行的方法。你找到跑步​​的方法了吗?
  • 我们不会自动运行应用程序。我们将 .ipa 文件上传到内部网站,以便分发给我们的测试人员和员工 iphone 进行测试,或者在测试完成后加载到应用商店。
【解决方案2】:

我以这种方式使用位于“/Applications/Visual Studio.app/Contents/MacOS/vstool”的“vstool”:

vstool build -t:Build -c:"Release|iPhone" "MyProject.sln";

如 vstool 帮助中所述:

Visual Studio Build Tool
build [options] [build-file]
-p --project:PROJECT  Name of the project to build.
-t --target:TARGET    Name of the target: Build or Clean.
-c --configuration:CONFIGURATION  Name of the solution configuration to build.
-r --runtime:PREFIX   Prefix of the Mono runtime to build against.

Supported targets:
  Build: build the project (the default target).
  Clean: clean the project.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-03
    • 1970-01-01
    • 1970-01-01
    • 2011-08-05
    • 1970-01-01
    • 2015-07-31
    相关资源
    最近更新 更多