I'm continually frustrated by the simulator saving all my screenshots (from command+s in the simulator) to my Desktop, just flooding it after a few weeks. Can I have it save them somewhere else?
I know I could just use Grab.app or cmd+shift+4, but it the simulator crops out the top bar, shadows, etc. which is nice, so I'd like to keep it.
Xcode 8.x & earlier:
No. It is always saved on the desktop. There is no option to change that.
Xcode 9.x:
Select File, Save Screenshot while holding down the Option key. We will prompt you for the location to save the screenshot. Check the box to make this location the default for all screenshots going forward.
I have a website that allows users to view PDF documents. In mobile safari in iOS 8 I am having issues with landscape oriented PDF's being squeezed to fit the window. This pdf should have a landscape orientation (it looks like the browser is forcing it into portrait). The user is being directly linked to the pdf file they wish to view aka: http://whatever.com/anygivenpdf.pdf
Here is a screenshot of the issue in the IOS simulator (Iphone 5, IOS 8.1). I do not have this issue in IOS 7. Any thoughts on a fix or where the issue is originating from? I'm thinking it's either way the PDF's are saved or something must be fixed for the browser itself.
I regard this primarily as a Safari bug in iOS 8.
However, I have found a way to modify a PDF document to avoid this problem. My method works only on a Mac:
Open the existing PDF doc by the Preview app.
Select "Export as PDF..." from the File menu.
In the pop-up box where you select the new file name, click first on the button "Show details" in the lower left corner.
Select the icon for landscape orientation!
Give the document a new filename.
Click Save.
(I run a Swedish version of Mac OS X, so I am not 100% sure that I have used exactly the correct terms used in the menus of the English version, but I think you will find your way based on my description.)
Credits to these posts, putting me on the right track:
https://discussions.apple.com/thread/6540211
and
http://www.appligent.com/my-pdf-document-is-rotated-how-do-i-fix-that/
In the second one, you will find a specific description on how to fix the problem using Acrobat Distiller, if you happens to have that application installed. That should be a way forward if you run Windows, I believe.
How do I set the images so that I can archive and validate my app? The screen looks like this now:
So the first one says 29pt, but then it also says 2x. So do I put a 29x29 image or a 58x58 image? And where do I put all of the other ones? (I know that there are more sizes than 29, 40, and 60).
Anyway, what I tried was I dragged a 29x29 png onto the first slot, a 40x40 onto the second, and a 60x60 onto the third and fourth. When I went to Product->Archive, I get
/Users/kendon/Documents/iPhone Apps/Sales Tool/Sales Tool/Images.xcassets: The app icon set named "AppIcon" did not have any applicable content.
I recently found this App called Icon Set Creator in the App Store which is free, without ads, updated on new changes, straight forward and works just fine for every possible icon size in OSX, iOS and WatchOS:
In Icon Set Creator:
Drag your image into the view
Choose your target platform
Export the Icon Set folder
In XCode:
Navigate to the Assets.xcassets Folder
Delete the pre existing AppIcon
Right click -> Import your created Icon-Set as AppIcon and you're done
Update: Unless you love resizing icons one by one, check out Schmoudi's answer. It's just a lot easier.
Icon sizes
Above image from Designing for iOS 9. They are the same for iOS 10.
How to Set the App Icon
Click Assets.xcassets in the Project navigator and then choose AppIcon.
This will give you an empty app icon set.
Now just drag the right sized image (in .png format) from Finder onto every blank in the app set. The app icon should be all set up now.
How to create the right sized images
The image at the very top tells the pixels sizes for for each point size that is required in iOS 9. However, even if I don't get this answer updated for future versions of iOS, you can still figure out the correct pixel sizes using the method below.
Look at how many points (pt) each blank on the empty image set is. If the image is 1x then the pixels are the same as the points. For 2x double the points and 3x triple the points. So, for example, in the first blank above (29pt 2x) you would need a 58x58 pixel image.
You can start with a 1024x1024 pixel image and then downsize it to the correct sizes. You can do it yourself or there are also websites and scripts for getting the right sizes. Do a search for "ios app icon generator" or something similar.
I don't think the names matter as long as you get the dimensions right, but the general naming convention is as follows:
Icon-29.png // 29x29 pixels
Icon-29#2x.png // 58x58 pixels
Icon-29#3x.png // 87x87 pixels
Launch Image
Although you can use an image for the launch screen, consider using a launch screen storyboard file. This will conveniently resize for every size and orientation. Check out this SO answer or the following documentation for help with this.
Useful documentation
App Icon
Launch Screen
The Xcode images in this post were created with Xcode 7.
To save a bit time:
1) You can mark your app icon images all in finder and drag them into your Assets catalog all at once by dragging into one of the empty slots of the app icon imageset. When you hold your drag over the slot, several of the other slots look selected and when you drop those all will be filled up at once. Note that this works in XCode 8 (I haven't tried XCode 7), but in XCode 9 beta not yet.
2) The "Technical Q&A QA1686" apple documentation site has the sizes per app icon slot already calculated for you in a nice image and also contains the correct image names conventions.
I've tried most of the above and a few others and have found https://appicon.co to be the easiest, fastest, and provides the most comprehensive set.
Drag your image onto the screen
Click Generate
Open the file just downloaded to your Downloads folder
Here, you may be able to drag this entire folder into Xcode. If not:
Double-click the Assets.xcassets folder
Select all files
Drag them to Assets.xcassets
Rename it to AppIcon
The correct sizes are as following:
1)58x58
2)80x80
3)120x120
4)180x180
I use a tool called Prepo to produce all the right image sizes. You simply feed the app you image file and it will spit out each necessary file with an appropriate name.
Once you do this, you can then drag in the appropriate files or simply point to your Prepo exported folder.
Now a days is really easy to set app-icon, just go to
https://makeappicon.com/ add your image, they will send you all size of App-icon (Also for watch & itunes as well), now Click Assets.xcassets in the Project navigator and then choose AppIcon. Now you just have to drag n drop the icon as required.
I found App called Iconizer. You can find repository on github. Iconizer can generate app icons for OS X, iPad, iPhone, CarPlay and Apple Watch with just one image.
Simply Drag and Drop your icon onto Iconizer, select the platforms you need and whether or not you want all platforms generated into one asset catalog, then hit export.
After that just replace (delete and import) your AppIcon in the Assets.xcassets
In the left list, right click on "AppIcon" and click on "Open in finder"
A folder with name "AppIcon.appiconset" will open.
Paste all the graphics with required resolution there.
Once done, all those images will be visible in this same screen(one in your screen shot). then drag them to appropriate box.
App icons have been added.
Same process for Launch images.
Launch images through this process are added for iOS 7 and below.
For iOS 8 separate LaunchScreen.xib file is made by default.
I quite like this app made by Jordi Bruin called Bakery
It allows emoji and SFSymbols for quick prototyping (not for the App Store in this case!)
It is as easy as drag and drop your design to the app and then again drag and drop to the asset catalog without having to fill in all the sizes by hand.
This is a very frustrating part of XCode. Like many, I wasted hours on this when I switched to a newer version of xcode (version 8). The solution for me was to open the properties for my project and under the "App Icons and Launch Images" choose the "migrate" option for the icons. This made absolutely no sense to me as I already had all my icons there, but it worked! Unfortunately I now seem to have two copies of my launcher icons in the project though.
As per updated version(Xcode 8.3.3) I saw that below resolution are required for all fields of AppIcon sets.
40x40
58x58
60x60
80x80
87x87
120x120
180x180
It comes with hdpi, xhdpi, xxhdpi etc.
Hope it will helps others.
Edited to 120x120
You can easily do it without resizing yourself or doing anything, just choose your icon at an app store icon generator website
https://getappscreenshots.com/app-icon-generator and it'll generate all required files and all icon sizes so you can just copy the files and paste in your project's folder!
You can get away with just adding a single image of size 1024*1024px.
Just add the image in like so
and select single size in the menu to the right.
Does anyone know why this happens? My project uses a local network, so it doesn't make sense to test it on just one device, so I want to install it on 20. The way I do this is I build it once and then load it onto each device using the organizer. However, about every 3 or 4 transfers, the icon fails to transfer with it, and instead I am left with a white icon only on the home screen. If I launch it, and then check the multitask bar, the icon is there (and it is shown faded out on the home screen while the multitask bar is active). If I transfer the app again, the icon comes just fine. The devices are all 32 GB iPad 2.
The dimensions of the icon are correct (72x72 RGB24), and the name of the icon is correct (Icon-72.png). I noticed that there are two entries in my info plist: Icon files and Icon files (iOS 5). My deployment target is 5.0, so should I erase the first one? This program is big and takes a long time to transfer and install so I dislike loading it twice. What can I do?
The App icons (retina and normal) need to be placed on the root of your application.
To fix the problem I found that the best is to start the process from scratch:
remove the icons from your project
clean the build
delete Derived Data (Organizer->Projects) *
remove the icons from the app info plist file (Icon files and Icon files iOS5).
drag the icons into the Summary App Icon section
Build
* I do not know if this step is needed but I do it anyway while troubleshooting.
In newer versions of Xcode it doesn't seem to be happening. So I will chalk it up to a quirk in Xcode.
When I load my iPhone app it always loads a black screen first then pops up the main window. This happens even with a simple empty app with a single window loaded.
I've noticed that when loading, most apps zoom in on the main window (or scale it to fit the screen, however you want to think about it) and then load the content of the screen, with no black screen (see the Contacts app for an example).
How do I achieve this effect?
Add a Default.png to your project. This should be the image you want shown instead of the black launch screen.
Also just to save you some time, there is no way to change this image during the runtime of your application. If you look at Apple's Clock application you can see how depending on the last state of the application, the Default.png changes. You cannot do this in your own app because of permission limits. Also, make sure to read the iPhone HIG for best practices on Default.png use, in short, dont use it as a splash screen like Twitteriffic.
You can also take a screenshot of your app as an aid to creating the Default.png - while holding the Home button, press and release the Lock Sleep/Wake button. The screenshot can be find in your Camery Roll library in the Photos app and can be synced back to your desktop.
When the app transitions from the launch image to the actual app content, it should not be jarring to a user - content (text/images) can be added to the screen, but content should never change. If all this leaves you with is an empty blue header, a white body, and a blue footer - then that's all you should have. If you have a persistent tab bar on the bottom & a localized app (different text descriptions), then then launch image should appear with icons but no text. (See Clock.app & Facebook.app for examples.)
Screenshots can also be taken in XCode using the Screenshot tab in the Organizer window and a plugged-in device.