Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
Hey guys, after much frustration, last week I finally built my iPhone App for distribution, and uploaded it to the store.

I've made some changes to the code, and I went back today and switched back to development (instead of distribution) to try and deploy the app to my device. My code signing identity was invalid, and it looked like (for whatever reason) creating my Distribution profile invalidated the Development one.

Long story short, I started over from scratch. Requested new certificates, registered a new device, completely restored my iPod, and created new provisioning profiles for both distribution and development.

Both my certificates in the Keychain have my private key listed under them, both my provisioning profiles are listed under "Provisioning" in the organizer for my device. Both are "enabled," if you know what I mean, and both are checked.

Currently, I'm just trying to build for distribution, since this kills two birds with one stone. (Deploying the app locally for upload and to the device for testing.) In the Code Signing section of my Target/Project info windows, my Code Signing Identity is "iPhone Distribution," which pulls up my specific distribution profile, not the generic one. (Eg., it found it.)

Here's where things get weird. I can clean and build the app, and everything goes fine. Every once in a while, (or maybe every time, I can't tell) it updates the app in the finder. So chances are, I can still distribute my app to the App Store. (Which is priority #1.)

Priority #2, testing on my device, got a little more problematic. When it gets to the "Installing on device..." part in Xcode, I get the error:

"Your mobile device has encountered an unexpected error (0xE8000001) during the install phase: Verifying application"

This happens every time, no matter what I do. Has anyone else run into this problem before? Does anyone else think this is a bit of a hassle? :eek:

Thanks!!!
 

avalys

macrumors 6502
Jun 4, 2004
303
40
You cannot run applications on your device (through XCode, anyway) with the distribution profile. You have to sign the executable with your provisioning profile.

It is best to keep two separate build configurations in Xcode - "Provisionining" and "Distribution".
 

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
You cannot run applications on your device (through XCode, anyway) with the distribution profile. You have to sign the executable with your provisioning profile.

It is best to keep two separate build configurations in Xcode - "Provisionining" and "Distribution".
You mean with the Development Profile? (Since both the Distribution and Development profiles are "Provisioning Profiles")

Thanks a lot, I didn't know that the Distribution version wouldn't let you deploy as well. I'll give that a shot! :)
 

gralem

macrumors member
Mar 25, 2002
48
0
how to do it

a couple of notes:

1) You set up your DEVICES once per device. There are only development devices (no deployment devices).

2) This is important: You basically setup ONE APPLICATION ID. The same Application ID will be used for both development and distribution.

That can have any App ID Name you want, but should have an App ID (Bundle Seed ID + Bundle Identifier) of com.[yourself].* and Apple will automatically prefix it with some sort of unique identifier. This gives you a "wildcard" Application ID, that lets you develop and distribute as many applications as you want. Technically, if you have only one app, you can create a "static" app ID for that app, but it makes no sense. Give yourself a wildcard and build as many for development (or distribution) that you want.

There is some sort of problem with having individual Application IDs for one developer. It stopped working for development around SDK beta 6, and as of July 11 you can no longer have individual Application IDs for deployment purposes.

3) Provisioning now becomes simple. You need one Provisioning Profile for development and another one for distribution. One and only one of each type of provisioning profile. Each profile uses your one App ID. Put your development provisioning profile in ~/Library/MobileDevices/Provisions. Start XCODE and drag your distribution provisioning profiles to the xcode icon once it is running. XCode does something to distribution profiles (renames them at least) and puts them for you in ~/Library/MobileDevices/Provisioning Profiles/. But you cannot drag your distribution profiles into this folder directly.

4) You have to manually setup a distribution target. Follow the steps in the distribution section of the iphone developer portal.

5) To run apps on your phone in developer mode, you must set your Active SDK to Device (Project -> Set Active SDK -> Device - iPhone 2.0 (Project Settings)) *AND* set your Active Build Configuration to Debug (Project -> Set Active Build Configuration -> Debug).

To build your apps for the App Store, you must set your Active SDK to Device and set your Active Build Configuration to Distribution.

VERY IMPORTANT: When building your app for the App Store, it can be very easy to forget to Set Active SDK->Device. If Active SDK is left on Simulator, you cannot upload the resulting application to the store. When you want to upload to the App Store, set SDK to DEVICE!



I hope this helps.

---gralem
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
The rules for the wildcard app ID may have changed. Read the recently added note in the Dev Center regarding building and distributing multiple apps.
 

dgdosen

macrumors 68030
Dec 13, 2003
2,741
1,381
Seattle
You mean with the Development Profile? (Since both the Distribution and Development profiles are "Provisioning Profiles")

Thanks a lot, I didn't know that the Distribution version wouldn't let you deploy as well. I'll give that a shot! :)


Check out the instructions on the portal for Distrbution. They clearly show the need to create a new Profile in XCode called "Distribution"
 

gralem

macrumors member
Mar 25, 2002
48
0
I forgot about your DEVICE

There is something else... you need to remove all non-wildcard provisioning profiles from your iphone manually (not via xcode) and from your home directory. If you have all sorts of provisioning profiles on your system, I would go empty out ~/Library/MobileDevices/Provisions/ and ~/Library/MobileDevices/Provisioning Profiles/. Then I would re-download my 2 wildcard profiles and install them.

To remove the profiles off your device, go to Settings -> General -> Profile (2nd-to-last item). Hopefully, you will only have your 1 development profile on your phone. If you have a list of profiles, remove your non-wildcard profiles from your phone.
 

dgdosen

macrumors 68030
Dec 13, 2003
2,741
1,381
Seattle
A couple of other gotchas that caused frustration:

1)Icon naming: I needed to edit the plist file with my icon name. XCode doesn't store the ".png" extension by default and iTunes would keep bouncing my upload saying I didn't have a valid icon file.

Just to be safe, I'm only naming my icons "icon.png" and editing that in the PNG file.

2) The name to use for your "Code Signing Identity": It used to be that we'd to use "iPhone Developer: FirstName LastName" for the identity, but per their updated instructions, It looks like you now need to use: "iPhone Developer" for debug/release builds and "iPhone Distribution" for distribution builds. My problem is, I sometimes didn't see the profile information you'd expect in the XCode drop downs when do this, but it seems like logging out and logging back into a session seems to help. This is a very flaky process.

3) (someone correct me if I'm wrong) You can only use a Distribution Provision for ONE upload. If you make a small change an re-up it, you need to create a different Distribution Provision.
 

Vicegrip

macrumors newbie
Jul 15, 2008
7
0
Same constant Error:
Your mobile device has encountered an unexpected error (0xE8000001) during the install phase

What I have done:

1) created an app ID of the form com.myname.*
2) created a certificate per the Portal's instructions
3) registered my iphone's ID, as obtained from the organizer, on the Portal page.
4) created two profiles called "Development" and "Distribution"

I have placed the development provisionning file in ~/Library/Mobile Device/Provisions and the distribution one was placed by XCode (after I dragged it over the IDE icon) into ~/Library/Mobile/Provisioning Profiles. The distribution file is renamed per expectation.

5) in my info.plist file changed Bundle Identifier to be: com.myname.${PRODUCT_NAME:identifier}
6) in the build setup, I've set Code Signing Identity to: iPhone Developer as per instructions on the Portal.

I've tried everything I can think of so far and still get that unhelpful error message.

Observation:
Neither of the two provisioning profiles listed in the Organized can be checked. The checkbox appears to be disabled.
 

drivefast

macrumors regular
Mar 13, 2008
128
0
oh boy. i guess i should consider myself lucky that i only spent one day trying to figure out all the things the OP complains about. what seems to have ultimately worked for me was related to what gralem described here:

There is something else... you need to remove all non-wildcard provisioning profiles from your iphone manually (not via xcode) and from your home directory. If you have all sorts of provisioning profiles on your system, I would go empty out ~/Library/MobileDevices/Provisions/ and ~/Library/MobileDevices/Provisioning Profiles/. Then I would re-download my 2 wildcard profiles and install them.

To remove the profiles off your device, go to Settings -> General -> Profile (2nd-to-last item). Hopefully, you will only have your 1 development profile on your phone. If you have a list of profiles, remove your non-wildcard profiles from your phone.

his post was not here at that time, but i remember i have been able to build-n-run my app into the iphone after i cleaned up both the provisioning directories on my mac (that meant physically deleting the files) *and* deleted the provisioning profiles from my phone. then tried the trick with dragging the provisioning profile over the xcode icon again. i'm not at all sure that i can reproduce that, and i dont even think about trying again.

by the way, this whole topic contains great info on stuff that is poorly documented by apple and shaky in the program portal, and i think parts of it should make it into the sticky at the top of the list. gralem - your posts were great, thank you.
 

ausyeti

macrumors newbie
Mar 6, 2008
4
0
Europe
A couple of other gotchas that caused frustration:

2) The name to use for your "Code Signing Identity": It used to be that we'd to use "iPhone Developer: FirstName LastName" for the identity, but per their updated instructions, It looks like you now need to use: "iPhone Developer" for debug/release builds and "iPhone Distribution" for distribution builds. My problem is, I sometimes didn't see the profile information you'd expect in the XCode drop downs when do this, but it seems like logging out and logging back into a session seems to help. This is a very flaky process.

That all sounds just great, but doesn't match my experience today at all :(
In way of introduction, I registered for a certificate in March and was also just accepted last weekend. So far, i also haven't got past the 0xE8000001 error...

In reference to your (louden's) post, I haven't found any documentation telling me how to incorporate my certificates into the build and code signing process. Which document or page have I missed?

I found the Code Signing section in the build settings, but when set to "iPhone Developer", "iPhone Developer: firstname lastname" or just "firstname lastname" I get an error during the build process saying that no such certificate can be found - build failed.

The only way I can get the build to work is by using the certificate's "other name" (10 characters, seemingly random - found by viewing the certificate's info in Keychain Access).

If I then try to run my app on the device I also get the now infamous 0xE8000001 error :confused:

I've gone through all of the tips mentioned in this thread, but I just can't get past the code validation. I've set up a my developer certificate, wildcard app certificate, the mobile device certificate and a development provision profile. Everything seems to match the documentation until I actually try to build my app.

Oh... and yes, my app works fine in the simulator, unsigned :)

Cheers, and thanks for the forum! After working in this dark closet for so long its nice to know there are still others out there :cool:
 

killers

macrumors newbie
Jul 16, 2008
1
0
Hello all,

I am new to Xcode, new to mac and new to iPhone development like most people except the mac part ;)

Ok I have done the following:

1. Created my App ID on the portal.
2. Created my Provisioning Profile and associated the App ID with it on the portal.
3. Dragged the Provisioning Profile onto the XCode icon and it created the profile in the correct location.
4. I have selected Device - Any iPhone OS Device: iPhone Developer for Code Signing Identity in the Project Properties/Build tab.
5. I have selected Device - Any iPhone OS Device: Default Provisioning Profile for Code Signing Identity in the Project Properties/Build tab. (This is the only option that is enabled. There is an iPhone Developer but its disabled.)
6. Code Signing Resource Rules Path does say: iphoneos2.0/ResourceRules.plist but not sure if that means anything.
7. Provisioning in Organizer for my device has my new Provisioning Profile and it is checked.
8. My iPhone has my Provisioning Profile when I goto to Settings\General.

What I have not seen in this discussion is what the Bundle identifier should be set (Info.plist) to when the default Bundle Identifier is com.yourcompany.${PRODUCT_NAME:identifier}. For example if your App ID is XYZ.* do you change this to XYZ.*${PRODUCT_NAME:identifier} or do you change it to XYZ.* with nothing else.

Besides the Bundle Identifier in Info.plist where else do you need to set this XYZ.* (App ID) to?

I still get the 0xE8000001 error when I Build and Go :(

Also when I click Run when in Device | Debug I get this:

The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP).

Thanks
 

Vicegrip

macrumors newbie
Jul 15, 2008
7
0
Some insights

Here are some of the mistakes I was making. I did not correctly change the identity, following some instructions I had read. It was: iPhone Developer

I have changed the identity configuration to: iPhone Developer: <myname>

I also had not properly installed the certificates. You should have THREE certificates installed in your keychains.

1) the WWDR certificate
2) your development certificate
3) your distribution certificate
NOTE: contrary to some advice posted in various places, I dragged BOTH my developer profile and distribution profile onto XCode. I also copied the developer profile file into the ~/Library/MobileDevice/Provisions folder (which you have to create yourself). You can also drag it directly unto the organizer or import it from the organizer if you prefer to.

Your certificate is WRONG if there is a red icon on it identifying it is not trusted.

Finally, verify that the device ID you entered is correct. I still have no idea why this is the case, but the original device ID I copy pasted from the Organizer was incorrect. I updated Portal with the correct one once I noticed the Device ID on the Portal site did not match anymore what was in Organizer.

I had previously (a while ago) connected an iTouch... I suspect there may be a bug in the Organizer that caused it to display the Touch's UUID. At least thats all I can think of right now.
 

Insomniac74

macrumors newbie
Jul 16, 2008
2
0
Got similar errors as everyone here and also looking for the solution. The debugger has the following output:
Code:
Thu Jul 17 03:33:07 unknown afcd[208] <Error>: user mobile has uid 501

Thu Jul 17 03:33:07 unknown afcd[208] <Error>: mode is 0x41e8
Thu Jul 17 03:33:07 unknown mobile_installation_proxy[210] <Error>: install_embedded_profile: Skipping the installation of the embedded profile
Thu Jul 17 03:33:07 unknown mobile_installation_proxy[210] <Error>: verify_executable: Could not validate signature: e800800e
Thu Jul 17 03:33:07 unknown mobile_installation_proxy[210] <Error>: preflight_application_install: Could not verify /var/tmp/install_staging.KxJA/AccelerometerGraph.app/AccelerometerGraph
Thu Jul 17 03:33:07 unknown mobile_installation_proxy[210] <Error>: install_application: Could not preflight application install
Thu Jul 17 03:33:07 unknown mobile_installation_proxy[210] <Error>: handle_install: Installation failed
 

Insomniac74

macrumors newbie
Jul 16, 2008
2
0
OK never mind caught it... duplicate key in my Keychain from an earlier failed attempt was confusing proxy.
 

NeonSurgeDev

macrumors newbie
Jul 14, 2008
6
0
Southern California
Here's a tip

I have changed the identity configuration to: iPhone Developer: <myname>

Hey, having done some programming with a team, with each team member having their own certificate, you should not be setting the above to a static value. Instead... set your identity configuration to just: iPhone Developer

XCode searches through your Keychain and finds any entry that contains that text. It automatically finds your cert and uses it. When your co-worker checks out the code (assuming you're using a versioning system) they can also use the same targets, and build it for the device.

Also, to get it for distribution, have a separate target with iPhone Distribution which should be pretty much an exact duplicate of your "Release" target, except for that part.

We found this little gem by viewing the Apple Video on Release and Distribution on the AppStore, the latest addition to their iPhone video series. They actually don't mention this but if you look at their configuration, it's how they have it setup.

Cheers!
 

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
Wow... absolutely insane.

I completely did *everything* over again, from scratch. New certificate, new provisioning profiles, wiped and restored the device.

Still, SAME error.

Got so frustrated, I left it for all of today. Came back 5 minutes ago, and decided to do a final google search. Found the solution.

Solution, FINALLY: The bundle identifier in the info.plist. It should not be the same as your App Id. My App ID is com.craigotis.*, and it gave it something like ABCDEFG.com.craigotis.*. This is what I put in the info.plist. It's *not* what you're supposed to use. I changed it to "com.craigotis.${PRODUCT_NAME:identifier}" literally, and it worked. Hope this helps someone.

Apple really needs to streamline this, it's getting ridiculous.
 

DipDog3

macrumors 65816
Sep 20, 2002
1,191
812
SOLVED my problem with Ad Hoc Distribution...

SOLVED my problem with Ad Hoc Distribution...

First, look at your ad-hoc provisioning file in text edit (just view it, don't overwrite it!)

If it does NOT contain a line that says "<key>get-task-allow</key>" then you need to go to the program portal and get a NEW ad-hoc provisioning profile.
There is a workaround where you can use the provisioning profile without this key, but Apple apparently has added this key to the ad-hoc provisions, and you might as well have the latest.

However, that is not the final fix.

The next thing you have to do is add a new file to the root of your project ... file, new file, iphone, code signing, entitlements. Call it "dist.plist" ...

Open that file, and it will say "get-task-allow" with a checkmark for "true" -- this needs to be FALSE. Uncheck the checkbox, or if in text mode, type in "false"

OK, almost there!!!

Open the target build info window and where it says "Code Signing Entitlements" add "dist.plist"

CLEAN THE BUILD

BUILD AND GO

ENJOY.
 

apolson

macrumors newbie
Dec 2, 2007
3
0
Wow... absolutely insane.
Solution, FINALLY: The bundle identifier in the info.plist. It should not be the same as your App Id. My App ID is com.craigotis.*, and it gave it something like ABCDEFG.com.craigotis.*. This is what I put in the info.plist. It's *not* what you're supposed to use. I changed it to "com.craigotis.${PRODUCT_NAME:identifier}" literally, and it worked. Hope this helps someone.

Apple really needs to streamline this, it's getting ridiculous.

Thank you! Thank you! Thank you! Like you I was getting completely frustrated with this process and couldn't figure out what was wrong. All I wanted to do was load and run an example app. This suggestion pushed me over the top and now I'm developing. :D
 

caveman_uk

Guest
Feb 17, 2003
2,390
1
Hitchin, Herts, UK
Same constant Error:
Your mobile device has encountered an unexpected error (0xE8000001) during the install phase
This link tells you how to fix it.

Link

Basically you need to put a real value in the Bundle Identifier field in Info.plist. Something like the com.mycompanyname.appname ... It didn't work for me with the defaults.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.