Archive recovery in xcode? - xcode

I recently used a system tool which removes 'junk' files to free space up. It deleted every single photo on my hard drive... My xcode code is present for an application I have but can I recover the lost app photos from an xcode archive which still exists? Many thanks, as I can't update my app anymore because of it.

If you can get the ipa that is a zip file, change the extension from .ipa to .zip and double-click to unzip.
That will produce a folder named Payload and in that folder is the app.
The app is a is a package, right click on it and "Show Package Contents".
All your images in the app will be there.
Additionally, if the images were added as Assets there will be an additional step to extract the images form the Assets.car file. See this SO Answer for extraction information.

Related

XCode project missing files on other Mac

I have multiple Xcode Projects in my Dropbox so I can use them on my iMac and MacBook. But when I open the projects on another Mac most of the imported Images, Videos etc... are red (missing). the files are all in the Project Root Folder. What can I do?
This error is because when you added the files (images, documents, etc) you did not tick copy if needed option.
That means if you deag/drop items from your desktop to the project, Xcode will reference the documents from your desktop. When opening the project on another computer, the Xcode is not finding your documents in the desktop of the other computer, thus the error.
Solution:
1- Delete all the red marked items (take note of them)
2- move them again to the project and make sure to check copy items if needed checkbox.
3- re upload the project to wherever you need and it will run.
Happy coding!

How to create a hosted content package without Xcode?

I was wondering if there is any other way to create a hosted content package for an in-app purchase without using X-Code.
We could use a terminal to do so, and we even don't need to create an in-app purchase using Xcode. Here are the steps.
1- Create a folder, let's call it "zzz"
2- Add your .plist file similar to the .plist file which the in-app purchase project created from Xcode would have generated, make sure to update the version and the product identifier fields.
3- Create a contents folder inside of it, and in the contents folder place your in-app purchase contents.
4- Open your terminal and write
productbuild --content "zzz" "zzz/nameOfPackage.pkg"
so basically after --content you write the full path of your folder, then the full path of where you want you package to be and the name of package.
I used this answer as reference Converting a xcodeproj in-app purchase to a pkg file from terminal (Bash) or how to convert a xcarchive file to a pkg file?
if you're referring to having a content bundle (i.e. a .zip file) with contents pertaining to your app, then yes.
I refer to the App Store Review Guidelines here from Apple themselves: (https://developer.apple.com/app-store/review/guidelines/)
IN terms of functionality, if the bundle downloads code in any way or form, your app will be rejected (Apple guidelines 2.7).
That's the main one that's mentions. Other than that, there's the general guidelines mentioned as per their website...

How to transfer published resources from CocoStudio to Xcode?

using CocoStudio 2.0.6 and Xcode 6.1.1 on MAC inside VMware. After publishing in CocoStudio I open Xcode and "Add Files to myProject" with the "Copy items if needed" option checked. Then I have the folder myProject/res created by CocoStudio inside the myProject/Resources folder used by Xcode. Using CSLoader in HelloWorldScene.cpp works fine and I see the scene in the simulator. Runs ok also in Eclipse on Android emulator.
If I go back to CocoStudio and make changes like adding a sprite to the scene then I need to repeat the whole process of publishing, delete them Resources/res folder in Xcode and add it again. It is faster to delete the whole folder instead of adding new files into it and delete the ones not used any more.
My question is: am I doing it the right way or is it there a better way for Xcode to automatically see modifications to the resources made by CocoStudio?
Like when I use Eclipse and build the project, the resources in the myProject/proj.android/assets folder are automatically updated with the resources from the myProject/Resources folder.
Thank you.
You can make a resources folder in iOS app a symbolic link to the main Resources folder.
Remove the proj.ios_mac/Resources folder. Then go to your main app folder and execute:
ln -s ../Resources proj.ios_mac/Resources

Where to store custom icons in Xcode 4?

I am creating my own icons for buttons. I did some snooping around, and it looks like application icons usually go under:
ApplicationName/Contents/Resources/some.png
What do I do to recreate my own structure like this for icons? I don't see any "Content/Resources" in Project navigator.
Xcode will move the icons to the Resources folder in your app package automatically during a build.
Just add the icon files to your Xcode project and it will detect that they are image resource files and add them to the Copy Bundle Resources build phase for you. Any files that are included in the Copy Bundle Resources build phase will be copied to the Resources folder in the built app's bundle.
It doesn't matter which group you put the images into in the Xcode files list because the file group organisation is ignored in the built product, so feel free to put them where you like. I often create a Media group with subgroups such as Images and Audio but it's completely up to you.

How can I check which files are part of the archive when uploading an app to appstore?

always when uploading an app I wonder which files are actually part of the archive that is being uploaded, since I have many supportive files in my xCode project folder which are not really part of the code but just some documents.
Will they be part of the archive and visible to the installers later or are only those files included in the archive that are referenced in xCode?
Thanks
all the files will be in archive (.app file) and you can see its content by right click on it and select "show package content"

Resources