iphone app release mode issue - iphone

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)

Related

How to build Adhoc build to test PNS on production mode

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.

Can't launch my app in Instruments: At least one target failed to launch

I have all my code signing entitlements set correctly. Running the app on my phone is fine, but launching it in instruments gives me an error message:
Error Starting Recording
At least one target failed to launch; aborting run
And then:
Target failed to run. Permisson to debug [app name] was denied. The app must be signed with a development identity (i.e. iOS Developer)
Any ideas how I could stop this from happening? Doesn't happen on my iPad.
Edit the scheme for your target and under "Profile [App Name]" set the Build Configuration to Debug (it's usually Release by default).
It is saying that you need to sign the app with a developer certificate (not a distribution certificate).
In Xcode 5 just change the "Provisioning Profile" field for your "Release" build in the Build Settings to your developer certificate instead of your distribution certificate. For the duration of the testing anyway. Xcode doesn't allow you to build with a distribution certificate.
Make sure that the project build settings do not override the target build settings or make the change in your project build settings.
Don't forget to set the profile back after you're done with the testing.
I do not recommend harrywynn's method, since it is better to profile the release build because then you are taking into account the compiler optimizations, and having the exact experience your users will.
To add to the previous answers.
Instruments is complaining about the signing identity.
I believe it is preferable to profile in release mode, for the same reasons given by Zolten. (take into account the compiler optimizations, and have the exact experience your users will, etc...)
To change your code signing identity for Xcode 6:
Click on your Project, Select the Target you are Profiling.
Build Settings -> Code Signing -> Code Signing Identity -> Release
Select your iOS developer profile.
Provisioning Profile: Let Xcode pick the correct Provisioning Profile for you, e.g: switch to Automatic
When you are done with the Profile, switch back to your normal settings.
Here's a picture for those who are very visual ;)
I was getting the same issue :
[INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug was denied. The app must be signed with a development identity (e.g. iOS Developer).
Solution:
1. I archived the the app with Debug Developer Profile in xcode for device.
2. The go to Window -> Organiser -> to see all the list of archieves
3. Now select the archive to wanted to export and open it in finder
4. Right click and show package contents
5. Go to the Products/Applications folder
You will see the .app file.
Use this instead of the ipa.
Make sure that the device has been already added to the developer portal and all the certs are installed on it for the above steps to work.
Once this is in place. Also, make sure you get the ios-webkit-debug-proxy from the link below:
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md
Also, enable developer tools on on the device setting.
Also, make sure safari webinspector (safari -> Develop) -> Inspector is on
Hope it helps:-)
NOTE: When you want appium to install the app on the device for you, don't provide Bundle ID.
I achieved to solve this issue on my machine by doing this :
Generate a new Developer Provisioning Profile with your device in the list or at least make sure that your machine is in the list of the profile's device.
In Project settings -> Code Signing -> Provisioning Profile -> Debug : Set the newly created profile.
In Targets settings -> Code Signing -> Provisioning Profile -> Debug AND Release : Set the newly created profile.
Hope that helps.
I realised what "At least one target failed to launch" means. It appears that both the development and release schemes (if you have a debug scheme and a release scheme) must have a development identity.
I had the debug scheme selected when running the profiler and the message at the top of XCode said "Running debug". However, it seems that this is not sufficient.
I changed my release scheme code-signing identity to be the same as the debug scheme (and also the provisioning profile), and the problem went away.
it worke.. when i changed my profile schema to debug mode and also made sure, build configs has developer certificate in it. Thanks
None of the other solutions here fixed my problem, but I did determine that it was only a problem for me on the simulator. The device works fine. Perhaps there's an issue with the simulator.
I encountered this problem with Xcode 9.1 for both simulators and devices, and my running scheme was already set as profiling with "Debug". Finally found this Apple forum discussion very helpful and got the problem resolved. In short, the solution that worked for me is ... Restart the Mac.

How to test the release build on device with Xcode 4.2?

I've just finished writing an update for my app, and now I want to submit it to the app store.
I've thoroughly tested it in debug mode on multiple devices, but I want to test it with the release build just to make sure nothing screws up.
In Xcode 4.0.2, when I wanted to test the release build (i.e. not distribute), I would just do the following
In the project settings, make sure that the release code signing is set to "iPhone Developer" not "iPhone Distribution"
Go to Edit scheme..., and change the Run scheme to Release instead of Debug.
Make sure my distribution provisioning profile is installed in Xcode
Run it on the device, make sure everything works.
If it all works, I would then distribute with the following:
Change the code signing to "iPhone Distribution"
Make sure the Archive scheme is set to Release
Archive
Submit
Now the problem is, with Xcode 4.2, I can't test the release build on my device. - When I build it with release to my iPod, I get an alert:
A valid provisioning profile for this executable was not found.
So, I checked my provisioning profiles under the main "Library" section of the Devices pane (all provisioning profiles), and I found my distribution profile there.
The problem is, the provisioning profile says "This profile cannot be installed on deivces".
So, if I can't use the distribution profile with a device - how am I supposed to test the release build?
I would appreciate any advice with this issue - sorry if there's something obvious I'm missing!
Ref: https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933
How do I confirm my Provisioning Profile is for App Store distribution?
You can confirm whether your provisioning profile is an App Store Distribution profile within the Xcode Organizer > Devices tab > Provisioning Profiles section under "Library"; single-click to select the particular provisioning profile and in the Header Pane, the "Devices" text will read "This profile cannot be installed on devices" if it is an App Store Provisioning Profile.
That means you would need to create another distribution profile for testing.

iPhone Development - Running apps on device

I am trying to run the app on my device and there seems to be a problem with the code signing entity. If I choose the developer profile in the code signing entity, it runs fine but if I choose the distribution profile (I've tried both the Adhoc and Appstore distribution) it says "Build Succeeded" but it gives a popup error message saying -
Error Starting Executable “App Name : Device Name”
Error launching remote program: failed to get the task for process 3273
Am I supposed to see this or am I doing something wrong again ?
Thanks
You can not test and run the application with distribution profile at your end. The distribution profile is just for signing the project ipa and upload it to the app store. For running onto your device, only developer profile will work.
If you want to test application on device, then you need to create debug profile for it. You need to get it for your device from the provisioning section of developer portal. If you are creating the distribution profile, then you need to put the generated ipa file from build folder to itunes to install it on device.
Then you can install the application on device. But in that case you will not be able to see the logs.
So if you want to see the logs in Xcode console, Create a developer provisioning profile for the device & install it on XCode & then run the code on device using Xcode.
I think this is the entitlements.plist problem please follow the steps
In XCode, go to "new file" and select "code signing" in left box. Select the "Entitlements" file type. And change the name to "Entitlements.plist". Give the name in project getinfo entitlements plist please check the image below

A valid provisioning profile for this executable was not found: only with distribution

I'm releasing a new version of my iphone app and everything was going great until I changed the settings to "distribution" and "device", and then got the error:
A valid provisioning profile for this executable was not found.
This doesn't make sense as I am able to install the app onto my phone in debug or release mode, but not in distribution mode. Is this error because the provisioning profile and distribution profile are not compatible? Or what could be a solution?
Back history... I DID just get a new iPhone 4 a month ago and this is the first distribution I have done with this device. Xcode is also telling me:
The iPhone “X” doesn’t have the provisioning profile with which the application was signed.
Click “Install and Run” to install the provisioning profile “Y Distribution Profile” on “X iPhone” and continue running “Z.app”.
Can anyone help? I'm going nuts and tired of running into a wall. Thanks in advance!!!!
What I needed to do was "build" instead of "build and run"
I use the distribution provisioning profile and found that the apps are not put on device with the distribution profile.
Distribution profiles aren't used to put on devices i believe? I've only ever used the distribution to build to upload to the app store.
When you get a new device you also need to remember to add it to the profile and then redownload it.
1-Xcode->Click your app -> TARGETS -> click the app-> Build Setting-> Code Signing : Make sure that both "Debug" and "Any iOS SDK" are set to "iPhone Development"
2- Xcode -> Product -> Scheme -> Edit Scheme: Make sure "Build Configuration" is set to “Debug".
You cannot run your app on a device using the distribution profile, which is really used for uploading the app to App Store [for distribution]. However, if you want to "simulate" how the app would behave in a production environment, what you need is a so-called "Ad-Hoc Provisioning Profile", which is really a lot like a distribution profile, but will allow the app to run only on designated devices without the need for XCode.
Check this link out for more detailed info.
Exporting Your App for Testing (iOS, tvOS, watchOS)
That's the expected behavior. When building for Distribution, make sure you select "Build", not "Build & Go".