通过命令行在 iPhone 设备中安装应用程序
我正在使用 xcodebuild install -alltargets -iphoneos4.2 -activeconfiguration Provisioning_profile=path_of_my_provisioningprofile code_sign_identity=identity。 该命令正在构建我的应用程序,我也正在获取构建文件(.app)。 但是如何从命令行将应用程序安装到设备中。 请帮助我解决这个问题。
I'm using xcodebuild install -alltargets -iphoneos4.2 -activeconfiguration provisioning_profile=path_of_my_provisioningprofile code_sign_identity=identity
.
This command is building my app and i am getting build file (.app) also.
But how to install the app in to device from command line.
Please help me in this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
Fruitstrap
不再维护,要获得更新的项目,请查看 PhoneGap 的名为ios-deploy
。要安装,请运行:
npm install -g ios-deploy
以下是如何使用它的一些示例:
Fruitstrap
is no longer maintained, for a more up to date project checkout the fork by PhoneGap calledios-deploy
.To install run:
npm install -g ios-deploy
Here are some examples of how to use it:
水果带:
https://github.com/ghughes/fruitstrap
这是一个很好的设置教程:
http://sgleadow .github.com/blog/2011/11/05/installing-ios-apps-on-the-device-from-the-command-line/
Fruitstrap:
https://github.com/ghughes/fruitstrap
Here's a good tutorial to set it up:
http://sgleadow.github.com/blog/2011/11/05/installing-ios-apps-on-the-device-from-the-command-line/
环顾四周发现https://github.com/benvium/libimobiledevice-macosx。这是从 libimobiledevice 到 MAC-OS X 的移植。它非常有用,并且不需要越狱。 :P
Looking around found https://github.com/benvium/libimobiledevice-macosx. This is a port from libimobiledevice to MAC-OS X. Its very useful and no jailbroken is needed. :P
使用这个漂亮的脚本:http://gamua.com/blog/2012/03/how-to-deploy-ios-apps-to-the-iphone-via-the-command-line/
- 然后通过 USB 将 iphone 设备连接到运行此命令的 mac
要在命令行上启动应用程序:
格式:
instruments -w; -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate <应用程序名称>; -e UIASCRIPT Launch-App.js
我的 Launch-App.js 只有一行 -
var target = UIATarget.localTarget();
这必须足以使用命令在设备上启动应用程序线
Use this beautiful script : http://gamua.com/blog/2012/03/how-to-deploy-ios-apps-to-the-iphone-via-the-command-line/
- Then connect iphone device via usb to mac running this command
To launch app on command line:
format :
instruments -w <deviceid> -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate <applicationname> -e UIASCRIPT Launch-App.js
My Launch-App.js has only one line -
var target = UIATarget.localTarget();
This must be sufficient to launch application on device using command line
怎么样:
如何使用命令行将 ipa/app 文件安装到 iPhone 中?
使用 libimobiledevice 的第三种解决方案。
What about this:
how to intall an ipa/app file into iPhone with command line?
Third solution with libimobiledevice.
ipatool:https://github.com/majd/ipatool
步骤 1 :搜索应用程序包 ID
第 2 步:下载 IPA
Easy!
ipatool: https://github.com/majd/ipatool
Step 1: Search the app bundle id
Step 2: Download the IPA
Easy!
在 MAC 上安装以下软件包
成功安装以上软件包后。
使用以下命令在 iOS 设备上安装 .ipa 文件:
谢谢
Install following packages on MAC
After successfully installed above packages.
Use following command to install .ipa file on iOS devices:
Thanks
如果您正在编写 Flutter 应用,请按照这些说明操作在 flutter.dev 上设置您选择的 IDE(包括在 XCode 中设置您的签名密钥)。在 IDE 中运行后,您可以通过以下步骤在连接的设备上构建并启动应用程序:
flutter devices
查找您的设备 ID 并复制第二个中列出的十六进制字符串柱子。flutter -d DEVICE_ID run --release
(或将--release
更改为--debug
构建并部署调试版本)。flutter 命令将处理生成 XCode 来编译应用程序。它的运行速度不会比 XCode 通常的运行速度快(根据我的经验)。
请确保设备与 Mac 保持连接,无论是通过 USB 电缆还是通过共享无线网络。
If you're writing a Flutter app, follow these instructions at flutter.dev to set up your IDE of choice (including setting up your signing key in XCode). After you have it working in an IDE, you can then build and launch the app on a connected device by these steps:
flutter devices
and copy the hex string listed in the second column.flutter -d DEVICE_ID run --release
(or change--release
to--debug
to build and deploy the debug version).The flutter command will handle spawning XCode to compile the app. It will not run any faster than XCode usually does (in my experience.)
Be sure to keep the device connected to your mac, whether via a USB cable, or over a shared wireless network.