iOS : Issue in submitting app to appStore / adhoc deployment - ios

i am trying to submit app to appStore and also alternatively trying to create ipa for adhoc deployment. i have already tried many solutions but nothing changed. I have already generated new certificates and provisioning profiles but it always shows me this error message:
You already has a valid iOS Distribution certificate
You have a valid iOS Distribution certificate in the Member Center, but it is not installed locally. if uour sigining identity is installed on another Mac, You can export on that Mac and import it on this Mac.
Please help me out to get rid of this issue

you are missing your Distribution Certificates Private key on this computer. If you have another machine that can codesign distribution builds, then transfer the certificates and profiles from that machine using the workflow discussed in the "Transferring iOS Certificates and Profiles to another Machine (Exporting and Importing Certificates and Profiles)" section above, otherwise follow the instructions below (as appropriate for the type of app you are creating).
if you revoke your iOS Distribution certificate, then Xcode will recreate your private key and request a new Distribution Certificate for you. See the steps in the Revoking Certificates section of the App Distribution.
use this link

If you need to make an .ipa without valid Developer's account, please follow the next steps:
1) xcodebuild clean -workspace /Users/JohnDoe/Projects/TheApp/TheApp.xcworkspace -configuration Release -scheme TheApp
2) xcodebuild archive -workspace /Users/JohnDoe/Projects/TheApp/TheApp.xcworkspace -scheme TheApp -archivePath ~/TheApp.xcarchive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
3) cd ~
4) xcodebuild -exportArchive -exportFormat ipa -archivePath TheApp.xcarchive -exportPath ~/TheApp.ipa
After the final step the .ipa is waiting for you in your home directory!

Related

xcodebuild using wrong provisioning profile

I have a bash script where I am trying to automate pushing an IPA to TestFlight. Currently this script is successfully uploading to the app-store with an ad-hoc provisioning profile and not my distribution profile as such I am unable to push the build to TestFlight as it does not have the beta-reports-active key. This is easily fixable from within XCode but I have had no luck using command line which is integral to what I want to do. This is my current command trying to use manual signing:
xcodebuild archive -workspace $NAME.xcworkspace -allowProvisioningUpdates -scheme $NAME -configuration Release -archivePath ../builds/$NAME.xcarchive DEVELOPMENT_TEAM=$TEAM_ID CODE_SIGN_STYLE=Manual CODE_SIGN_IDENTITY="iOS Distribution: MY_NAME" PROVISIONING_STYLE=Manual PROVISIONING_PROFILE_SPECIFIER="PROVISIONING PROFILE "
Is there a way of getting the correct provisioning profile through command line
EDIT
Examples of what I have tried:
Downloading and inserting the provisoning profile int0 ~/Library/MobileDevice/Provisioning\ profiles and then using PROVSIONING_PROFILE_SPECIFIER to point to the profile
Inserting the app-store method into the export options plist file
Creating new ExportOptions file that specifies manual signing as well as the provision profile being used - so far getting a signing error due to no provisioning profile being found
Hope this ^ is clear
I had a similar problem, I was using fastlane to push to testflight and it automatically kept pulling the wrong provisioning profile..
When I dug deeper by running
xcodebuild -showBuildSettings -workspace Freshdesk.xcworkspace -scheme <My Build scheme>
I realised that no matter what scheme I picked I kept getting the same provisioning profile in the command line.
I then dug into xcode and chanced on this parameter
This was set to staging and I could never sign my app for the app store build, I changed it to production and it fixed my problems
You can find this under "configurations" in the info tab of your project and not the target
I hope this helps!

Sign application using .p12 and .mobileprovision from 3rd party

I need to sign app for Enterprise deployment. Customer's security department refused to add my apple ID to their team, thought they send me mobileprovision and p12 files. As far as I remember, in XCode 5 there was possibility to sign IPA without Apple ID using mobileprovision only, like that:
Xcode5 - Enterprise deploy screenshot
When I try to do it in XCode 7 or 8, I got error like XCode 8 - Enterprise export error because my Apple ID is not registered in customer's enterprise team.
I've already added .p12 to keychain, unchecked "Automatically manage signing", selected customer's provisioning profile.
I try to use xcodebuild like xcodebuild -exportArchive -exportFormat ipa -archivePath <FILE_NAME>.xcarchive -exportPath ~/Desktop/<FILE_NAME>.ipa -exportProvisioningProfile <PROVISIONING PROFILE NAME>, but still no success.
Also, I need to generate manifest file, that's why xcodebuild is rough solution even if it will work.
I know that its unusual when customer give cert and keypair, but dont want to add developer to team, but cannot change it.
How can I export build for Enterprise if I have provision and certificate, but my account is not in team?

Failed to locate or generate matching singing assets:When i'm triyng to generate ad hoc ipa

Anyone can help me.Actually i'm 6 month kid for ios app development,this is my first app to submit in appstore.When i'm trying to generate the ad_hoc distribution IPA,it shows error(as like the below screenshot).But for appstore IPA generated successfully,i'm so confused.....what a magic this!
I have tried the follwing things To solve this problem:
1.Deleted all my mac keychain certificates.
2.Delete all xcode caches and and provisioning profiles and also deleted the developer account from xcode.
and restarted my mac...
then,
1.Reinstalled the certifcates in keychain from exported .P12 from another mac
2.login in xcode preferences accounts tab.... and refresh it. it downlods all provisioning profiles from my developer account.
Status: Not working,still the same issue....all of another projects of my mac and appstore ipa too.
Even i have generated new developer certificate and updated all my project provisioning profiles.still have the same issue...,then try with it new bundle id and new provisioning profiles..i can't got it!
Bcoz of this problem i can't generete ipa for allof another app from my mac..for this issue i wasted entirely 2 working days.totally disturbed.....
Once i solve this then only i can sleep well.pls help me ,thanks in advance to you....
I was having same trouble few weeks back. Though I haven't yet figured out the exact issue behind it but I found that exporting an .ipa file via commandline works.
Archive your project using your desired build settings.
Locate the .xarchive file in finder (DON'T follow the usual procedure from this point).
Copy it and paste it to your project directory (Where your .xcodeproj file is). (Though I usually rename it to remove all the spaces from the name as well)
cd to your project directory in terminal
Run following Command:
xcodebuild -exportArchive -archivePath YourArchiveName.xcarchive -exportPath YourIpaName.ipa -exportFormat ipa -exportProvisioningProfile YOUR_PROVISION_PROFILE_NAME
Your .ipa file will be generated in your project directory. Use it as you will.
For example if My archive name was mySillyApp and I wanted to create an ad hoc ipa from it named mySillyApp with provisioning profile named MySillyProfile, I'd run it like this
xcodebuild -exportArchive -archivePath mySillyApp.xcarchive -exportPath mySillyApp.ipa -exportFormat ipa -exportProvisioningProfile MySillyProfile
NOTE: Even though this doesn't fix the issue of xcode but it gets the ipa. Just thought it would help someone looking for a quick way to get the ad hoc build, who doesn't have the time to figure out what's wrong with Xcode.
If you are doing this for distribution environment, and previously if you
have already created the distribution certificate from different mac then
Either export that same certificate from that mac and import it here or
Revoke the same certificate from your mac, that will be then added to your key chain (https://help.como.com/hc/en-us/articles/201708891-Revoke-Your-iOS-Distribution-Certificate-P12-File-)
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html
After doing this just restart your XCode and give try
Hope this will help you!

xctool build with today extension

we have an app integrated with today extension, we use xctool and Jenkins to do continuous build and in-house distribution.
In command line, before we use
xctool -workspace our_workspace.xcworkspace -scheme app_schme -xcconfig path_to_xcconfig -configuration Release build archive -archivePath path_to_archive
to generate archive and then export to .ipa, it works fine.
But right now with today extension, we have to build it with another scheme and xcconfig, we put certificate and provisioning profile in xcconfig, as today extension is a new target and should built with its own certificate and provisioning profile, I'm wondering how to achieve using xctool.
Any help is appreciated.
I finally managed to export ipa files via xcodebuild. Since the xctool is built upon xcodebuild, this answer might help.
First of all, when you create an extension, the extension's target will be embedded into your main app's scheme.
So, there is no need to use two schemes.
Then, in your project settings page, create a new configuration, say AdHoc. And then you can set a new Provisioning Profile in both of your target's build settings.
(project settings)
(the build settings of one target)
Then set the right provisioning profiles for your targets (And you'd better set the code sign identity to automatic, so that Xcode can determine which code sign identity is to be used).
Next step, you can archive your app using xcodebuild with the new configuration you just created above:
xcodebuild -project Extension\ Demo.xcodeproj -scheme Extension\ Demo -sdk iphoneos -archivePath ./Build/extension-demo.xcarchive -configuration AdHoc archive
In this step, the codesign will sign two of your targets separately by the provisioning profiles you specified.
Finally, export the .xcarchive file to ipa, again using xcodebuild;
xcodebuild -exportArchive -archivePath ./Build/extension-demo.xcarchive -exportPath ./Build/extension-demo.ipa -exportWithOriginalSigningIdentity
Notice that -exportWithOriginalSigningIdentity is set, so that xcodebuild will not re-sign your ipa, and the code signature in the xcarchive file is preserved.

Cannot export unsigned IPA from Xcode 5

Under Xcode 4 I was able to export an unsigned IPA in order to send that to clients with Enterprise accounts for resigning. With the upgrade to Xcode 5 this option has been removed. I found a similar question that found a work around for Cocoa apps, but this won't work for iOS apps as it yields a .app file.
Does anyone know how an unsigned IPA can be generated from Xcode 5, or know of another way to give something to my client for resigning that doesn't involve trading certificates or the project itself?
We had the exact same problem. We used this process for a year to deliver an unsigned IPA to our client, who would then sign it when their Enterprise Profile to release it to all their employee's. The work around turned out to be pretty straight forward. We just signed the IPA with one of our Distribution Profiles, and the customer, in turn, was able to take that signed IPA and resign it with their Enterprise Distribution Profile. It turns out, having the "Don't Resign" option in the drop down was not needed.
You can run this in your *.xcodeproj directory:
xcodebuild -project YOUR_PROJECT.xcodeproj -exportArchive -exportFormat ipa -archivePath $(pwd)/YOUR_PROJECT.xcarchive -exportPath $(pwd)/YOUR_PROJECT.ipa CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -alltargets -configuration Release
You can create .xcarchive by running:
xcodebuild -scheme YOUR_PROJECT_SCHEME archive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -archivePath $(pwd)/YOUR_PROJECT.xcarchive
You can create scheme by using xcodeproj and this ruby(.rb) script:
require 'xcodeproj'
xcproj = Xcodeproj::Project.open("YOUR_PROJECT.xcodeproj")
xcproj.recreate_user_schemes
xcproj.save
You can install xcodeproj by running:
sudo gem install xcodeproj :)

Resources