How to configure fastlane to use an existing enterprise certificate for signing iOS (ionic) app - fastlane

I couldn't find a solution and I spent several days trying to configure fastlane to use an existing enterprise distribution certificate to sign an iOS app. The app is written in Ionic Framework.
Please share how you DID it, either native iOS app, Ionic etc...
Thanks

I would use Fastlane gym for this purpose to build and sign your app.
1.) Make sure you've added the enterprise certificate (.cer) and it's private key (.p12) into the Keychain Access app on your Mac, and the certificate is not expired.
The certificate should be in the login keychain, you can filter for the My Certificates to show it.
2.) First, make sure that you can do an archive and you're able to sign it with Xcode:
Set Generic iOS Device then go Product > Archive. After the archive is created, select Distribute App > Enterprise > Automatically manage signing > ...
If this fails, it will fail with Fastlane, too. It's important to check that you can distribute the app in Xcode, first. It might happen that you have some kind of problem with the Provisioning Profiles and your problem is not related to Fastlane at all.
3.) Finally, in the Fastfile, implement something like this:
lane :archive_enterprise do
gym scheme: 'Scheme name',
configuration: 'Release',
export_method: 'enterprise',
clean: true
end
4.) Execute with fastlane archive_enterprise in Terminal.

Related

iPhone - App validation succesful, but loading developer build failed after this

I created distribution profile and built app with the distribution profile. I have validated the build and the validation is successful.
After this step, i tried to cross verify the app once again and built an app with developer provisioning profile. Archive file is created successfully. But app is failing to install in mobile.
What is the reason behind it.
Make sure you dont have duplicate keys in your keychain. Delete the old ones and create a new key and prov file then everything will work fine. Normally just dupe entries can cause this.
there are 2 reason for this error
1) you are not add device UDID in your developer provisioning profile.
2) In your device an app is already install with same developer provisioning profile so the your app is not install in your device.

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

How to configure a Xcode project for beta testing with TestFlightApp?

I signed up for TestFlight.
Then I followed all steps in this tutorial:
But Xcode throws this warning:
Application failed codesign verification. The signature was invalid,
contains disallowed entitlements, or it was not signed with an iPhone
Distribution Certificate. (-19011)
It smells like there is a lot more work to do than what they wrote in the tutorial.
Is there a complete tutorial which walks through every step without stepping over anything?
And do I need to add the SDK even for simple beta tests?
(Edit: No, SDK is not needed!)
Start with logging into the Provisioning Portal, and adding a test device or two, under Devices. Then go to Provisioning and create a new one for the appID you are working on and add those devices.
Back to Xcode and use the Organizer:Devices:Provisioning Profiles to download (refresh) the Provisioning Profile. Set your project's Debug scheme's signing to use that developer profile. You should then be able to build and then archive. Once archived, do an ad hoc distribution and save off that file to the desktop.
Go to your account on TestFlightApp.com and press the Upload Build button. Drop the file you saved on your desktop, into the Build upload area. TestFlightApp will give you errors if the app wasn't bundled for adhoc or signed properly.
Now, here is where TestFlightApp.com will save you work. Send out invites to friends from within TestFlightApp.com. TestFlightApp.com will manage notifying them and as they create an account, it will also help them find their UDIDs. These UDID's can be batched up and later downloaded by you and re-uploaded to the Apple Provisioning Center, into your devices section.
You then use Xcode to refresh your profiles, and rebuild the app, archive, and upload to testflightapp. Then you can select which one of your testers will get to see this build and what message they should be sent. Your testers will not have to figure out how to download the files and install them using iTunes or other app, they merely press the install button.
Believe me, while it is still a bit of work, it is so much better than not using TestFlightApp.com, especially if your users are not very savvy about app installation. In the future, you can use the TestFLight SDK to gather crash reports and usage information for your debug builds.
See the following for some more info: TestFlight beta-testing iOS app

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.

MonoTouch deploy to iPhone

I have developed a number of apps using MonoTouch, and been using the emulator for the iPhone, now I need to deploy me application to my iPhone for further testing.
I have purchased the iPhone SDK from Apple, but I can't find how to deploy and activate the MonoTouch application to my iPhone.
Any pointers please?
As has been already stated you obviously need the paid version of MonoTouch and the iPhone SDK. Once you have those sorted you need to create a developer certificate in the iPhone developer portal, download it to your dev machine and add it into your keychain.
Once you have done that you must create a provisioning profile for your physical device, which again you do through the developer portal. Once you have the provisioning profile, download that to your machine, and add it to the iPhone via the Organiser app in XCode.
Then fire up MonoDevelop, and if it's all gone to plan then you should have the option of deploying the build to your iPhone. You can check that MonoDevelop has correctly detected your certs by opening up the Project Options window and under the Build section and under iPhone Bundle Signing, you should see your developer cert and provisioning profile.
Full details of the steps required on the Apple iPhone Dev Site
Here are the MonoTouch docs on building for distribution
http://monotouch.net/Documentation/Building_for_Distribution
It is my understanding that you have to have the Monotouch deployment license from Novell to deploy to a device.
According to your statement:
When I compile I get: "No Valid iPhone code signing keys found in
keychain.
This is actually a Xcode question more then a Monotouch one;
The message indicates that your keychain does not provide the signing keys used to generate the certificates and provisioning profiles.
If you follow apple's steps on generating certificate(request), followed by profiles they will also state you might want to export your private key (p13 file) and keep it somewhere safe.
If you move to another laptop for instance, you will need to import that key again to make the machine a valid one.
If something went wrong (ie: you accidentally removed your private key, ..) this message will be shown since there is no way for Xcode to verify that the profiles are being used on a valid machine.
Go to this instruction page (apple account credentials needed) to check if the steps have been followed and check in the Keychain access app on your mac if under My Certificates you see a developer certificate and - if you unfold it - you can see the private key as a child node.