35

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
roastjj
  • 351
  • 1
  • 3
  • 3
  • 1
    I don't think it's possible. But what's wrong with installing app through Xcode or TestFlight? – Shmidt Jan 26 '13 at 09:02
  • oh, I want to run unit test on a real device by Instruments. so I have to write a script to intall an ipa/app file in to iphone auto-intall. – roastjj Jan 26 '13 at 09:08
  • You can't, the best you can do is use wireless installation from the iDevice. – borrrden Jan 26 '13 at 09:21
  • Yes, I search the answer. and it shows use openSSH and wifi, but I think it's unsteady to deploy unit test. – roastjj Jan 26 '13 at 09:42
  • **ios-deploy --debug --bundle your_iPA_Path.app**. using this command you can install ipa on device but make sure you have installed provisioning profile and certificate. – ADJ Sep 15 '17 at 05:26

4 Answers4

38

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.

user533676
  • 575
  • 3
  • 11
  • Does this (libimobiledevice) work on latest ios devices like ios 9? I am being thrown error "Could not start com.apple.mobile.installation_proxy!". – Dinakar Aug 31 '16 at 11:55
29

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.

fguchelaar
  • 4,779
  • 23
  • 36
  • This is should be the answer :) Thanks! – Jan Sep 20 '16 at 06:33
  • This tool does not work well. There's no way to simply 'update' the app. You have to remove it first, and (so far) during my testing it just immediately deletes the app anyway after a "successful" install (while other ways of installing it like XCode/TestFlight work fine for me). – Wisteso Oct 19 '16 at 03:04
  • I can't believe Apple doesn't allow you to upgrade an app with this tool. Otherwise, this would be the best solution. – tmoore Dec 08 '16 at 14:48
  • 2
    Just tested this. (Building with xcode 10.2, Running on iOS 13.3) It updates app now beautifully, BUT the actual app has to be backgrounded. While app is in foreground, it won't update. When you press home button, then you can see the icon being updated. Pretty neat! – Guntis Treulands Feb 07 '20 at 11:17
4

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

Sophy Swicz
  • 1,307
  • 11
  • 21
1

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!

0x8BADF00D
  • 7,138
  • 2
  • 41
  • 34