keep old app versions submitted to store and install them on dev iPhone - ios

I would like to keep versions submitted to the store to install them on my developer phone at a later time, is that possible? If I take that .ipa, how can I install it on my phone? Do I have another format than .ipa?
How can I build an archive of all my app store versions to install them at a later time?
I tried the solution from Rhythmic Solution, doesn't work yet ("A valid provisioning profile for this executable was not found."). My steps:
from the archives in Xcode, export one entry as App Store build
open iReSign
enter path to exported .ipa in first field
enter path to downloaded developer provisioning profile in second field
use an entitlements.plist created like here
select developer certificate
resign button
drag it on to the "installed apps" section in Xcode/devices
now I get the error "A valid provisioning profile for this executable was not found."

I think you can upload all those versions on diawi.com and get the url and save them whenever you need that version just take the respective url and install in your phone.
On other note git is a very important tool to track the versions of you code.

A while back I came across some ancient Ad Hoc builds of mine and wanted to try them out, but the technique works with AppStore submission builds, as well as developer and enterprise.
The general method is to
1. unzip your .ipa file into an .app
2. replace the embedded.mobileprovision provisioning profile (which has probably expired or does not allow installation on your device)
3. the above step invalidates the app's signature, so you resign it
4. zip the app back into an .ipa file
5. install the app via over-the-air download, drag onto the Xcode Devices window or itunes syncing (if you like pain)
iResign can do steps 1-4 for you.
If you want to duplicate entitlements, you can start here - however that can be more complicated than simply copying them across, e.g. push notifications can change from production to development and vice versa.

Related

Is it possible to OTA install an iOS App that is signed with FREE Apple Dev Account

Note that I'm aware of these posts:
How to create IOS .IPA file and share it, using FREE Apple ID?
How to create ipa in xcode 6 without Apple Developer account?
I don't want to send the app to anybody for testing (not knowing their UUID).
My situation is this
I have the .ipa file. Can generate it using 'xcodebuild' command or by drag&drop the archive's .app file into iTunes
this .ipa is codesigned with my free AppleID
the provisioning profile, generated by XCode contains 3 device UUID
What I'd like to know: why I can't install this .ipa file to the device which UUID is presented in the provisioning profile.
If I try to install it using iTunes it starts to install, but after the progress bar (progress circle to be exact :P) on my device completes, the app icon just disappears and iTunes is stuck in the syncing process. No error message is shown.
I also tried to install it using diawi and got the error message "Unable to Download App". Although it shows me that my device's UUID is in the app's provisioning profile.
No, I believe the free account only allows you to build and install directly on the device with a development build. Also, those builds' provisioning profile expires after 7 days, so the OTA builds wouldn't last very long anyway.
If you want more details of why the install is failing, you should look at the device console during the installation. It will give you more details on the exact reason for the failure.

Xcode: Problems with getting my App to the AppStore

I am trying to upload my app to the AppStore with Application Loader
I tried to archive my project in order to generate the "ipa" file for Application Loader and the archive process got stuck at "Compiling swift sources" for almost 5hrs; I took to the response I read from - Xcode 6.0 taking forever to archive my project and I successfully generated the .ipa file with iTunes but while trying to upload with Application Loader, I get the error:
ERROR ITMS-90161: "Invalid Provisioning Profile. The provisioning
profile included in the bundle com.youngbobby.MyAppName
[Payload/MyAppName.app] is invalid. [Missing code-signing
certificate]. A Distribution Provisioning profile should be used when
submitting apps to the App Store. For more information, visit the iOS
Developer Portal."
I have generated my keychain certificate and my distribution provisioning profile and I still get that error during submission. Do you think the error is related to the method I used? Do I have to maintain the traditional "archive" method? If yes, what would be the fastest way to archive and generate my .ipa file? I have tried enabling Whole Module Optimisation as suggested here all to no avail.
Any help would be greatly appreciated.
EDIT
I did a quick check on why my archive process was stuck at "Compiling swift sources" using "cmd + 8" and I noticed that my local Data store swift file which is a long Dictionary of type [[String:Anyobject]] was the cause of the problem. I can't really explain why it is so but I want to maintain the traditional method of archive and send because it seems using iTunes to generate my ipa file does not agree with my provisioning profile.
When you are building the project, it is still building for debugging, hence it is using the development provisioning profile.
Before you do the build to create the .app, go to the Scheme (just to the right of the stop button, to the left of the device on which you are running).
Click that and choose "Edit Scheme..."
Under the Run section, there is a setting for Build Configuration.
Change that from Debug to Release (if you are using the standard build config and you have configured the Release config to use your distribution profile and signing identity).
Close that window, then change your device to the generic "iOS Device option (make sure you don't have any devices plugged into your Mac).
Once you've done that, run your build again and the ipa created should be built with your release configuration and signed correctly.
You are probably using a Development Provisioning profile.
Go to your dev center.
Create a new provisioning profile, select App Store and select your bundle ID. create that and download it.
Control drag that provisioning profile to Xcode, Change build settings in target and project to the one you downloaded now and as Distribution.
Compile and build your app. Archive it and start uploading it to App store.
That should do it.
P.S do select your team correctly before you configure your build settings.
EDIT
If you already have done these steps just revoke the old one and create a new Provisioning profile and check.
Finally got my problem solved.
It seems all I needed to do while my app was compiling swift sources was to WAIT
I reduced the amount of Data in my Datastore file and the Archive process took less than 10 seconds to archive.
Pity, Xcode does not show a Timer to calculate how long it would take to archive a project and looking at the progress bar does not really guarantee that the process is working as in my case was a relatively huge one. So, maintaining the huge data I had, I simply had a 6hr nap and by the time I was up, my project was successfully archived and all other processes worked seamlessly :)
If you find your project 'stuck at compiling swift sources' during Archive Process, all you need to do is Wait.

Testflight doesn't show "Update Profile" Option anymore

I often had to change the provisioning profiles for my ios builds due to new testers/udids.
I had no problems following this guide Adding more testers to a build?
I updated my profile in the devcenter and made the upload, everything works perfect. But from today on I miss this option completely, the Update Profile Button and the complete row is just gone.
I googled changes regarding testflight but couldn't find anything.
Someone has a clue?
iOS 8 doesn't support installing provisioning profiles individually any longer. So this doesn't work on iOS 8 devices any more and you have to create a new build using the updated profile to add new devices.
I emailed TestFlight about that this morning and this was their response. Looks like it's for iOS8 as others have pointed out :
"Due to the changes in iOS 8, it's no longer possible for testers to install provisioning profiles from the iOS Settings app. App developers will now need to rebuild their Ad Hoc beta apps to update the embedded provisioning profile in the app's IPA file. If you need any help with this process, please let us know.
You can also find more information about updating provisioning profiles from the link below:
http://help.testflightapp.com/customer/portal/articles/829818"
I was able to change a particular build's embedded provisioning profile manually. Here's how I did it.
Download the build's IPA file from the testflightapp website. You can download it by accessing the build's share address in your browser. That's the https://www.testflightapp.com/install/BUILD_ID link that's shown on the Build Permission page.
Change the ipa file's extension to zip and unzip the archive.
Right-click and Show Package Contents on the single file inside the Payload folder.
Replace the embedded.mobileprovision file with your updated provisioning profile.
Recreate the zip archive and change its extension to ipa.
Upload that ipa file to test flight.
The option has dissappeared for me as well. I was also using the option frequently.
However, I did notice problems and the feature was no longer working once the iOS 8 GM was released on iOS 8 devices.
Even though I updated the profile, the build failed to install every time. (And now that you asked I noticed it's gone).
I also browsed through all the settings/permissions/etc, but it seems they removed the feature.
Since Apple acquired TestFlight, they changed the whole process for iOS 8:
No more provisionning profiles, only Apple ID's email.
1,000 beta testers and 25 internal testers per application.
https://itunesconnect.apple.com/ is the new testflightapp.com/dashboard/
I have successfully replaced my old process following this one: http://code.tutsplus.com/tutorials/ios-8-beta-testing-with-testflight--cms-22224

How can I test a production iOS App Store build?

I'm new to iPhone development and i'm not sure how to test the actually binary that will be sent to Apple. Today I released a build that works great on my local device but the released App Store version did not work and hung on launch.
I'm trying to figure out how I can test my production builds so this doesn't happen again.
I tried creating an ad-hoc binary and saved the ipa to my desktop, then imported into iTunes. The app synced and downloaded but remained dark and said 'waiting..'.
I signed up for Test Flight and it said my IPA was created for production and the sdk could not be found.
Do I need to research ad-hoc builds and profiles? This seems to be getting confusing really quickly and i'm not sure where to start looking/learning.
When you create an archive to submit to the AppStore, it is saved under the organizer (Press Command + Shift + 2 to open Organizer).
You can save the same archive for Ad-hoc distribution as a .IPA file, and then install it using iTunes or TestFlight.
In the Organizer, just select the right archive, click 'Distribute', and select 'Ad-hoc distribution' and sign the IPA with your Ad-Hoc distribution profile (if you haven't created an ad-hoc distribution profile, create one at developer.apple.com, download it and double-click on it to import it to your Mac OS Keychain) to generate the .IPA file.
As long as you re-sign your AppStore archive with an ad-hoc distribution profile, it should install and execute on your test devices.
Follow these steps hopefully it will work
Delete the application from your iPhone.
Create a new Adhoc Distribution provisioning profile, make your the devices you want to run on are included in that profile.
Make sure the certificate associated with the newly created profile has a valid private/public key pair.
After creating an archive, see the build must be created with the newly created profile(From a drop down that comes after archive).
If the problem persists, to verify rename the .ipa to .zip go to payload folder right click .app and show package contents see the embedded profile shows the correct profile and have the devices added.

App Submission: Invalid Binary - Invalid Signature

I am trying to submit an update to the iOS app store. I am going from a Buzztouch app to a Sprite Kit app. I am able to archive the Xcode project and submit it. The app gets to the status of Upload Received but than about a minute later, it changes to Invalid Binary and I get an email saying:
Invalid Signature - Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target.
Once these issues have been corrected, go to the Version Details page and click "Ready to Upload Binary." Continue through the submission process until the app status is "Waiting for Upload." You can then deliver the corrected binary.
I have cleaned out the build directory, rebuilt my release target, and made new provisioning profiles multiple times. All of the Code Signing Identities are set to iOS Developer. Code signing and the provisioning profiles have always been a little bit confusing to me, I could have made some obvious mistakes.
I have tried submitting over 50 times! I find this very frustrating because I have emailed Apple and they got back to me but it was just a link to the dev center with code signing information. I have also spent lots of time searching the Internet to find a solution to this and there hasn’t been a good solution that actually works for this problem.
The only thing I can think of is either because I am changing from a Buzztouch app or it is Sprite Kit.
Here is a screenshot of my code signing:
In Apple developer support there are two additional common causes of the Invalid Signature binary rejection reason,
executable files containing special characters (i.e. non-numeric, and non-alpha). To resolve this issue, change the Xcode target’s Product Name build setting from “${TARGET_NAME} to a string containing only alpha/numeric characters. Let me know if this was the cause of the issue (and the problematic characters) because I file bug reports to fix each instance I find here.
Apple Double Files ("double files") that result from copying the Xcode project uncompressed to/from a non HFS+ formatted hard drive. To check if this caused your rejection: 
A. Run the app diagnostic here: How do I check if my application's signature has been corrupted?
B. Then check the command line output with: List of Signature Verification Failure Root Causes. Double files are diagnosed with a message like:  
resource missing: my.app/._.*
C. From the docs:
The file prefixed with "._" is considered an AppleDouble file and it
can result from copying the uncompressed Xcode project folder onto a
non-HFS+ formatted disk. The AppleDouble files must be removed using
the 'dot_clean' command. The Xcode project folder is the argument to
dot_clean as illustrated below. Note: You can drag your Xcode project
folder from Finder into the Terminal window to automatically fill its
path into the command.
dot_clean /path/to/My_Xcode_Project
(If Terminal can't find the dot_clean utility, download the optional Command Line Tools through Xcode > Preferences > Downloads)
D. After running dot_clean on your Xcode project, create a new app archive (via Xcode > Product > Archive), reattempt submission.
To prevent double files be sure to compress the Xcode project folder to .zip using Finder before transferring it to/from a non HFS+ formatted hard drive. 
This is what I did when I encountered a similar problem with the Mac App Store:
Re-generate the app's Distribution and Development certificates (from the Apple Developer's Certificates site).
Download both certificates and drag them to Xcode's icon (not sure whether it had any impact, but after so many submission failures, I was pretty superstitious).
Re-fresh the certificates and identities from Xcode.
Open Xcode's Preferences.
Go to Accounts tab.
Clicked my account
Clicked the refresh button.
Generate the archive.
Submit the app and clicked on "refresh signing identities" somewhere mid-way in wizard prompts.
As a reference, here is my built settings related to signing. That one worked the last time I submitted the app (which has been in the "waiting for review" state for the past two days now, so I guess it passed all of their automated tests).
Your issue relate with signing failed because of your app didn't sign with recent distribution certificate. Check the following steps:
1) Check your bundle identifier to list out provisioning profile as like below picture. Because It also lead to this problem.
2)You may not using the correct certificates when building your app. Just Delete your certificates in Provisioning Portal and create new ones and update them in Xcode.
3) From your picture, you didn't selected correct provisioning profile. Goto Organizer / Provisioning Profiles / Refresh and allow Xcode to fetch the latest ones. see screen shot to how to do that.
Select correct Provisioning profile.
Select correct code sign.
4) Cleaned up your project.
5) Just clean all your targets . You can even go to /Users/%USERNAME%/Library/Developer/Xcode/DerivedData and delete all of the directories in there.
see this ref
Under "Code Signing Identity" Make sure you have selected your Distribution Cert for the "Release" scheme
Under "Provisioning Profile" make sure you select a Distribution provisioning profile (not an Ad Hoc one)
Archive and distribute, make sure the same cert is selected when submitting (after entering your iTunesConnect info)
After doing all of the above
Menu Bar
try Product->Archive
Then from the organise try resigning and submitting.
Window->Organiser
Select archive and then press distribute (but i'm pretty sure you'll know how that works)
Obviously if you can't do this then chances are you have indeed got something wrong with your signing certificates, more specifically your bundle identifier is likely to be the culprit.
One other option is your app uses services that you haven't set up on developer.apple.com/ios for the app id such as game centre, push notification etc. Good luck
check your launch images . Are they conflicting like 2 images have got same name. Because i have got the similar issue which i solved like this within 10 minutes.
To figure out this problem I just created a new Xcode project and copied and pasted everything into the new project.
In my case the problem was to not ASCII chars in filename (someone did sent us to embed), solution was to do a global search in project:
ls -1 -R -i | grep -a "[^A-Za-z0-9_.':# /-]"
And delete those chars from filenames.

Resources