Automating Xcode archive and upload? - xcode

We have a dozen targets in the same Xcode project, each target is an app on itself, and we always release all the apps at the same time.
It extremely counterproductive to individually archive and upload each target to iTunesConnect.
I believe I've found a way to archive: http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
But so far I was unable to find a way to upload to iTunesConnect from command line.
Please advice how should I approach this task. Thank you.

You can use altool, Application Loader’s command-line tool for validating and uploading your application binary files to the App Store. Please checkout apploader
Also, you can use deliver to submit your app for App Store review. Please checkout master/deliver

Related

Xcode 14 how to upload dSYM to crashlytics

I have some problems with uploading dSYMs to crashlytics using Xcode 14. I saw a lot of similar questions and discussion on apple forum, but none if them are the same as my case.
Since in Xcode 14 bitcode is deprecated we can't download dSYMs from TestFlight. As i understand as long as flag "enable_bitcode" is set to no, dSYMs from my local archive (which was used to upload app to TestFlight) should be valid for crashlytics, but unfortunately there is a mismatch in dSYM uuid.
So in Firebase Console there is an information that for version X build Y there are missing dSYMs with UUID idX1 and idX2, but unfortunately when i check archive that was uploaded to Testflight there is no dSYMs with uuids idX1 or idX2.
Do i miss sth? I will appreciate any help.
When bitcode is disabled, these are usually the steps to follow:
Make sure that Xcode is generating dSYMs.
Follow these configuration steps to automatically upload dSYMs when building the app.
Increase the version/build number (this is to easily distinguish the new tests).
Do a small code change. This will trigger Xcode to generate a new UUID and related dSYMs.
Build the app and cause a test crash following these steps.
If everything went well, the correct dSYMs should be uploaded to Crashlytics. But, if you see "missing dSYMs" for the this version/build number, it would be interesting to see if something went wrong when uploading the dSMYs.
Typically, the run script will do some validations but will do the upload asynchronously. To override this behavior and do it as part of the build process you can use this other run script:
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/upload-symbols" --build-phase --debug
The --build-phase flag will indicate the script to upload the dSYMs during build time, this will make the build to take a bit longer but will give you the opportunity to obtain more information about this process. Also, the --debug flag will make the script to provide verbose output.
Things to look in these debug logs:
The UUIDs of the dSYMs files.
The App Id. Make sure this is the correct one. In some scenarios there can be multiple GoogleServices-Info.plist files and the script could be using the wrong file.
Errors in the upload process.

How can I include an Apple Help Book when building my app for OSX

I have developed a Firemonkey app for Windows and OSX. I have also developed an Apple Help Book containing the help for my application when it is run on OSX. (I have a different help system when running in Windows.) Apple's recommended location for the help bundle is in the app's Contents/Resources folder. I can copy the help bundle there manually but it gets deleted every time I run my app in the IDE or deploy my app.
I thought about trying to use the deployment manager but this only allows files to be deployed, not bundles. The help bundle contains a large number of files spread amongst various folders and it would be tedious to set each file up individually in the deployment manager. Moreover, I would have to change the setup every time I added or deleted a page from help since each page is a separate HTML file in the bundle.
So for now, I am manually pasting the help bundle into Contents/Resources. Does anyone know of a more efficient method to incorporate the help bundle?
After much research, I came to the conclusion that the only reasonable way to incorporate an Apple helpbook is to paste its bundle into the app bundle at the location Contents/Resources. I thought about locating it elsewhere but Contents/Resources is where Apple recommends it should go. This is inconvenient because it gets erased whenever I redeploy the app or run it from the IDE. But until Firemonkey is enhanced to make provision for helpbooks, this seems to be the only acceptable way to do it. The program 'Packages' http://s.sudre.free.fr/Software/Packages/about.html is then a great way to package the app for issue to customers.

Sharing an archived iOS build won't succeed on the clients side - no such file or directory

For one of my clients, I've developed a small iOS app. I'm a member of their dev team, so I've been using a development certificate to sign my local test builds.
Now the app is almost done and it should go into internal testing on the clients side. I created an archived build of the app which I then sent to my client. They imported it into the organizer and tried to "Share" it to be able to re-sign it using an ad hoc profile.
Creating the .ipa fails with an "no such file or directory" error though. The archive appears to be fine otherwise - the organizer shows all the usual information, the icon, and it will let them export it as another archive. Creating an .ipa without re-signing fails as well, which leads me to believe this is not an issue with ther certs and provisioning profile.
If I try the same thing on my side, writing an .ipa from the very same archive using my development cert, the operation succeeds.
It may be worth mentioning that the same procedure was working fine while we were still using XCode 3.x on earlier projects. This is the first time we've been trying this using XCode 4.
No additional (static) libraries have been used.
Any help greatly appreciated!!
Edit:
Someone at the apple dev forums suggested to me that I should check the system console for xcode error messages while attempting to export the .ipa - none were printed out. We discovered some other, older messages however, which read as follows:
18.04.11 13:54:35 /Developer/Applications/Xcode.app/Contents/MacOS/Xcode[123] /Users/User/Library/Developer/Xcode/Archives/2011-04-15/Foobar.xcarchive/dSYMs/Foobar.app.dSYM/Contents/Info.plist:
set flags (was: 00200000): Operation
not permitted
The timestamp is roughly at the time when my client first imported my archive, but we can't be sure since we didn't watch the console back then.
The message had been printed multiple time, once for every single ressource file contained in the bundle. Does this tell you guys something?
Problem solved.
Following another suggestion on the apple dev forum, we repaired permissions on both systems. Additionally, I built and archived the app again and used a different way to transmit the archive to my client. We did all of this in one try, so I can't quite tell which of these measures actually did the trick. If you stumble across this because you have the same problem, you might want to try all of this, too.
Thanks for listening!
Update:
It happened again - and this time, we tried to solve it step by step. Result: It's all about how the file is being transmitted. I just attached the archive package to a mail to my client, that's what broke it, although I don't know why. Zipping the archive before transmitting it solved the problem, however.
After downloading XCode 4.3 beta with the IOS 5 SDK, the Organizer function to share and archive stopped working with a cryptic error "No such file or directory found".
It turns out that this is related to having two different versions of codesign_allocate . To fix the problem, do the following in a terminal window.
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin
Another hint - try the manual way to create a shared ipa - since it gives you a lot more detail of what went wrong. See http://blog.dmahajan.net
Can you see if this is also linked to your problem?
EasyCoder's answer fixed this issue for me - I have the 5.0 beta SDK and had the same problem.
I ran the following and it was fixed:
ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin/codesign_allocate

Overwriting an iPhone app from a different Xcode Project

One of the apps I've developed is submitted and approved to the appstore.
Because of some big changes and a more generic code I created a new XCode project for this app.
The problem is when trying to install the same app (based on bundle identifier) from the new XCode project, it quits with a crash. If I try to install again (Build & Run/Debug) from XCode, it seems to successfully overwrite and run. So it seems the first time there are some merge / overwrite conflicts. A second install, over the failed first attempt makes it work.
I wouldn't want this to happen with app updates downloaded from the store.
I've read that the idea is not to build from XCode, but use an Ad Hoc Build through iTunes instead. This would simulate a more natural end-user process. I've tried this, but somehow it won't sync / overwrite the existing app from the appstore (no errors, the app is just not changing).
Does someone have a hint on how to solve this?
Any help on this matter would be greatly appreciated!
I run into this problem all the time. I use one Developer Profile for all my dev work (and thus, one bundle identifier).
You have to delete the old App from the phone, and do a Clean Build.
These are similar problems. (1) (2)
As it seems working with an Ad Hoc build through iTunes does work.
Yesterday I double-clicked, but never got the iTunes message warning me of an older version existing in my apps and whether I want to replace it.
Dragging the .IPA into the iTunes app section did give me this message. Telling it to replace and next syncing works okay. iTunes sync status bar displays the message "YourAppName Updating". Afterwards launching it works fine with stored data intact.
The flow described here worked for me:
How to test an iPhone application update

How to make installer set up of Cocoa project?

I have make one application Cocoa using XCode. Now I want to make setup file of project. So other user can install this project directly in his system.
In short, the polite way is to build your app with the Release Configuration, put it into a Disk image with Disk Utility or zip it up, then put it on a server and have people download it.
If you want a longer and more detailed answer, read Apple's Software Distribution Guide.

Resources