How to build Adhoc build to test PNS on production mode - ios5

I am working on app which is having PNS. PNS is working good on development mode i have tested it on all devices. Now want to test with production mode i have created all certificate on production mode. but now i dont know what is the next procedure. How to create Adhoc build so that it will work on production mode also on stack overflow i read that we need to remove device token which we are using for dev mode so that token will will not same? Is it right way and also let me know how we can create adhoc build for PNS prodcution to work?

You have the right idea: you need to build an AdHoc build of your app. First, you have to go to the Apple Provisioning portal and build an AdHoc provisioning profile for your app. The steps are similar to what you did to build the developer one.
This is very similar to the distribution build of your app. Compile your app in release mode (or AdHoc mode if Xcode has set that up for you). At this point, you can check your build settings so that no certificate is associated with the AdHoc build you are doing. Later on, you will select the AdHoc provisioning profile.
When the build is done, Organizer will open and you will see your app in the list. Select the build from the list and then click on Distribute. Select the second option "Save for Enterprise or Ad Hoc Deployment". In the next screen, pick the AdHoc provisioning profile you generated previously. Hit Export.
At this point, a .IPA file will be generated that you can then install on your device by either uploading to a server and downloading by navigating to its URL OR, the easier option, is to drag/drop your IPA file to iTunes and sync your app from there.

this links are help to you visit
http://kb.applingua.com/2011/10/testing-an-app-on-your-own-device-ios/
http://iphonedevelopment.blogspot.in/2009/01/uuid-hint.html
http://hayageek.com/ios-silent-push-notifications/
push notification form client server ->it receives Apns and send to the ->appropriate mobile
note:client sever-> must be send notification with token

William Hu proposition to this question (was putted in wrong place):
#William Hu
The answer:
1) Build AdHoc build for the app. Just got to Apple Provisioning portal and build an AdHoc provisioning profile for the app.
2) Check the "Building Settings", "Code Signing", choose the profile you just generate (or AdHoc mode if Xcode has set that up for you)
3) Choose "Product" -> "Archive", then "Organizer" window will open automatic. Press "Distribute" button. Select the second option "Save for Enterprise or Ad Hoc Deployment".
Then save the ".IPA" file to your disk.
4) Drag this file (along with profile) into iTunes to test. Also check http://testflightapp.com make test very easy and simple to use.

Related

Iphone Distribution error

I am new in iPhone Distribution . I created Apple ID U765UXW88D.com.edwincs.*. and
provisioning profile name is MobileHealthGuide. I made these in Distribution tab.
My xcode version is 3.2.4 While uploading application with application loader , I got this error
Application failed codesign verification. The signature was invalid, or it was not signed with an Apple submission certificate.
My project name is MobileHealthGuide too. I have tried revoking the certificate and provisioning profile, but the error persists.
How can I solve this problem?
I've encountered the same problem too. It showed that I had a duplicate certificate registration in my keychains. Removing one of them (I removed the one from my system keychain) fixed the problem.
Steps that helped me to resolve my problem:
Open KeyChain Access application
Select the 'login' keychain, and select in the bottom pane
'Certificates'
Switch to the 'system' keychain and see if there are certificates
registered in both chains.
Remove one of them
Rebuild the application
You probably need to check what code signing profile is selected in
your distribution build properties.
Alright, then make sure to clean the build & delete the Build folder from the app.
If this doesn't work for you, there is one more alternative :
Verify below steps to create distribution certificate and perform that if you miss anyone.
Generate a certificate signing request in keychain.
Using that create or revoke a DISTRIBUTION certificate in the
portal. after that download and install it and verify key under the
name.
Register the device in the provisioning portal.
Then create or modify a DISTRIBUTION profile in the portal. after
that download and install it and verify it appears to be valid in
Organiser as there are no warnings.
Make sure to select proper build setting in xcode.
Now this will definitely, solve your problem.
Make sure you added right code sign in project target.
Ok so here are detailed steps on how to distribute:
You want to request a development and distribution certificate in Keychain Access and upload it to developer.apple.com (you are part of the developer member program right?)
Create an app ID (in provisioning profiles)
Create a distribution certificate - make sure this and step 2 follow your bundle ID
Download the profile and drag to Xcode
Go to your Xcode project, in the target or project build settings set your code signing option to the Distribution certificate (which must match your Bundle ID and of course your distribution and development certificate) - there might be a recommended or automatic profile, just choose the one that matches your identity and app provisioning profile and Bundle ID
Now go to edit scheme -> then change from debug to release
Then go to project than target than build settings and type in 'Code Signing', change the options to your distribution profile
Set to build for an iOS device (or none at all)
Go to product -> Build For -> Build For Archive
Scroll down on the side (your classes tab etc.) to the product which should be named (AppName.app) and show it in finder.
Create an application on iTunes Connect
Compress the .app and load it to Application Loader
Send it off!
Tips:
Make sure you are using the correct Bundle ID
Try cleaning
Make sure you're certificate is not expired
Here is an expanded list of reasons why this may occur:
Upgrade your xCode! you are using a really old one.
Probably you tried it but go to https://developer.apple.com/ then iOS provisional portal there are lots of tools can help you.
If you are not using inApp purchase, push notification, iCloud etc. you can skip the App ID and just set a general certificate one that would be like U765UXW88D.* so that you don't need to do this process every time for new apps.
Make sure you created distribution certificate and sign with that on xCode for release/distribution.
On xCode itself make sure you defined the bundle ID same as on iTunes connect.
Good luck.
I've got a similar problem as well. In one project, using my dist profile, it works perfectly and I can build to a device.
In another project, when using the same dist profile, the app launches, loads the splash screen, processes the first page and then exits without throwing an error in Xcode or in its own log.
When I change the code signing to a generic dev profile, the app launches without a problem on the desired device.
I've redownloaded the certs, the dist profiles, deleted the old ones.
How is this even remotely possible? And how can this be fixed?
Failed signature verification can happen for many different reasons. See Apple's list of common causes in TN2250.
The most common reason for failing distribution signature validation is because the app was signed with a developer profile instead of a distribution profile, or the app was built with the wrong build configuration. To consider this potential cause check your settings against the recommendations that follow:
The Release build configuration must be assigned to your Archive task. To ensure this, select the "Scheme" pop-up menu in the upper-left corner of the Xcode Toolbar, and choose "Edit Scheme". Select the "Archive" task and make sure the Build Configuration is "Release".
To check that your app is signed with the correct distribution profile, use the steps in section How do I check which certificate was used to sign my app? and ensure the Authority is "iPhone Distribution". If it is not, continue to next bulleted items to correct the responsible configuration.
Ensure that the appropriate distribution provisioning profile that you created for this application on the iOS Portal site is assigned to the Release build configuration. To ensure that use the steps in section Assigning Provisioning Profiles to Build Configurations.
Next, ensure that you are choosing the correct distribution provisioning profile when distributing your app on the Xcode Organizer > Archives tab. To do that, use the sections linked below depending on your distribution method and take special note you're selecting the correct profile on the "Identity" field (Xcode 4-4.2) or "Code Signing Identity" field (Xcode 4.3+) after clicking Submit/Share/Validate or Distribute on the Xcode Organizer > Archives tab.
https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933-CH1-TNTAG32

iphone app release mode issue

i am about to launch app in app store,
i am trying to run code in release mode , i downloaded the release mode profile
but when i compile code from iphone they say
"A valid provisioning profile for this executable was not found."
how to solve this pls help
############## EDIT
now i can run release mode on my iphone but i got this msg
The program being debugged is not being run.
so now can i upload this release file to appstore???
my setting
Code Sign Entitlements:Entitlements.plist
Code Sign Identity: my iphone dist release profile
any iphone dev: my iphone dist release profile
are these parameters sufficient to lauch app??
You need to make sure your connected device is provisioned through the iPhone Provisioning Portal. Check it's status by opening the Organiser in Xcode (Window -> Organizer) or press crtl + command + O.
Your iPhone will have to have a valid provisioning profile on an active iPhone developer account in order for you to run your app on your device.
However, running in Release mode and Device mode are different things, if you're trying to run in Device mode without a certified Device, that would cause this error. It wouldn't matter whether it was in Debug or Release mode though.
You shouldn't be trying to run in release mode. You can't actually do that, it would use the Distribution provisioning profile which can't be installed on devices. (it's used for signing the code for App Store submission)
Create/install the Development profile (make sure you have the correct bundle and device list set) and set "code signing" for Debug to use that profile.
You can compile the code in release but you have to use a Certificate file that you have provisioned for the device. If you use the Distribution Certificate then you can only install the file through the normal distribution channels, (e.g. AppStore)
If you want to run your code in release on your device however you will sign it with the same Certificate you signed it with before. Only sign with the Distribution Cert if you are Uploading it to Apple.
EDIT:
Running in Release should be a fairly easy process.
Setup the project just like you would for debug.
Use the same signing certificate, and your developer profile.
Edit the selected scheme.
And Select Release rather than debug.
You may also want to change the Debugger to None
The rest of the settings should work the same as when you debug.
Therefore if you are using the Entitlements.plist when you run in debug, then you will use them when you run in release.
once again. (DO NOT USE DISTRIBUTION PROFILE)

How to test an iPhone app on a device for the first time?

I am developing an app for iPhone. How can I test this app on my device?
What are the procedures to follow? Please give information regarding this problem.
Deploying iPhone Apps to Real Devices
http://mobiforge.com/developing/story/deploying-iphone-apps-real-devices
In brief:
Sign up for the iPhone Developer Program
Obtain an iPhone Development Certificate
Generate a Certificate Signing Request
Generate, download and install your provisioning profile
Download and install your Development Certificate
Deploy your iPhone application.
Things you will need are
your private key.
your provisioning profile (with the UUID of your device added).
go to project settings and change code signing entity to your
distribution profile.
then you can build and run after connecting your device.
1) Open Xcode,
2) Go to Active SDK, and select the OS version running on your test device (viewable by going to Settings->General->About on the device).
3) With your project open, click on "Build and Run" (or press Command-R) to run the project, which will prompt you to allow access to your keychain.
4) Once deployed, the app will run automatically.
Distribution
First of all, to run the app on your phisical device you must enroll to the apple developer program.
Second, generate a developer certificate and download it. Then, import the certificate into Xcode and here you go.
There are some steps you need to follow to test your app on your personal iPhone. Below you can find all the steps:
Creat MAC certificate at first step.
Second step is to upload that certificate to developer account.
Now you should open developer account at
http://www.developer.apple.com
You can now find an option for device id in your developer account on
left side.
Now you should register your iphone device.
It is time to create your unique identifier on developer account
Download your certificate and install it on xcode organize
Now open your project embed your unique identifier in your project.
These steps can be beneficial for all software testing gusy involved in mobile application testing.

Building iPhone App for Distribution

I have a question on how exactly to do the final distribution build for my app. I have actually successfully built this app already but now I am trying to make an updated version and to remember what I did right the first time. It all seemed to go wrong when my provisioning profile expired....
Anyway, I have my distribution certificate and distribution provisioning profile. I have followed the instructions from Apple, an iPhone programming book and several online sources to create a build that checks against the right certificate etc. But the build always fails unless I connect a device, which is strange as the distribution provisioning profiles do not allow the inclusion of a device (which makes perfect sense in itself). However when I build with a device connected I am asked
'Can’t run XXX on the iPod “iPod
touch”
The iPod “iPod touch” doesn’t have the
provisioning profile with which the
application was signed.
Click “Install and Run” to install the
provisioning profile XXX on “iPod
touch” and continue running XXX.'
When I click install and run it fails with the message that
A valid provisioning profile for this
executable was not found.
So my basic question is how exactly should the final distribution build be done? An new executable appears, but it has a forbidden symbol on top of the application icon suggesting the build was unsuccessful.
Any help massively appreciated.
Don't click "Build and Go".
Either just build, and then locate the app and upload it, or use Xcode's "Build and Archive" option.
It is best to use "Build and Archive" as Xcode will look after the app bundle, and the important .dSYM file which is used to symbolicate crash reports for your app.
And you cannot upload and execute app that signed with 'Distribution' certificate on your device. Such app can only be uploaded to AppStore.

AdHoc provisioning - what's the easiest way to add a few more devices to an existing project that's still in development?

I have a project that I've been working on for a while. It is a standard Xcode/Objective-C iPhone app. I created the provisioning file for my device and a couple others. Now I would like to add a few people as testers.
Do I need to download and install a new provisioning file?
Do I need to change settings in Xcode?
What's the easiest way to do all this?
Thanks!
You will need to create, download, and distribute a new .mobileprovision file, and reconfigure your project to use it:
In the iPhone Developer Program portal, add the new devices.
Edit your existing ad hoc distribution provisioning profile and check the boxes to add the new devices to the profile.
Refresh the Distribution tab for a few seconds until the profile status changes from Pending to Active.
Download the modified .mobileprovision file, and install it by dragging it onto the XCode or iTunes icon in your dock.
In XCode, right click on your target, do Get Info -> Build, and change your Configuration to Distribution.
Change the setting under Code Signing Identity -> Any iPhone OS Device to use your new provisioning profile. Pay close attention to the dates in the list and make sure you use the most recent copy.
Distribute the new .mobileprovision file to your users with your next ad hoc build.
You don't have to recompile your project again. In fact you don't even have to open XCode.
All you have to do is create a new mobileprovision file and distribute it with the existing app.
Your end users have to download and install the new mobileprovision file and app, by this order.
Here is a step-by-step.
Unless the other people are iphone developers with their own development profile, you will need to make an ad-hoc profile and build.
It is pretty easy... just follow the instructions in the developer portal. All you have to do is clone your release configuration, change a few lines and add a plist entitlements file (all provided in the instructions). Then just send the tester the build and the provisioning profile you create with their device-id included and they should be able to drag it into itunes to install.
If they are developers and people you trust, just give them the code and have them change the Bundle Identifier to whatever is in their development domain.