How to install an ipa/app file into iPhone with command line?

对着背影说爱祢 提交于 2019-11-30 11:06:39

问题


I want to know how to install an ipa/app file into iPhone just using the command line?

The device maybe without jailbreak or jailbroken already.

I tried to use the command line: xcodebuild, but failed. I didn't find the parameter how to set the destination, maybe a real device, not a simulator.

What options do I have?


回答1:


Three ways I know of:

  • These guys wrote a tool in Ruby to do it. It uses the Fruitstrap library which in turn uses one of Apple's private APIs, so this could possibly break in the future.

  • You can also just use Fruitstrap on its own, but then you need an .app directory, whereas the Transporter Chief tool I linked above supports both .app and .ipa deployments (as required in your answer).

In either case, you need to have XCode installed for it to work, but the device does not need to be jailbroken.

  • Thirdly, there is also a binary distribution for OS X of the libimobiledevice library, which enables Linux boxes to talk to iOS devices. This has a few different tools, one of which can install valid signed IPAs to the device using this syntax:

    ideviceinstaller -i myapp.ipa
    

    The advantage of this method is that it does not need XCode or even iTunes.




回答2:


With the new Apple Configurator 2 application, you can Install Automation Tools... from the menu. This will add support for the command-line tool "cfgutil".

cfgutil allows you to install ipa's from the command-line using cfgutil install-app <AbsolutePathToIpa>. We use it on our build server to automatically update the device with the latest build.




回答3:


I've just gathered in a single post (Gist) how to achieve this, using

1.- Mattt's library Shenzhen

2.- Phonegap's library ios-deploy

Read here:

How to generate and install an IPA file




回答4:


I've tried libimobiledevice-macosx. works fine on iPhone 5. iOS version 6.1.4. I was able to install app and see log output like in xcode :) Thank you!



来源:https://stackoverflow.com/questions/14535392/how-to-install-an-ipa-app-file-into-iphone-with-command-line

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!