How Do You Embed a Provisioning Profile in an iOS App - iphone

I read in the iOS Enterprise Developer Program docs that a provisioning profile can be embedded with the application.
I am wondering how this is done. Is it simply added to the Payload directory of an IPA, or included in the project directory?
I also wonder whether this technique is generally available for all deployment modes/Programs, or is it just for Enterprise distribution deployments?

The file should be called embedded.mobileprovision
It should be placed inside the .ipa zip file, in the directory Payload/.app/
XCode's "Build and Archive" then "Share..." functionality automatically adds it (so you can use unzip on the .ipa generated by XCode's share feature to see where the files should go).
I'm unclear exactly which scenarios this is supported in, however it definitely works for adhoc builds when you're installing directly from the web onto the device (ie. using the method described here: http://developer.apple.com/iphone/library/featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html )

Related

Invalid Swift Support - The SwiftSupport folder is missing

I have updated a currently submitted Titanium app and added a watch extension using swift.
Everything works fine if I build and test on sim and build directly to device. I only get an issue when I submit the app to the Apple app store (via XCode Organizer).
The binary submits, passing validation but I get am email from iTunes Connect as follows:
Dear developer,
We have discovered one or more issues with your recent delivery for "xxxxxxxxxxx". To process your delivery, the following issues must be corrected:
Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.
Once these issues have been corrected, you can then redeliver the corrected binary.
It seems as though it may be related to a build setting: Embedded Content Contains Swift Code.
It looks like this needs to be set to Yes if the Titanium project contains embedded Swift.
As of now I am stuck as I cannot submit the app. Is this a Ti problem or is there another step I should follow?
XCode: 7.3, SDK: 5.2.2.GA - Project created and built using only the Ti CLI.
First you should check your .ipa file by
unzip yourapp.ipa
If the only Payload exists, the Apple reject your app.
You should create SwiftSupport/iphoneos directory and put the appropriate
swift library files.
You can know which libraries are necessary by checking Payload/yourapp.app/Framesworks. But this library files can not be used as SwiftSupport/iphoneos.
You must copy the appropriate libraries from your mac's /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos directory. The file names are same as the above Payload/yourapp.app/Frameworks but the contents are different.
After you get the Payload and SwiftSupport directory, do package these directories by
$ zip -r yournewapp.ipa Payload SwiftSupport
(Remark: remove all .DS_Store files if exist)
Then Apple accespt yournewapp.ipa.
For future reference: I had to Archive the Titanium project through Xcode because one of my third-party libraries requested to execute a script in the Build phases.
Received the same message from Apple and fortunately fixed it just changing the Embedded Content Contains Swift Code to No.
You should choose "Save for iOS App Store Deployment" option at the time of exporting ipa file.
This issue has now be resolved, there is a new version of the Titanium SDK, 6.0.1.GA that specifically has a fix in for this issue. I have now created, submitted and have a Titanium app with associated watch app now published in the app store.

xcode 4.3.1 - Share archive option not visible

I am trying to put my build up for testing on TestFlightApp. In my previous version of xcode, I was able to view the "share" option after archiving, which I used to create the ipa file. The ipa file was uploaded to testflight and everything worked as expected. With the upgrade to xcode 4.3.1, I don't see the share option. I tried using the distribute option and created the ipa. Then when I tried uploading the ipa to testflight, got the following error.
'Invalid IPA: values for key com.apple.developer.ubiquity-kvstore-identifier are mismatched between profile and binary'
can someone help.
I know an answer has been provided to this question, but looking at the comments (and my own request having sending me here also) it seems that help might be needed to those like #Yuchen or #Kent in the comments that only have two options in the distribute panel ("Submit to the iOS App Store" and "Export as Xcode Archive"), and can't see the "Save for Enterprise or Ad-Hoc Deployment" option.
If your target includes other targets (e.g. libraries), you should put the "Skip Install" flag to YES in the "sub" target Build settings. This will allow yourself to distribute your archive as an IPA file.
More information can be found on this StackOverflow answer.
Hope this will help,
Thibault
Here is how I fixed it.
com.apple.developer.ubiquity-kvstore-identifier is specifically for iCloud. See iOS Developer Library. So I used the following procedure:
Verify App ID in iOS provisioning Portal iCloud status (mine is enabled)
Removed old entitlements from project (I had manually created them)
Use the Target editor to enable the entitlements (at the bottom of the Target editor window), matching the App ID iCloud setting, added Container and Keychain Access.
Clean and Archive
Select the archive and click on Distribute...
Save for Enterprise or Ad-Hoc Deployment
Select your development code signing identity
Save the bundle to disk - did not check for enterprise
Drag ipa to TestFlightApp.com builds
At this point, TestFlight accepted the bundle and my testers were able to download!
In Xcode 4.3.1 there is no "share" option in Archives tab of Organizer to create IPA.
Hence to create IPA just click the available "Distribute" option and select Method - "Save for Enterprise or Ad-Hoc Deployment" then we have an option to save the build in IPA format.
See the Attached Screen Shots,
thanks,
Naveen Shan
You can use
Distribute... and Save for Enterprise or Ad-Hoc Deployment
It is same as the old Share... menu.

How to release an iPhone app that uses an external 3rd party library?

We're using a 3rd party library in our iPhone app and when we build it for Release & Device, we're able to find the application in the expected folder (Release-iphoneos), but we also find the library in that same folder.
When uploading the application, do we have to do anything extra with the external library, or is it by default included in the iPhone application?
We do have it included in the Targets -> Application -> Link Binary With Libraries, but we're not sure if that's enough.
The general test is, if you've linked the library and included it in your project, and your app runs on a Device in any mode (Debug or Distribution), then all will be well for the release build.
Check the .app itself! It's just a .zip file that you can open. Change the file ending to .zip and unpack it. You can see if the library is included or not.
[edit:] sorry, i mixed .ipa (which is a combined format for ad-hoc distribution and app-store upload) and the .app
But you can still check that. Use build and archive and export for ad-hoc distribution. (save to file) that will give you an .ipa - if the library is not included in the .app itself, it should be in the .ipa (but I doubt that...)

Finishing an app - getting the binary file?

I've finished developing my app and I want to release it. What is the binary file that apple is looking for in the submission for in iTunes connect?
Zip the app bundle, or better yet, use the Organizer to upload.
Check in the Build directory inside your project folder. There should be a folder in there called "Release". Inside that folder is YourApp.app. Zip it up and send it in.
You need to visit apple provisioning portal to generate a distribution certificate for your app, then download it to your machine and in the end you have to build it up it with this certificate in xCode.
There some tutorials on the provisioning page. So I hope you can make it.
https://developer.apple.com/iphone/manage/overview/index.action

"The binary you uploaded was invalid. the file was not a valid zip file" Error message uploading app to iTunes Connect

I'm trying to upload an iPhone app binary to iTunesConnect and keep getting the following error message "The binary you upload was invalid. the file was not a valid zip file". I had an app upload ok recently but this app is having problems. So after a while I carefully went through the following steps trying to make sure everything was ok. Any help is appreciated.
The steps:
renamed the project
(Project->Rename... enter name into
Rename project to:) to release name
making sure the name has no spaces.
Cleaned project
Make sure
references in build setting reflect
new app name
Create new app ID
matching project name in iPhone
Provisioning Portal
Destroyed old
developer and distributer
provisioning profiles in
Provisioning Portal, in XCode and on
iPhone.
Create new development
provisioning profile using new app
name.
Install development
provisioning profile into XCode 8)
Build (Release) for iPhone OS 3.1.3
(highest my phone will upgrade to,
I'm assuming current released
version)
Builds, Installs and Runs on actual
iPhone: To me this implys App and
developer ID's are OK.
Create a distributor provisioning profile
using existing Distributer ID.
Install distributer ID into XCode
Clean
Checked that "Code
Signing Identity" and "Any iPhone OS
Device" lines in Build settings are
set to Distributor ID
Build for
release for OS 3.1.3
Check Build
results to make sure code is signed
with Distributor Profile
Reveal
.app file and compress (alt click >
Compress "appName.app")
Upload
to iTunes connect
Gives "The binary you uploaded was invalid. The file was not a
valid zip file"
Here's some additional steps I try: Quit Xcode after clean (or clean all) then delete the Build folder. I don't "Build and Go", just "Build". The AppName.app is generally in the "App Store" folder (or whatever you name your build configuration for App Store release. I right click only that AppName.app file and choose "Compress" in the Finder.
You could also try uploading it with Safari.
It seems like your problem isn't with the provisioning profiles, but with the way the file is being zipped (or maybe uploaded). Try repeating that part, changing details.
Thanks for the help. It turned out the problem was to do with the fact my project folder was on an ntfs HD. As an experiment I copied it onto my macs HD and it worked perfectly. I don't really understand why this is.
NTFS (New Technology File System) is a windows format. You may like to read this:
https://en.wikipedia.org/wiki/NTFS
Now if you will have a NTFS format iTunes will not recognize that format. And iTunes will support or recognize mac extended versions.
So try not to use NTFS or FAT format for ziping up the projects.
Regards
Rajeev