IOS development Note (7) a provisioning profile named embedded. mobileprovision already exists on this computer

Source: Internet
Author: User

Http://www.syndicatedmethods.com/SyndicatedBlogs/post/2010/07/02/A-provisioning-profile-named-embeddedmobileprovision-already-exists-on-this-computer-Do-you-want-to-replace-it.aspx

 

By Stephen dewitsky posted on July 2

Ad hoc distribution of iPhone, and now iPad, applications can feel like a circus sideshow. developers come clambering out of the provisioning portal like its an undersized automobile to jump through flaming code signing hoops. generate a certificate, create an Application ID, add devices, create a provision, install them all and try not to get burned. if you fail to do one step, or perform a step I Ncorrectly, the application build results will usually guide you to the solution. But what about when you do everything by the book and you still get an error?

The majority of my distribution issues usually sprout up when Apple releases a new version of the iPhone SDK. this time it happened to be installing iPhone SDK 4. after upgrading I needed to generate some ad hoc distributions. since these apps are only supposed to be targeted for iPhone devices, the "base SDK" gets configured for "iPhone device 4.0" and the "targeted device family" is set to "iPhone ". the only other parameter that needed changing was the "iPhone OS Deployment target ". this app was not quite ready for "4.0" so I switched the value to "iPhone OS 3.1.3 ".

I configured three apps using the described values in exactly the same fashion. the ad hoc distributions were generated and then zipped off to be installed. to my dismay I Have ed an email saying that one of the apps was incapable of being installed. when the app is dragged into iTunes, nothing happens. successive attempts to drag the app into iTunes prompts this warning:

A provisioning profile named embedded. mobileprovision already exists on this computer. Do you want to replace it?

Click the "yes" button. nothing happens. click the "no" button. nothing happens. at this point, I have no idea if I want to replace it. I just want the app to sync with iTunes. time and time again I verify that all provisions are installed and configured properly. of course, none of which are named embedded. mobileprovision. search GoogleEmbedded. mobileprovisionAnd see what turns up. Maybe a Twitter feed from a confused and frustrated developer.

There may be a multitude of reasons why this warning wocould appear when attempting an ad hoc installation but let me share with you the reason I was experiencing this issue. contrary to the message, the problem had nothing to do with an existing embedded. mobileprovision profile. some secret sleuthing lead me to believe that the issue originated when I choose a different "iPhone OS Deployment target" in the Project Settings. while I cannot prove this, I can at least show you some things to check manually before ianarchy.

Every application has an info. plist file that is created out of the box. Find it in your application "Resources" group and it may look something like this:

 

 

Notice the dictionary entry"Application requires iPhone Environment". Notice the checkbox is clearly checked. that makes sense. we are developing an application using the iPhone SDK so it is only necessary that the application requires an iPhone environment. now open that same file as "plain text" to view the XML document which makes up this info dictionary. ours looks something like this:

<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype plist public "-// Apple // DTD plist 1.0 // en" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<Plist version = "1.0">
<Dict>
<Key> cfbundledevelopmentregion </key>
<String> English </string>
<Key> cfbundledisplayname </key>
<String >$ {product_name} </string>
<Key> cfbundleexecutable </key>
<String >$ {executable_name} </string>
<Key> cfbundleiconfile </key>
<String> </string>
<Key> cfbundleinfodictionaryversion </key>
<String> 6.0 </string>
<Key> cfbundlename </key>
<String >$ {product_name} </string>
<Key> cfbundlepackagetype </key>
<String> appl </string>
<Key> cfbundlesignature </key>
<String> ???? </String>
<Key> cfbundleversion </key>
<String> 1.0 </string>
<Key> lsrequiresiphoneos </key>
<True/>
<Key> nsmainnibfile </key>
<String> mainwindow </string>
<Key> uistatusbarstyle </key>
<String> uistatusbarstyleblackopaque </string>
</Dict>
</Plist>

The pertinent key/value pair we are looking for is"Lsrequiresiphoneos"And an XML node indicating<True/>. 999 times out of 1000 I wowould guess this is normal. But on my 1000th attempt to build an app I see different a value:

<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype plist public "-// Apple // DTD plist 1.0 // en" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<Plist version = "1.0">
<Dict>
<Key> cfbundledevelopmentregion </key>
<String> English </string>
<Key> cfbundledisplayname </key>
<String >$ {product_name} </string>
<Key> cfbundleexecutable </key>
<String >$ {executable_name} </string>
<Key> cfbundleiconfile </key>
<String> </string>
<Key> cfbundleinfodictionaryversion </key>
<String> 6.0 </string>
<Key> cfbundlename </key>
<String >$ {product_name} </string>
<Key> cfbundlepackagetype </key>
<String> appl </string>
<Key> cfbundlesignature </key>
<String> ???? </String>
<Key> cfbundleversion </key>
<String> 1.0 </string>
<Key> lsrequiresiphoneos </key>
<String> Yes </string>
<Key> nsmainnibfile </key>
<String> mainwindow </string>
<Key> uistatusbarstyle </key>
<String> uistatusbarstyleblackopaque </string>
</Dict>
</Plist>

Notice how the value<Key> lsrequiresiphoneos </key>Has been modified from a (bool)<True/>To a (string)<String> Yes </string>. How on earth this happened I cannot guarantee, but I can tell you that this is the reason"A provisioning profile named embedded. mobileprovision already exists on this computer". If you take the time to manually Replace the <string> node with a <true/> node you may be one step closer to a successful ad hoc distribution.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.