24

I've followed all the directions from Apple and some other blog posts. I've archived the app, made .plist and .ipa files, put them on a server and linked to them. I can install the provisioning profile just fine. But when I click on the link to install the app (in safari on the iphone), nothing happens. No error message. Nothing. This is what the link looks like:

<a href="itms-services://?action=download-manifest&url=http://mydomain.com/test/myApp.plist">Install the app</a>

Any idea why this isn't working? It seems the itms-services protocol is just dead. MIME types are fine (I can point to the plist file in the address bar and it displays as text).

pjs
  • 18,696
  • 4
  • 27
  • 56
sol
  • 6,402
  • 13
  • 47
  • 57
  • Does the phone have iOS 4+? Does the app install on the phone using iTunes (direct connect)? –  Jan 14 '11 at 20:23
  • It's not a direct answer, but I will suggest TestFlight, an incredibly good, free service that takes care of all of that and more. I and many of my developer friends and associates use it, and I highly recommend it. At some point I'm sure they'll start charging for it, or perhaps for add-on services, but it's so helpful that I'm sure I'll happily pay. http://testflightapp.com – Matthew Frederick Apr 03 '11 at 16:58
  • 1
    Hi Sol, Did you resolve this? I am facing same issue! Can you help me please. I have added MIME types for .plist and .ipa files but still not working! – Paresh Masani Apr 18 '12 at 17:19

17 Answers17

17

The answer is actually very simple: The URL needs to be "double-escaped", i.e.

itms-services://?action=download-manifest&url=https://example.com/My%2520App.plist

This is because the value gets unescaped to https://example.com/My%20App.plist before being treated as another URL. This gets unescaped by the server at example.com to a space.

The parser does not treat + specially: ...&url=https://.../test/a+b results in "GET /test/a+b HTTP/1.1" appearing in the Apache logs. (It is unwise to assume that all query strings are application/x-www-form-urlencoded; this is only standardized in HTML.)

Incidentally, it looks like itms-services uses +[NSURL URLWithString:] to validate URLs: url=.../My%20App.plist results in no request because [NSURL URLWithString:@"https://.../My App.plist"] returns nil. However, there's a long-standing bug in NSURL: It will escape a single invalid (BMP) character at the end instead of returning nil. My test cases

  • url=.../test/%3c results in the log "GET /test/< HTTP/1.1" (this is definitely invalid HTTP!)
  • url=.../test/%0a results in an error on device but no log message (because Apache treats it as a malformed request)
  • url=.../test/%0d results in the log "GET /test/\r HTTP/1.1"
tc.
  • 33,468
  • 5
  • 78
  • 96
  • It worked fo rme when I used %20 in my plist file and %2520 in my itms-services link. – Glenn Mar 01 '16 at 01:05
  • This was absolutely my final issue. I had SSL working flawlessly. I had Image URLs provided. And everything else, but the manifest URL has to be double encoded! – levigroker Aug 19 '16 at 21:03
16

I had similar symptoms when I had a space in the filenames of the manifest file and the application archive file. I removed all spaces from them and the wireless install worked for me. It looks like your manifest doesn't have a space, so maybe your app file does?

ptrico
  • 1,049
  • 7
  • 22
  • 4
    I install from a Jenkins build server - you need to ensure the project name (and therefore the URL) has no spaces because the itms-services handler in iOS doesn't cope with spaces even if they are correctly URLencoded. – jhabbott Jun 01 '11 at 10:42
  • 2
    @jhabbott THANK YOU... I just spent 2 hours debugging and trying different ways of url encoding the `itms-services` `url` parameter. Taking the spaces completely out of the name fixed it... Apple fails yet again. – chown Aug 21 '12 at 01:19
  • 1
    @chown &jhabbott **It is not an Apple failure** see my answer bellow it is the way query parameters have to be escaped in URLs. – Jordan Mar 16 '13 at 11:01
  • @Jordan I was not able to get it working by doing regular URL encoding (with plus replacing spaces) and I think I even read somewhere on official Apple docs that this is done by them intentionally (no idea *why* though). If I find the page I'll link it. – chown Mar 16 '13 at 19:20
4

itms-services is an identifier by which apple/iphone will identify that it should validate the certificate and it should install.

To validate the provisioning profile before installing the ipa file it will connect to "ax.init.itunes.apple.com" and "ocsp.apple.com".

If you are using any intranet connection please check whether these links are accessible or not? if not, you cannot install the application via over the air.

& minimum OS on the device should be 4.0

CKT
  • 1,223
  • 4
  • 21
  • 39
  • What is ocsp.apple.com? It is not available from anywhere! – Paresh Masani Apr 18 '12 at 17:28
  • Same for me, It is not available – xarly Nov 21 '12 at 19:19
  • 1
    you might be able to find oscp.apple.com and ax.init.itunes.apple.com by pinging the servers. In any case, this might not help, because when I tried deploying pseudo-signed apps to jailbroken devices, I had to change the DNS server so that the iOS device _couldn't_ access those servers. The device will still install if it doesn't get a response from both of the servers; they are only used to check if the developer certificate is still valid. – user1522362 Dec 31 '12 at 20:43
  • 1
    According to apple documents "it acesses ax.init.itunes.apple.com for obtaining the current file-size limit for downloading apps over the cellular network. If this site isn’t reachable, installation may fail then it accesses ocsp.apple.com to check the status of the distribution certificate used to sign the provisioning file" – Durai Amuthan.H Sep 17 '13 at 19:26
3

I was using IIS 6.0 and the index.html page was loading but when the user clicked on the .plist link from the apple device (i.e) iphone 4, I kept getting "cannot connect www.mywebsite.com". The solution besides adding the MIME Type, was to share the Web Sharing where the .plist file was and the most important: change the security access of the manifest .plist file. gave full control to default windows user

carlachip
  • 111
  • 1
  • 2
  • 4
    I have given full permission to plist file, still it doesn't do anything! What do you mean by Web sharing? Thanks. – Paresh Masani Apr 18 '12 at 17:23
  • 1
    Yes, I would like to know, as well, what you mean by Web Sharing. And how do you change the securiy access of the mainfest .plist file? – user717236 May 25 '12 at 04:07
2

Seems like you have several pointers here to what might be the problem, for next time: check the device console from Xcode Organizer, it usually contains useful information regarding failed OTA distribution.

Sveinung Kval Bakken
  • 3,715
  • 1
  • 24
  • 30
  • That sounds really awesome, but how does XCode know if your OTA distribution failed? It's between your web server and the device, right? Is there some way to manage OTA distribution from XCode that I don't know about? Or does it detect the errors if you have your device tethered while trying OTA distribution? – morningstar Jun 10 '13 at 18:24
  • 2
    No, I meant check Xcode Organizer's Device Log while trying to download using OTA, might give you some hints. – Sveinung Kval Bakken Jun 15 '13 at 21:31
  • This answer helped me figure out my issue. Good call. – woody121 Dec 03 '13 at 06:00
2

make MIME settings of your server correct.

google for it you'll find the right way

http://developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html

erk ekin
  • 29
  • 1
  • This answer was really helpful!! We had to ensure that the MIME types are stetted correctly and also, that the file is accessible!! Thank you!!! – NicTesla Apr 20 '12 at 08:08
1

I had the same problem as above. After trying all of the above and failing, I figured out that when I was archiving my app, I didn't put in the application URL in the settings, thus this URL was never in my plist file. Make sure when you look at your plist file that the application URL is in there.

Dave Tsay
  • 409
  • 1
  • 6
  • 14
1

As many others before, I also encountered this daemon of a problem. In my case the problem was that the plist file was not correctly formated. Be sure that the file follows the exact pattern outlined in the documentation: http://developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html

Paul Hunter
  • 4,453
  • 3
  • 25
  • 31
1

For anyone who is interested in dynamically generating their plist, this example is PHP:

$appUrl='itms-services://?action=download-manifest&url=http://server/iOSpList.php?'.
                'url%3D'.$app['url'].
                '%26bundle%3D'.$app['bundle'].
                '%26version%3D'.$app['version'].
                '%26name%3D'.$app['name'];

Also, make sure the mime type is returned as application/xml.

James
  • 371
  • 4
  • 3
1

Be sure that all the URLs are fully qualified. Including those for the png files.

bgarick
  • 71
  • 3
  • Please tell me where I can find a reference document for what makes a qualified URL. Some characters can be escaped out, but not app. – Alex Zavatone Jan 08 '13 at 17:47
  • Fully qualified means it starts with http://, has the domain name, etc. Not a relative path. Escaping characters is sometimes necessary, but that's a different issue. – morningstar Jun 10 '13 at 19:04
0

I met this problem exactly as you described, and my problem turned out to be I missed "http://" in the url. After I added this part into the url field in .plist file, everything worked fine. Hope it helps!

sonoshin
  • 241
  • 3
  • 6
0

I had similar problems when distributing my app using AdHoc provisioning profile. I tried removing old profiles, generating new profiles, restarting Xcode, cleaning and rebuilding, checking URL path names, etc. The app would install on some devices but not others.

What worked for me was to change the app version and build to a newer number.

kzia
  • 559
  • 3
  • 8
  • 17
0

I found that 'cannot use index.html' for ios 6 to install the app. Fixed by change from 'index.html' to 'dev.html'. hope will help someone

Cullen SUN
  • 3,517
  • 3
  • 32
  • 33
0

I tried some at the same time, so I'm not sure which one was the good one.

Created a wildcard app id (name wildcard, bunde identifier *), created a profile for this app and signed the ipa with this profile.

Registered one device on the provisioning portal.

named the file where I linked the app dev.html instead index.html

jcesarmobile
  • 51,328
  • 11
  • 132
  • 176
0

The proper solution is to replace spaces with "+"(plus) as ...url=... means it is query string parameter and they shall be encoded as form data parameter when encoded for URLs.

From here W3.org - Forms in HTML documents:

"Control names and values are escaped. Space characters are replaced by '+', and then reserved characters are escaped as described in [RFC1738]"

P.S. That solved the same issue we encountered during development of icenium.com. You can check AdHoc provision signing there and see how it works for projects with spaces in names.

Jordan
  • 187
  • 1
  • 5
  • Hate to tell you Jordan, that this doesn't work in iOS 5.0.1. Replacing the space in a URL with a + returns a server can't be found error. In iOS 6.1, the same behaviour appears. – Alex Zavatone Mar 19 '13 at 19:55
  • I checked the code and it appears we use + but implement a custom handler and url is like this: https://server.com/plist?pn=a+app+name+with+space and once again encode url in the end to something like this: itms-services://?action=download-manifest&url=https%3A%2F%2Fserver.com%2Fplist%3Fpn%3Da%2Bapp%2Bname%2Bwith%2Bspace (we set ContentType in handler to text/plain but text/xml is maybe better, we have .ipa served as ContentType: application/octet-stream) – Jordan Mar 28 '13 at 13:22
  • the url inside plist can work with space escaped with %20 ```https://server.com/folder%20with%20space/app%20project%20with%20space.ipa``` – Jordan Mar 28 '13 at 13:24
  • 1
    WOW. Thanks for this. I'll test on our end. I agree that the URL within the pList can be space escaped, but it also works in my testing without the space char being escaped at all. This needs to be documented. So crazy. – Alex Zavatone Mar 29 '13 at 14:09
-1

If you are sending the link from an email, you CANNOT use HTML formatting in the email. You must use "rich text" formatting

No idea why but thats how it is (At least with Outlook)

MobileMon
  • 8,341
  • 5
  • 56
  • 75
-1

I think you also need to make it https, as in https://mydomain