简体   繁体   English

如何从命令行将应用程序部署到我的iPhone?

[英]How can I deploy an app to my iPhone from the command line?

I can already build an app with a distribution profile via the command line 我已经可以通过命令行构建一个带有分发配置文件的应用程序

xcodebuild -configuration Distribution -sdk iphoneos3.0 clean build 

However, I'd like to go one step further and install the app to the connected iPhone and execute it ( as if I'd pressed Build and Run in XCode ). 但是,我想更进一步,将应用程序安装到连接的iPhone上并执行它(好像我在XCode中按下了Build and Run)。

The final command listed in the build commands window ( cmd+shift+B ) is CodeSign, which as far as I know just signs the code and nothing else. 构建命令窗口(cmd + shift + B)中列出的最后一个命令是CodeSign,据我所知,只是签署了代码,没有别的。 So I'm not sure what command ( if any is available ) I can run from the command line to install and run the app on the iPhone. 所以我不确定什么命令(如果有的话)我可以从命令行运行以在iPhone上安装和运行应用程序。

I'm running the official SDK, not a jailbroken phone. 我正在运行官方SDK,而不是越狱手机。

If you have a post build script you should be able to install it and run it using a script. 如果您有一个后期构建脚本,您应该能够安装它并使用脚本运行它。 If you're jailbroken you should be able to use SCP and then execute it directly. 如果你被越狱了,你应该能够使用SCP然后直接执行它。

There may be an AppleScript or automator way of solving the problem as well. 可能还有AppleScript自动解决问题的方法。

I've written a blog entry on how to install apps on a connected iPad / iPhone without using Xcode or iTunes. 我写了一篇关于如何在连接的iPad / iPhone上安装应用程序而不使用Xcode或iTunes的博客文章。 This method does NOT require JailBreak - any iOS device will work. 此方法不需要JailBreak - 任何iOS设备都可以使用。 Only works on the Mac though. 仅适用于Mac。

This method allows you to run a Terminal command to install an iPA file. 此方法允许您运行Terminal命令以安装iPA文件。

http://pervasivecode.blogspot.co.uk/2012/06/install-ios-app-ipa-file-without-xcode.html http://pervasivecode.blogspot.co.uk/2012/06/install-ios-app-ipa-file-without-xcode.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM