iOS: Bundle format unrecognized, invalid, or unsuitable - ios

When I try to run an iOS app on real devices it give me the following error, but it works on simulator, also I uploaded test build on TestFlight successfully, I tried to use another bundle identifier but no luck.
The project is built using Swift and using CocoaPods to include Alamofire and other libraries.

Without having all the details it sounds like you need to update your Provisioning Profile for Distribution or Development.
You will first need to go to the Apple Developer portal and login in to your account. Then select "Certificates, Identifiers and Profiles", followed by "Devices". Add your iPhone's name and UDID to the list if it is not there already.
After your device is registered to your account you will need to update the Distribution Profile (to allow devices to open your app through the beta distribution channel of Test Flight) as well as your Development provision profile to allow team members to build and run the app through xcode on their device instead of the simulator.
First select Distribution and click on the preexisting Distribution Profile for your application. Select the edit option and make sure the check mark next to your device is selected. Then generate a new Distribution profile. This will cause a download to automatically occur in your browser window. Once its complete you should click the download and this will automatically add it to xcode.
Now create a new provisioning profile for your application. Add the appropriate App Bundle Id and select your device from the list. Generate the new profile and a download will again be triggered in the browser window. Once the download is complete again click the download which will automatically add the profile to xcode.
Your application should now be able to run on your device when building and running through xcode as well as when it is downloaded from your beta distribution channel.

Related

Firebase App Distribution - "Waiting for developer" message

I'm developing an iOS application and using App Distribution to distribute my test releases to QA Team, I didn't had any problem before, everything was smooth and pretty (estrange considering iOS development hehe)... but recently I face a problem that I can't resolve and I didn't found any documentation about it.
I constantly adds new Testing devices to the project (as the QA team grows) and follow the same steps...
Adds the new account to my tester list in Firebase.
Get the register attempt with the UDID of the new device.
Register the new device UDID in the Apple Developer Console
Distribute a new release of the app through App Distribution.
Install the certificate in the device
And voila, download the new distribution.
But this case is different... because in this iPhone XS Max with the latest iOS version, the download button never appears, and we just can see the following message: "Waiting for developer".
I try a lot of different solutions, redownload and import the Profile, to redistribute the app, create new profiles, force new devices in Fastlane, delete and readd the UDID in developer console... dammit... I create new certificates in my rage hahaha... but the problem persist, anyone face this problem before?
Update
I sent a ticket to Firebase support center, and they told me that the UDID wasn't in the distribution profile, so my solution was recreate the profile, because download and import the ad-hoc profile didn't work.
This issue isn't a Firebase problem, it was a classic issue related to iOS signing hell.
I had the same problem when tried to add device for Firebase Testing.
I made all instructions from Firebase troubleshooting.
If you're installing an Ad Hoc distribution, the Waiting for developer
button appears when the developer hasn't yet configured their app to
run on your test device. To make their app available to you, the
developer must complete the following steps:
Add the test device's UDID in the Apple Developer portal (the UDID is emailed to the developer when you register the device to
Firebase).
Include the device in the app's provisioning profile.
Build the app using the updated provisioning profile.
Distribute the new build using the Firebase console, the CLI, or fastlane.
https://firebase.google.com/docs/app-distribution/troubleshooting?platform=ios#waiting-dev-ios
Than I noticed that all of my provision files (for me it was folder /Users/user/Library/MobileDevice/Provisioning Profiles) not include UDID of new device. Every file can be previewed if you will choose view mode or right click on it, select "Get Info" and expand "Preview" block. If you will scroll to bottom you will see block "PROVISIONED DEVICES" with codes of your devices.
For me the problem solved when I found files which descriptions had "IOS Team Provisioning Profile: my.bundle.name" and "Developer Profile Name: my.bundle.name" ("Developer Profile Name" is profile name which you see in your Profiles list at https://developer.apple.com/account/resources/profiles/list).
I moved 2 files (which descriptions started from "IOS Team Provisioning Profile: my.bundle.name" and "Developer Profile Name: my.bundle.name") from /Users/user/Library/MobileDevice/Provisioning Profiles to another folder (I was afraid to lose it and not removed, just moved)
Opened XCode
Selected menu XCode -> Preferences
Selected Accounts
Chose my e-mail account name
Selected MyTeamName and clicked button "Download Manual Profiles"
Selected my Personal Profile and clicked button "Download Manual Profiles"
After it in the folder "Provisioning Profiles" appeared two new provision files and I found the name of my device in the bottom of their descriptions.
Than i cleaned project rebuild app-file and distributed it on test and all worked.

How to run iOS application in real device through terminal without a paid apple developer account?

First this not duplicate of Test iOS app on device without apple developer program or jailbreak
I know it is possible to run app on device using Xcode 7 and free AppleId but i want to achieve this using terminal only Or in other words, Is there any way to generate provisioning profile & certificate using unpaid Apple Id through terminal.
If i will follow mentioned steps then my app installed and run successfully in device but i want to generate IPA using this free certificate and provisioning profile using terminal only.
In Xcode, add your Apple ID to Accounts preferences, described in
Adding Your Apple ID Account in Xcode.
In the project navigator,
select the project and your target to display the project editor.
Click General and choose your name from the Team pop-up menu.
Connect the device to your Mac and choose your device from the
Scheme toolbar menu. Below the Team pop-up menu, click Fix Issue.
Xcode creates a free provisioning profile for you and the warning
text under the Team pop-up menu disappears.
Click the Run button. Xcode installs the app on the device before launching the app.
I am working on some automation task and want to generate and install this signed iPA using unpaid Apple Id through Terminal.
I do not believe this is possible. The challenge is not just extracting the provisioning profile that is created in Xcode. That will not work because Xcode also manages the devices in the profile. So if your devices change, you need Xcode to register the new device and add it to the profile on Apple's servers, before re-downloading it. It also manages the bundle ID.
In theory, if you were to set up the app and all devices in Xcode before grabbing the provisioning profile from ~/Library/MobileDevice/Provisioning Profiles, maybe it would work.
If you can successfully get the profile. maybe you can use these instructions to build and install on the device as long as it was set up ahead of time: install application in iphone device through command line

Run xcode project with distribution profile on it

I have created an iOS application, and wanted to submit it to the App Store.
I saw a tutorial on how to do that, and understood that I need to create a Distribution profile and replace it with the Development profile. So I did that but before sending it to the App Store. I want to check it last with that profile on it (the distribution profile).
Can I run Xcode project when I add a distribution profile?
because when I tried running it on a real device, an error popped up: "the provisioning profile "XXXXX" was not found".
So i went to the Devices tab and tried adding the file of the provisioning profile, and it didn't allow me to.
What should I do?
You can't use distribution profile to run the app on your device directly from your device.
Now Apple provides beta testing of apps using iTunes Connect. So you can opt for that option as an alternative.
Refer Beta Testing Your iOS App for more details
Yes, you can do by applying small tweak.
Open you Xcode project
click on your target.
choose edit scheme from list.
choose Run tab from left.
select info tab from top.
select Build Configuration and choose release from drop-down list.
Now delete your existing app, from device if exist.
And run the app from Xcode.
After completion of compiling for app, it would show some error dialog and will stop execution, ignore it.
Now app is installed on your device with distribution profile.
Re-run the app.
Cheers!

How to install an unsigned IPA file on my device using an Apple Developer account?

I need to install an .ipa file that I own onto my device, an iPhone 5.
I have the device, the iOS developer account (complete access), Xcode, etc. Now, how should I "codesign" it, add certificates, provisioning profiles and finally how do I install it in my device?
Since you have an .ipa, what you need to do is extract the .ipa (basically a ZIP file), pull out some files related to the old signing, swap in your new provision profile, and then re-sign. Simply zip it back up and you should be good to go.
IPA="/path/to/file.ipa"
PROVISION="/path/to/file.mobileprovision"
CERTIFICATE="Name of certificate: To sign with" # must be in keychain
# unzip the ipa
unzip -q "$IPA"
# remove the signature
rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources
# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
# sign with the new certificate
/usr/bin/codesign -f -s "$CERTIFICATE" --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app
# zip it back up
zip -qr resigned.ipa Payload
This is all assuming that you're not trying to change the bundle ID or anything with entitlements. Note that the new profile must have the necessary entitlements for this to work on a device.
For a pre-made script that also does this, see the following:
https://github.com/RichardBronosky/ota-tools
I got very nice linked from internet that you can create certificates, provisioning profile and co-design using following steps.
As you said you have complete access of you iOS developer account with 99$ yearly subscription. then you have to your system.
Create Developer cer from you with your certificate signing request or CSR. Download it and install it in to you key Chain by Double clock on Cer. that shoul appear in to you keyChain like following screenshot with private key. If with your Dev cer if there is no private-key then there is some mistake in to you system authority cer.
Now for testing app in to your device you have to add your device UDID in to this dev cer. You cannot run an iOS application on a random device. You need to specify on which devices your iOS application should run by adding one or more iOS devices to the iOS Dev Center.
Browse to the Certificates, Identifiers & Profiles section of the iOS Dev Center, click the Devices tab in the iOS Apps section, and click the plus button in the top right. To register a device, enter a name for the device and he device's UDID. The UDID is an identifier that uniquely identifies an iOS device. Note that the UDID is not the same as the device's serial number.
You can find the UDID of a device by connecting the device with your machine and launching Xcode's Organizer. You can open the Organizer by selecting Organizer from the Window menu. Select the Devices tab at the top and select the device you're interested in. The 40 character alphanumeric string next to the label Identifier is the device's UDID.
After add your device UDID then you need to create AppID for you application. To create a new app ID in the iOS Dev Center, navigate to the Certificates, Identifiers & Profiles section, click iOS Apps, and choose App IDs from the menu on the left. To create a new app ID, click the plus button in the top right. like following screenshot
After cratering AppId then you need to Create a Provisioning Profile that use for code Signing. With the development certificate and the app ID in place, it's time to create a provisioning profile for your application. Before we start, it might be useful to explain what a provisioning profile is, because this is something that confuses a lot of new iOS developers.
It will become clearer if we create a provisioning profile for your application so let's do that now. In the Certificates, Identifiers & Profiles section of the iOS Dev Center, select the Provisioning Profiles tab in the iOS Apps section. Click the plus button in the top right to create a new provisioning profile. Select iOS App Development in the section labeled Development and click Continue. like following screenshot:
Click on continue In the next step, select the app ID you created a few minutes ago.
Select the development certificate from the list of certificates to associate the new provisioning profile with the correct certificate and click Continue.
You then need to select the devices you wish to link to the provisioning profile. Remember that only these devices will be able to run your application during development.
Give the provisioning profile a descriptive name so you can easily find it later. Click Generate and download the provisioning profile to your development machine. Double-click the provisioning profile to add it to Xcode.
Open the Xcode project that you created during the previous tutorial and select the project from the Project Navigator on the left. Select the first item in the list of targets and click the tab labeled Build Settings at the top. search for the subsection titled Code Signing Identity
After setup code sign, certificates,provisioning profiles create IPA by select device that connected Via Cable with Xcode. Run your project with your Device.
For Creating IPA Go to Top Bar of mac-screen--->Product-->Archive like following screenshot.
This process might be take some time for creating Build wait a while then you got new window with look like following.
Tap on distribute Button you get multiple option like following screenshot:
You have to select second option as same as above screenshot and click on Next Button. Then next screen with one drop-down. Select correct Identifier that you are using as a code sign And click on export.
After some process there is one window appear for location of save ipa file like following screenshot.
Yuhoo your IPA file is created now you can install by many thing for example using iTunes, using Test Flight using Diawi

How do you beta test an iphone app?

How can you beta test an iPhone app? I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta testing?
Related: Also, see this question on getting your app onto phones without using the App Store.
Creating ad-hoc distribution profiles
The instructions that Apple provides are here, but here is how I created a general provisioning profile that will work with multiple apps, and added a beta tester.
My setup:
Xcode 3.2.1
iPhone SDK 3.1.3
Before you get started, make sure that..
You can run the app on your own iPhone through Xcode.
Step A: Add devices to the Provisioning Portal
Send an email to each beta tester with the following message:
To get my app on onto your iPhone I need some information about your phone. Guess what, there is an app for that!
Click on the below link and install and then run the app.
http://itunes.apple.com/app/ad-hoc-helper/id285691333?mt=8
This app will create an email. Please send it to me.
Collect all the UDIDs from your testers.
Go to the Provisioning Portal.
Go to the section Devices.
Click on the button Add Devices and add the devices previously collected.
Step B: Create a new provisioning profile
Start the Mac OS utility program Keychain Access.
In its main menu, select Keychain Access / Certificate Assistant / Request a Certificate From a Certificate Authority...
The dialog that pops up should aready have your email and name it it.
Select the radio button Saved to disk and Continue.
Save the file to disk.
Go back to the Provisioning Portal.
Go to the section Certificates.
Go to the tab Distribution.
Click the button Request Certificate.
Upload the file you created with Keychain Access: CertificateSigningRequest.certSigningRequest.
Click the button Aprove.
Refresh your browser until the status reads Issued.
Click the Download button and save the file distribution_identify.cer.
Doubleclick the file to add it to the Keychain.
Backup the certificate by selecting its private key and the File / Export Items....
Go back to the Provisioning Portal again.
Go to the section Provisioning.
Go to the tab Distribution.
Click the button New Profile.
Select the radio button Ad hoc.
Enter a profile name, I named mine Evertsson Common Ad Hoc.
Select the app id. I have a common app id to use for multiple apps: Evertsson Common.
Select the devices, in my case my own and my tester's.
Submit.
Refresh the browser until the status field reads Active.
Click the button Download and save the file to disk.
Doubleclick the file to add it to Xcode.
Step C: Build the app for distribution
Open your project in Xcode.
Open the Project Info pane: In Groups & Files select the topmost item and press Cmd+I.
Go to the tab Configuration.
Select the configuration Release.
Click the button Duplicate and name it Distribution.
Close the Project Info pane.
Open the Target Info pane: In Groups & Files expand Targets, select your target and press Cmd+I.
Go to the tab Build.
Select the Configuration named Distribution.
Find the section Code Signing.
Set the value of Code Signing Identity / Any iPhone OS Device to iPhone Distribution.
Close the Target Info pane.
In the main window select the Active Configuration to Distribution.
Create a new file from the file template Code Signing / Entitlements.
Name it Entitlements.plist.
In this file, uncheck the checkbox get-task-allow.
Bring up the Target Info pane, and find the section Code Signing again.
After Code Signing Entitlements enter the file name Entitlements.plist.
Save, clean, and build the project.
In Groups & Files find the folder MyApp / Products and expand it.
Right click the app and select Reveal in Finder.
Zip the .app file and the .mobileprovision file and send the archive to your tester.
Here is my app. To install it onto your phone:
Unzip the archive file.
Open iTunes.
Drag both files into iTunes and drop them on the Library group.
Sync your phone to install the app.
Done! Phew. This worked for me. So far I've only added one tester.
In year 2011, there's a new service out called "Test Flight", and it addresses this issue directly.
Apple has since bought TestFlight in 2014 and has integrated it into iTunes Connect and App Store Connect.
Note that there is a distinction between traditional "beta testing" which is done by professional QA engineers, and "public beta testing" which is releasing your product to the public before it's ready : )
You can do "beta testing" -- loading to specific iPhones/iPods your testers will be using. You can't do "public beta testing" -- pre-releasing to the public.
In 2014 along with iOS 8 and XCode 6 apple introduced Beta Testing of iOS App using iTunes Connect.
You can upload your build to iTunes connect and invite testers using their mail id's. You can invite up to 2000 external testers using just their email address. And they can install the beta app through TestFlight
Diawi Alternatives
Since diawi.com have added some limitations for free accounds.
Next best available and easy to use alternative is
Microsoft
https://appcenter.ms
Google
https://firebase.google.com/docs/app-distribution/ios/distribute-console
Others
https://hockeyapp.net/
http://buildtry.com
Happy build sharing!
There's a relatively new service called HockeyApp, which seems to rival TestFlight, however they claim to give you access to unlimited users, but it does cost some $$ unlike TestFlight which has now been integrated directly into iTunes Connect.
Using testflight :
1) create the ipa file by development certificate
2) upload the ipa file on testflight
3) Now, to identify the device to be tested on , add the device id on apple account and refresh your development certificate. Download the updated certificate and upload it on testflight website. Check the device id you are getting.
4) Now email the ipa file to the testers.
5) While downloading the ipa file, if the testers are not getting any warnings, this means the device token + provisioning profile has been verified. So, the testers can now download the ipa file on device and do the testing job...
With iOS 8, Xcode 6, iTunes Connect and TestFlight you don't need UDIDs and Ad Hocs anymore. You will just need an Apple ID from your beta tester. Right now you can only beta test your app with 25 internal testers, but soon 1000 external testers will be available too. This blog post shows you how to setup a beta test with internal testers.
(As the official guide is still missing in this thread..)
TestFlight, acquired by Apple and now (iOS8+) available for beta testing makes it easy to hand your app to beta testers without the need to collect device UUIDs beforehand (you only need email addresses of your testers). An extensive guide explaining all necessary steps may be found in the iTunes Connect Developer Guide.

Resources