从命令行触发 iOS Visual Studio Cordova 构建
Trigger an iOS Visual Studio Cordova build form the command line
我可以从命令行成功 运行 构建 Android 应用程序。
对于 iOS,使用此命令行构建失败:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com" "<Solution>.sln" /rebuild "Distribution|iOS" /project "<projectName>" /projectconfig "Distribution|iOS"
这是错误:
1>MSBUILD : cordova-build error BLD301: Error : BLD00301 : A remote
iOS build agent has not been configured. Configure one in Tools >
Options > Tools for Apache Cordova > Remote Agent Configuration. For
details and alternatives see
http://go.microsoft.com/fwlink/?LinkID=511904
我在 visual studio 中配置了远程服务器,但显然这没有被拾取。有没有办法将此配置提供给批量构建?
请注意,您需要在 Mac 机器上启动远程代理,获取 IP/host、端口和 pin,然后使用工具 --> 选项 --> 工具对其进行配置对于 VS 中的 Apache Cordova,在启动构建之前。 Visual studio 不会为您启动远程服务器。
设置远程代理的过程在 https://msdn.microsoft.com/en-us/library/dn771551.aspx 中进行了说明。
在 Cordova Tools for Visual Studio 的帮助下,在 MSBuild 下构建您的 Cordova iOS 项目。您需要将 属性 添加到名为 iOSRemoteBuildServer
的 MSBuild。构建命令行应该是这样的,我以调试构建为例:
"C:\Program Files (x86)\MSBuild.0\Bin\msbuild.exe"
/p:Configuration=Debug
/p:LangName=en-US
/p:Platform=iOS
/p:DebuggerFlavor=iOSRemoteDevice
/p:iOSRemoteBuildServer=http://192.168.0.123:3000
您将在 bin\iOS\Debug\
文件夹中找到您的 IPA 输出。
如果 MSBuild 因缺少环境变量而失败,以下内容应该有所帮助(假设您使用的是 Cordova Tools CTP3.1 和 Node.js 64 位):
SET MDAVsixDir=%VS120COMNTOOLS%..\IDE\EXTENSIONS\IIC52DPN.UDK
SET NodeJsDir=C:\Program Files\nodejs\
SET NpmInstallDir=%APPDATA%\npm
要设置用于检索客户端证书的安全 PIN,您可以使用 MSBuild 属性 iOSRemoteBuildSecurityPIN
但我还没有测试过这个 属性。
我可以从命令行成功 运行 构建 Android 应用程序。
对于 iOS,使用此命令行构建失败:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.com" "<Solution>.sln" /rebuild "Distribution|iOS" /project "<projectName>" /projectconfig "Distribution|iOS"
这是错误:
1>MSBUILD : cordova-build error BLD301: Error : BLD00301 : A remote iOS build agent has not been configured. Configure one in Tools > Options > Tools for Apache Cordova > Remote Agent Configuration. For details and alternatives see http://go.microsoft.com/fwlink/?LinkID=511904
我在 visual studio 中配置了远程服务器,但显然这没有被拾取。有没有办法将此配置提供给批量构建?
请注意,您需要在 Mac 机器上启动远程代理,获取 IP/host、端口和 pin,然后使用工具 --> 选项 --> 工具对其进行配置对于 VS 中的 Apache Cordova,在启动构建之前。 Visual studio 不会为您启动远程服务器。
设置远程代理的过程在 https://msdn.microsoft.com/en-us/library/dn771551.aspx 中进行了说明。
在 Cordova Tools for Visual Studio 的帮助下,在 MSBuild 下构建您的 Cordova iOS 项目。您需要将 属性 添加到名为 iOSRemoteBuildServer
的 MSBuild。构建命令行应该是这样的,我以调试构建为例:
"C:\Program Files (x86)\MSBuild.0\Bin\msbuild.exe"
/p:Configuration=Debug
/p:LangName=en-US
/p:Platform=iOS
/p:DebuggerFlavor=iOSRemoteDevice
/p:iOSRemoteBuildServer=http://192.168.0.123:3000
您将在 bin\iOS\Debug\
文件夹中找到您的 IPA 输出。
如果 MSBuild 因缺少环境变量而失败,以下内容应该有所帮助(假设您使用的是 Cordova Tools CTP3.1 和 Node.js 64 位):
SET MDAVsixDir=%VS120COMNTOOLS%..\IDE\EXTENSIONS\IIC52DPN.UDK
SET NodeJsDir=C:\Program Files\nodejs\
SET NpmInstallDir=%APPDATA%\npm
要设置用于检索客户端证书的安全 PIN,您可以使用 MSBuild 属性 iOSRemoteBuildSecurityPIN
但我还没有测试过这个 属性。