From the Doc, it mentioned the package needs to include two .icns files, one for Retina, another one for non-Retina, but it didn't explain what will be the Filenames for these two .icns files, I checked other apps, it seems they include one .icns file only, so what should I do?
http://docwiki.embarcadero.com/RADStudio/XE3/en/Mac_OS_X_Application_Development#Icons_for_Your_OS_X_Apps
Related
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.
Yes, my problem really is that simple. How the heck do I get my app to use the icon file or asset catalog?!
System info:
Xcode 6.1.1 (6A2008a)
app target OS X 10.10
OS X 10.10.1 (14B25)
This is my first OS X app but I have several years' experience developing iOS apps.
Steps to reproduce:
open Xcode, start an entirely new cocoa application project
not sure this matters, but i specified my new project not to use storyboards or core data
drag a .png file from my local directory into the project structure, and make sure (a) it ends up in the build target and (b) the file copies into the project's directory
drag the png into the Images.xcassets catalog under any/all of the sizes classes for AppIcon.
build and run
Expected: app in dock and tab-switcher has the new icon.
Actual: app in dock and tab-switcher has the default "blank page with instruments A on it"
Ok, maybe that's a DEBUG thing.
archive the project, show in finder
Expected: app in Finder has correct icon
Actual: nope. It should be noted however that Xcode's Organizer shows the correct icon, and there does exist a file Contents/Resources/AppIcon.icns. Contents/Info.plist specifies that the Icon File is "AppIcon".
grrr. Let's try without the asset catalog.
in the target's General settings, under App Icon, select "don't use asset catalogs"
delete Images.xcassets
In Info.plist, in the line for Icon File (CFBundleIconFile), specify the icon's name (in my case "AppIcon"). The documentation clearly states that
The system looks for the icon file in the main resources directory of the bundle.
File extension is not required here.
build & run. also archive, to save time later.
Expected: app icon in dock and tab-switcher is correct.
Actual: nope
Expected: archived app has correct icon.
Actual: nope, but the archived product did have the correct png file in Contents/Resources.
What am I missing?!
I've tried this with .png app icons and a regular .icns file (generated by Xcode via an asset catalog). I've tried excluding and including the file extension in the Info.plist. Why is this so difficult?
Edit: Clean, Clean Build Folder and deleting the Derived Data folder did not help.
So I found the answer through the help of a commenter: I had to fill all of the xcassets/icns slots with images of the exact dimensions.
I think I'm literally on the last step before submitting a new Mac app, and I've been banging my head against a wall for the past few hours on what I think should be really, really easy.
I've designed document icons for the two different types of icons my app creates and works with. I created a new "Icon" in Images.xcassets, and dropped the appropriate files into the drop zones.
In the product editor -> Info, I go to where the document type information is, but when I try to enter in the icon name in the "icon" field of either the Document Types or Exported UTI section, the icon image just turns into a question mark—no options show up in the drop down menus for icons.
How do I get the images/icons in the asset catalog to show up in the editor? Alternatively, if I was going to enter that manually into the plist, what sort of format would I use to reference an Icon file from the asset catalog?
I know I'm probably missing an easy step here, but I can't see it!
To my knowledge, Xcode doesn't currently support using .xcassets for document icons. This is a little strange—the .xcassets editor clearly allows you to create new icons, but it doesn't generate .icns files, it just puts all the files in the same folder and uses a plist to manage them.
To create an icon for your document types, upload the 1024x1024 version of the icon to http://iconverticons.com/online/ to convert it to a .icns file. Alternatively, you could use a third-party tool to generate an .icns file with different images for different resolutions. There used to be a great tool included in the Developer Tools for doing this, but I can't seem to find it anymore.
Once you've got an icns file, add it to your project and you should be able to select it as the "Icon" for your Document Type or External/Internal UTI. Enjoy!
To be honest, it might be worth filing a bug about this. Xcode's development seems so strongly driven by iOS these days, they may not have noticed this yet!
I did it in the most easy way:
Add "New OS X Icon" to images.xcassets and name it "DocIcon", for instance.
Drag and drop images of your document icon
Just type "DocIcon" to icon name of your document
You will see question mark as document icon thumbnail. Don't care about. All will work fine after build and launch of application.
This is what worked for me, using Xcode 10 in 2019 (none of the other answers worked in my case):
Select asset catalog in Project Navigator
Right click on the left pane (list of assets) and choose App Icons & Launch Images ▶︎ New macOS Generic Icon (second option from bottom). Name it "Document". This will create a folder named "Document.iconset" in the asset catalog directory.
Populate all entries with your custom images. They must all be of the appropriate size (e.g., "16 x 16 #2x" must be 32 x 32 pixels, otherwise you will get yellow a warning icon over the image slot).
Navigate to the asset catalog folder, and use the command: iconutil -c icns Document.iconset (must match the name of the icon created in step #2). I took this command from Apple's documentation here (which by the way, also says some BS about Xcode "automatically creating an .icns file from your .iconset folder on build". Sure...).
Copy the newly created Document.icns file as a resource to your project.
Select the target, open the Info pane, and in both Document Types and Exported UTIs set your .icns file as the icon for the file type.
Hej, allesamme,
I had the same problem and have been researching it for days. I found a family of four solutions, the first three of which did not work for me: 1. using a .png file as the document type icon file; 2. using a manually created .icns file as the document type icon file; 3. the above solution, and 4. what I will describe here. Only the last one worked for me.
I tried following the spirit of the above advice and found that it didn't work, at least for my MacOS app. I'm on OS X 10.9.2 (13C64) running Xcode Version 5.1 (5B130a).
The current wisdom seems to be to create a directory in your workspace with a lower-case name and .iconset extension, in which one puts files with an icon_ prefix and the usual suffixes (16x16.png, 16x16#2x.png, 32x32.png, etc.)
In Product Editor's Info pane you can go into Document Types and associate the .iconset file with the Icon field. The icon image happily displays something reasonable. The build process builds a .icns file from that spec and copies it into your app.
I had an intermittent problem that the .icns file wouldn't build, which I traced to mistakenly haven included a 64x64 icon in the list. That's a no-no.
The current Apple dogma on this issue can be found in the official documentation, which covers some details I glossed over here. I didn't need to edit the Info.plist file directly: everything seemed to work from the interfaces provided in Xcode.
I have no idea which solutions work in which contexts, but thought I'd add throw more alternative on the fire for people to try out. — Jim Coplien
I want to build a Mac App from scratch. I manually created the required folders of main app, Contents, MacOS, Resources, and dropped the binaries. The only one I don't know how to create from scratch is "Info.plist". So, I just copied one from the installed Applications on my machine, removed all the unfamiliar keys, except the Executable and Package type (as APP).
Then I did a test. Before I copied and editted the Info.plist file, I double-clicked the app icon in Finder. Not working, which is expected. After I copied and editted the Info.plist file, it is working, which is also expected. Next is what I don't understand. I removed the Info.plist file, and double-clicked the app icon in Finder, it is STILL working!
My question is:
Did the first time running migrate the Info.plist information to some secret place in the app bundle?
Is copying and editing an existing Info.plist file from other applications a good practice for building an app from scratch?
I know the post is old but think to answer,so that users will get benefitted as they come across this.You asked two questions:-
1)See the first run has a build and its derived data might help you to run without Info.plist(for particular case although i didn't think so it run).
But you can't run app without info.plist.
2)No.the answer is copying and editing an existing info.plist from other application is not a good practice.
Every app and plug-in uses an Info.plist file to store configuration data in a place where the system can easily access it. OS X and iOS use Info.plist files to determine what icon to display for a bundle, what document types an app supports, and many other behaviors that have an impact outside the bundle itself.
For better knowledge about this you can see this link:-
https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Introduction/Introduction.html
I think the user who asked this already got these things,Hope this will help other Users.
Thanks.
I would like to use cocosbuilder and cocos2d-x to develop my game for old and new iPhones. I would like to create one file for two resolutions. I created one ccb file and then I published it to retina and normal resolution. Everything works great but now I have two png files with the same name:
Published-iOS/resources-iphone/star.png
Published-iOS/resources-iphonehd/star.png
There is an issue. I am using Xcode and it doesn't like 2 files with the same name in the project. I can add these files to projects in separated groups but in final application bundle there could be only one star.png file. It is selected randomly. When I launch my app on iphone 4s I have picture from old iphone display. How to use cocosbuilder for multiple resolutions ?
You should import the resources-iphone, and resources-iphonehd directories in your XCode project as folder references instead of groups. You can do that by drag and dropping the folders onto your XCode project. When you do that you will see the directories appearing in your applications bundle. You can check that by selecting your application's target and going to Build Phases->Copy Bundle Resources.
After that, on you ApplicationDelegate.cpp file you should add those folders in the search paths list of CCFileUtils.
std::vector<std::string> resDirOrders;
if (resolution is iphone)
{
resDirOrders.push_back("resources-iphone");
}
else if (resolution is iphone retina)
{
resDirOrders.push_back("resources-iphonehd");
resDirOrders.push_back("resources-iphone");
}
CCFileUtils::sharedFileUtils()->setSearchResolutionsOrder(resDirOrders);
This is the recommended way of handling multiple resolutions according to the cocos2d-x devs (check out this article). You can use the window size from the CCDirector to determine the current resolution. In the iphonehd case I'm including the non-retina folders as well as a fallback.
Xcode and iOS app bundles aren't organized in folders, but rather flat bundles. You'll need to rename your files for it to work. I suggest something like this:
// iOS Standard
Published-iOS/resources-iphonehd/star#2x.png
or this
// cocos-2d Standard
Published-iOS/resources-iphonehd/star-hd.png