Updating resource files for iPhone app - iphone

I've developed a generic iPhone app, intended for customization via a myapp.cfg file. I've successfully deployed the app to my adhoc testers via iTunes. My question is, how do I update their myapp.cfg file via iTunes. In other words, if they edit the .cfg file on their Windows PC or Macbook, how do they get it into the apps bundle in the iPhone?

You'll need to provide your own mechanism to download the config file into the application's Documents area; as app bundles are effectively sealed by the code signing process there's no way to modify the bundle post facto. As you have no interface to iTunes you need to provide your own mechanism - you might choose to do something like OmniFocus which uses Bonjour to discover the computer from which it retrieves its sync settings.
Looking at it another way; why use a config file at all? Other iPhone applications use a settings bundle and the standard application preferences as recommended by Apple, why do something different? There's always a chance that you'll confuse the user.

Related

Installing an Ad Hoc app for testing without synchronizing iTunes

I have an iPhone app that I'm distributing to testers. I followed these instructions:
https://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/YourFirstAppStoreSubmission/TestYourApponManyDevicesandiOSVersions/TestYourApponManyDevicesandiOSVersions.html
And they work except for one of my testers, who does not use iTunes to synchronize his apps. He has many apps already on his phone and doesn't want to synch to iTunes because it sounds like it will delete them. So...Is there any other way to get a testing app onto an iPhone besides synchronizing with iTunes?
Simply distribute it using OTA ("Over The Air" distribution).
When you Archive your application using Xcode (menu Product -> Archive, I hope that's what you do already to keep debugging symbols so that you can symbolicate crash logs when testers send some back to you!), once you click on "Distribute", select the "OTA Distribution" option and follow the steps.
Don't forget to check the "Distribute for Enterprise" checkbox in the appropriate step and fill the requested informations (Product Name, URL of the IPA when you will upload it on your server, etc).
Once your .ipa and the associated .plist is created, upload them both on a web server, and make a link to "itms-services://?action=download-manifest&url=<the_url_to_your_plist_file_here>".
When the users will open this link from their iPhone, it will prompt to install the application on their device directly, without the need to plug their device to any computer.
There are many tutorials on the net about this, simply google about iPhone OTA distribution.
I strongly recommend TestFlight. It's free and it's easy and they manage all that server side work.
Since your user is afraid of the iTunes Sync Process (for good reason), why not recommending him to use the iPhone Configuration Ultility.
That tool does not do a complete sync but only transmits the app you specified to.
It is free, easy to use and very reliable. Well, sometimes it has its hickups on Windoze systems but that seems to be a normal experience for users of that OS.

Auto-updated iOS application for enterprise distribution

Is it possible to make an iOS application for enterprise distribution that updates itself transparently? Saying 'updates' I mean completely updating its logic.
A possible usage of this approach is a self-service kiosk (iPad) that is maintained remotelly.
It's not possible to update application binaries directly, but I see some possibilities:
Application that have a single UIWebView and the logic is implemented in HTML5. But we can't use most of hardware specific features that can be used in native applications.
Some multi-platform framework (possibly HTML5-based) that allows to use native application features and that is compiled or interpreted dynamically.
Jailbreak?
What are really working approaches of these?
Consider getting a mobile device management service. Those are pricey.
OR:
First, enable over-the-air distribution. It will take $300/year enterprise agreement with Apple. Set up a website with the app's IPA archive and descriptive PLIST.
Then code a call-home HTTP request on app startup. You may pull/parse the same PLIST that describes the latest version; it has a bundle version in it. Compare that to the version of the currently running bundle.
When a new version is detected, the app shuts down, opens the browser on the download page. In a softer manner, just notifies the user that an upgrade is available.
I've never tried linking directly to the app's download package, but give it a try. In a perfect world, Safari would open up and ask "Do you want do download MyApp?" right away. In a not so perfect world, the user would have to click a link and then agree to download.
I think what you are looking for these days is the "Apple Deployment Program".
You volume purchase iPads which get sent to people, but that you can manage remotely - which also means management including remote updates of applications.
The only thing I'm not sure of is if you can launch an app remotely, so that you could update and re-launch an application.
Here's a guide to enrolling devices for remote management:
https://www.apple.com/business/docs/DEP_Guide.pdf
An old but good summary of the program:
http://www.speirs.org/blog/2014/2/27/understanding-apples-new-deployment-programs
Also watch the WWDC video on Managing Apple Devices for the Enterprise:
https://developer.apple.com/videos/wwdc/2015/?id=301

How to codesign automatically generated iOS apps?

Greetings,
I'm in the progress of writing a web server script that lets you create custom iOS apps (basically exchanging logos and a few other things). The web server customizes a previously uploaded "shell" .ipa and re-zips the whole container to send it to the user's browser. That is: we customize a previously uploaded .ipa on the web server and let the user download it for submission to the App Store.
The next step would be to re-codesign the whole .ipa - because we changed the .IPA contents and the user must use his own signing identity - so that he can actually upload it to the App Store.
From what I understand, there is a "CodeResources" file which contains some kind of hash for each resource file in the bundle, and the executable contains some kind of embedded signature as well. To generate these, you'd have to use the "codesign" utility on the user's computer, then use Application Loader to submit it to the App Store. Correct so far?
What I'm trying to find out is:
Is there a way to codesign the .ipa on the server (with having the user upload his certificate beforehand), so that he does not have any extra work to do?
If 1) is not possible, is there some kind of tool that allows to re-codesign the .ipa without much hassle? Xcode seems to require some project setup work to do just a bit of code signing - if possible at all.
Are there any alternative ways to codesign the .ipa files for the user - possibly without having to manually do it by hand?
Thanks in advance!
Xcode uses the codesign command line utility to create the CodeResources folder and the digital signature, you can invoke it yourself to sign an app bundle outside of Xcode. You could probably automate this on a server if the server was running Mac OS X; if you're really clever you might be able to figure out how to create the signature yourself using openssl (the signing certificates, etc. are all standard stuff). Or, if you can count on the user having the dev tools installed, provide them with an app that automates the signing for them.
Here's a blog entry describing some of the process (though the use case is a little different).
I don't like to answer my own question, but I want to close this after so long.
We ended up using Xcode's targets and schemes to ease up the generation of many different apps. Since we have a reasonable number of app variants, this seems to be OK for now.
Code signing is a mess and Apple constantly changes the technical process behind it - so it's a moving target and requires a lot of hacking and trial-and-error work.

Transfer Zip file from iPhone app

I have an iPhone app that creates a zip file.
I need to provide an easy way to allow the user to transfer that zip file to their PC (not via any network connectivity, as this file could be rather large).
Any suggestions?
Currently there is no way to accomplish this. You cannot hook into the synchronization until the next release of iPhone OS.
However, it works fine in Android.
For development builds you can access the file through Xcode's Organizer, and save locally to the Mac. I am not sure what is required to permit the access, perhaps the signing certificate?
iPhone Explorer (now iExplorer) works to grab files stored in an app bundle. I use it all the time.

File location of compiled iPhone app?

I'm writing an iPhone app in simulator/debug mode at the moment. I'd like to know, after I build it, where does the binary go? I want to send this file to my friend to show him what I'm doing so far.
Also, how do I package apps into .dmg files? That seems to be the better format to send app to other people?
Have you joined the iPhone Developer Program?
If so you will need your friend's device ID to generate a provisioning profile.
I recommend that you read Publishing Applications for Testing for more details.
Your binary files will be on {Project Folder}/build/, there you will have one directory for each of the possible options: Release/Debug and iphoneos/iphoneSimulator.
To create the DMG read Creating a .DMG.
by default, the built results are located in {Project Folder}/build/Debug (or Release if you build in that config). You can use the hdiutil command-line tool to generate a DMG of your app - have a look at its man page which is quite comprehensive.