Naming of Apple Launch Images & Other Images for iOS

Naming of Apple Launch Images, Icons and other images used in iOS  Original Link

Technical Q&A QA1686

App Icons on iPad and iPhone

Q:  How are the icon files in my application bundle used on iPad and iPhone?

A: Below are guidelines for handling icon files for iPhone-only apps, iPad-only apps, and universal apps.

If you don’t provide artwork for one of the listed optional icons, the system will automatically scale one of your existing icon images to an appropriate size. It is strongly recommended that your application include artwork for all the icons listed, at the specific sizes needed.

Prior to iOS 3.2, icon images were required to follow a strict naming convention. These legacy names are still listed in the tables below along with example names for the more recent icons. Except for iTunesArtwork, icon images included in your app can have arbitrary names.

Icons for iPhone-only Apps

iPhone-only applications use the following icons. Items marked with “Required” must be included.

Table 1  iPhone-only app icon requirements.
Image Size (px) File Name Used For App Store Ad Hoc
512×512 iTunesArtwork App list in iTunes Do not include Optional but recommended
1024×1024 iTunesArtwork@2x App list in iTunes on devices with retina display Do not include Optional but recommended
120×120 Icon-60@2x.png Home screen on iPhone/iPod Touch with retina display Required Required
180×180 Icon-60@3x.png Home screen on iPhone 6 Plus Optional but recommended Optional but recommended
76×76 Icon-76.png Home screen on iPad Optional but recommended Optional but recommended
152×152 Icon-76@2x.png Home screen on iPad with retina display Optional but recommended Optional but recommended
40×40 Icon-Small-40.png Spotlight Optional but recommended Optional but recommended
80×80 Icon-Small-40@2x.png Spotlight on devices with retina display Optional but recommended Optional but recommended
120×120 Icon-Small-40@3x.png Spotlight on iPhone 6 Plus Optional but recommended Optional but recommended
29×29 Icon-Small.png Settings Recommended if you have a Settings bundle, optional otherwise Recommended if you have a Settings bundle, optional otherwise
58×58 Icon-Small@2x.png Settings on devices with retina display Recommended if you have a Settings bundle, optional otherwise Recommended if you have a Settings bundle, optional otherwise
87×87 Icon-Small@3x.png Settings on iPhone 6 Plus Recommended if you have a Settings bundle, optional otherwise Recommended if you have a Settings bundle, optional otherwise

In addition to the above icons, iPhone-only applications with a deployment target of iOS 6.1 or earlier use the following icons. Items marked with “Required” must be included if the application’s deployment target is iOS 6.1 or earlier.

Table 2  iPhone-only app icon requirements (iOS 6.1 and earlier).
Image Size (px) File Name Used For App Store Ad Hoc
57×57 Icon.png Home screen on iPhone/iPod touch (iOS 6.1 and earlier) Required Required
114×114 Icon@2x.png Home screen on iPhone/iPod Touch with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended
72×72 Icon-72.png Home screen on iPad (iOS 6.1 and earlier) Optional but recommended Optional but recommended
144×144 Icon-72@2x.png Home screen on iPad with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended
29×29 Icon-Small.png Spotlight on iPhone/iPod Touch (iOS 6.1 and earlier) and Settings Recommended if you have a Settings bundle, otherwise optional but recommended Recommended if you have a Settings bundle, otherwise optional but recommended
58×58 Icon-Small@2x.png Spotlight on iPhone/iPod Touch with retina display (iOS 6.1 and earlier) and Settings on devices with retina display Recommended if you have a Settings bundle, otherwise optional but recommended Recommended if you have a Settings bundle, otherwise optional but recommended
50×50 Icon-Small-50.png Spotlight on iPad (iOS 6.1 and earlier) Optional but recommended Optional but recommended
100×100 Icon-Small-50@2x.png Spotlight on iPad with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended

You can include distinct images for the iPhone and iPad icons in categories where the required sizes are equivalent, for example, Settings.

Icons for iPad-only Apps

iPad-only applications use the following icons. Items marked with “Required” must be included.

Table 3  iPad-only app icon requirements.
Image Size (px) File Name Used For App Store Ad Hoc
512×512 iTunesArtwork Ad Hoc iTunes Do not include Optional but recommended
1024×1024 iTunesArtwork@2x Ad Hoc iTunes on devices with retina display Do not include Optional but recommended
76×76 Icon-76.png Home screen on iPad Required Required
152×152 Icon-76@2x.png Home screen on iPad with retina display Optional but recommended Optional but recommended
40×40 Icon-Small-40.png Spotlight on iPad Optional but recommended Optional but recommended
80×80 Icon-Small-40@2x.png Spotlight on iPad with retina display Optional but recommended Optional but recommended
29×29 Icon-Small.png Settings on iPad Recommended if you have a Settings bundle, otherwise optional but recommended Recommended if you have a Settings bundle, otherwise optional but recommended
58×58 Icon-Small@2x.png Settings on iPad with retina display Recommended if you have a Settings bundle, otherwise optional but recommended Recommended if you have a Settings bundle, otherwise optional but recommended

In addition to the above icons, iPad-only applications with a deployment target of iOS 6.1 or earlier use the following icons. Items marked with “Required” must be included if the application’s deployment target is iOS 6.1 or earlier.

Table 4  iPad-only app icon requirements (iOS 6.1 and earlier).
Image Size (px) File Name Used For App Store Ad Hoc
72×72 Icon-72.png Home screen on iPad (iOS 6.1 and earlier) Required Required
144×144 Icon-72@2x.png Home screen on iPad with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended
50×50 Icon-Small-50.png Spotlight on iPad (iOS 6.1 and earlier) Optional but recommended Optional but recommended
100×100 Icon-Small-50@2x.png Spotlight on iPad with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended

Icons for Universal Apps

Universal applications use the following icons. Items marked with “Required” must be included.

Table 5  Universal app icon requirements.
Image Size (px) File Name Used For App Store Ad Hoc
512×512 iTunesArtwork App list in iTunes Do not include Optional but recommended
1024×1024 iTunesArtwork@2x App list in iTunes for devices with retina display Do not include Optional but recommended
120×120 Icon-60@2x.png Home screen on iPhone/iPod Touch with retina display Required Required
180×180 Icon-60@3x.png Home screen on iPhone 6 Plus Optional but recommended Optional but recommended
76×76 Icon-76.png Home screen on iPad Required Required
152×152 Icon-76@2x.png Home screen on iPad with retina display Optional but recommended Optional but recommended
40×40 Icon-Small-40.png Spotlight Optional but recommended Optional but recommended
80×80 Icon-Small-40@2x.png Spotlight on devices with retina display Optional but recommended Optional but recommended
120×120 Icon-Small-40@3x.png Spotlight on iPhone 6 Plus Optional but recommended Optional but recommended
29×29 Icon-Small.png Settings Recommended if you have a Settings bundle, optional otherwise Recommended if you have a Settings bundle, optional otherwise
58×58 Icon-Small@2x.png Settings on devices with retina display Recommended if you have a Settings bundle, optional otherwise Recommended if you have a Settings bundle, optional otherwise
87×87 Icon-Small@2x.png Settings on iPhone 6 Plus Recommended if you have a Settings bundle, optional otherwise Recommended if you have a Settings bundle, optional otherwise

In addition to the above icons, universal applications with a deployment target of iOS 6.1 or earlier use the following icons. Items marked with “Required” must be included if the application’s deployment target is iOS 6.1 or earlier.

Table 6  Universal app icon requirements (iOS 6.1 and earlier).
Image Size (px) File Name Used For App Store Ad Hoc
57×57 Icon.png Home screen on iPhone/iPod touch (iOS 6.1 and earlier) Required Required
114×114 Icon@2x.png Home screen on iPhone/iPod Touch with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended
72×72 Icon-72.png Home screen on iPad (iOS 6.1 and earlier) Required Required
144×144 Icon-72@2x.png Home screen on iPad with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended
29×29 Icon-Small.png Spotlight on iPhone/iPod Touch (iOS 6.1 and earlier) and Settings Recommended if you have a Settings bundle, otherwise optional but recommended Recommended if you have a Settings bundle, otherwise optional but recommended
58×58 Icon-Small@2x.png Spotlight on iPhone/iPod Touch with retina display (iOS 6.1 and earlier) and Settings on devices with retina display Recommended if you have a Settings bundle, otherwise optional but recommended Recommended if you have a Settings bundle, otherwise optional but recommended
50×50 Icon-Small-50.png Spotlight on iPad (iOS 6.1 and earlier) Optional but recommended Optional but recommended
100×100 Icon-Small-50@2x.png Spotlight on iPad with retina display (iOS 6.1 and earlier) Optional but recommended Optional but recommended

You can include distinct images for the iPhone and iPad icons in categories where the required sizes are equivalent, for example, Settings.

Adding Icons to Your App

Asset catalogs are the preferred way to manage your application’s icons. New projects are configured to use asset catalogs by default. Migrating an App Icon Set or Launch Image Set in the Asset Catalog Help describes how to migrate an existing project to use asset catalogs. If your application must support iOS 4.3, or you prefer not to use asset catalogs, you can manually configure your application’s icons by editing the information property list for your application. See Configuring Icons Without an Asset Catalog.

Adding Icon Images to an Asset Catalog

  1. Select the asset catalog in the project navigator. It is named Images.xcassets by default.
  2. From the left column of the editor, select the icon set. For new or migrated projects it will be named ‘AppIcon’. You may need to create an icon set by clicking the (+) button in the bottom left of the editor and choosing ‘New App Icon’ from the context menu.
Figure 1  The AppIcon set selected in the asset catalog.

The set will only contain image wells for icons that are relevant depending upon your project’s configuration at the time the asset catalog was created. If an image well is missing, expand the settings inspector and check the appropriate boxes under the App Icon pane depending upon your project’s deployment target and supported devices.

Figure 2  Enable the necessary image wells under the App Icon pane of the settings inspector.
  1. Drag images from the Finder onto each image well to configure the associated icon.
Figure 3  Complete icon set for a universal app with a deployment target less than iOS 7.0

Asset catalogs create a copy of images added to them. If you had previously added the images as resources to your project you can safely remove them.

  1. Configure your app to use the new icon set.
    1. Select the name of the project in the project navigator.
    2. Select the name of your app from the list in the left column of the project editor.
    3. Select the General tab at the top of the project editor.
    4. Choose your icon set from the App Icons Source popup menu under the App Icons And Launch Images pane.
Figure 4  Configure the icon set for your app’s target.

Configuring Icons Without an Asset Catalog

  1. Follow the steps in the Xcode Project Navigator Help to add each icon image to your project as a resource.
  2. Locate your application’s information property list in the Xcode File Navigator. By default it will be named <ProductName>-Info.plist, where <ProductName> is the name of your application. Right click it and choose Open As > Source Code.
  3. The final step varies depending upon whether your app must support iOS 4.3.

If your application supports iOS 4.3 you must include the CFBundleIconFiles key to specify your application’s icon images. The value for this key is an array of strings, each identifying an image in the bundle. If you have included images for the iPad-specific icons, you may either list them under the CFBundleIconFiles key, or you can list them under the device specific CFBundleIconFiles~ipad key. iPad-only applications should list their icon images under the CFBundleIconFiles key.

Listing 1  Example configuration for a universal app with deployment target of iOS 4.3.

<key>CFBundleIconFiles</key>
<array>
    <string>Icon-Small</string>
    <string>Icon-Small-40</string>
    <string>Icon-Small-50</string>
    <string>Icon</string>
    <string>Icon-60</string>
    <string>Icon-72</string>
</array>
<key>CFBundleIconFiles~ipad</key>
<array>
    <string>Icon-Small</string>
    <string>Icon-Small-40</string>
    <string>Icon-Small-50</string>
    <string>Icon-72</string>
    <string>Icon-76</string>
</array>

If your application supports iOS 5.0 or above, you should include the CFBundleIcons key to specify your application’s icon images. The value for this key is a dictionary with two child keys: CFBundlePrimaryIcon and UINewsstandIcon. The UINewsstandIcon key is for newsstand apps and can otherwise be omitted. The value for the CFBundlePrimaryIcon key is a dictionary that identifies the icon images associated with the app bundle. It may contain two child keys: CFBundleIconFiles and UIPrerenderedIcon. The value for the UIPrerenderedIcon key is a boolean that specifies whether your icon files already incorporates a shine effect. The value for CFBundleIconFiles key is an array of strings, each identifying an image in the bundle.

Listing 2  Example configuration for a universal app with deployment target of iOS 5.0 or greater.

<key>CFBundleIcons</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string>Icon-Small</string>
            <string>Icon-Small-40</string>
            <string>Icon-Small-50</string>
            <string>Icon</string>
            <string>Icon-60</string>
            <string>Icon-72</string>
        </array>
    </dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string>Icon-Small</string>
            <string>Icon-Small-40</string>
            <string>Icon-Small-50</string>
            <string>Icon-72</string>
            <string>Icon-76</string>
        </array>
    </dict>
</dict>

Troubleshooting

This section describes common problems and how to fix them.

My application fails to validate

There are multiple icon-related problems that will result in your application failing validation by Xcode or iTunes Connect. The underlying issue depends upon the error.

Error: Invalid Image Path

Your application’s information property list references one or more icon images that were not included in the compiled bundle.

If your application is using asset catalogs to manage its icons then the information property list should not include any icon related keys; they will be added at build time by the asset catalog compiler.

  1. Open the information property list for your app’s target. It can be found under the Info tab in the project editor or in the File Navigator where it will be named either <ProductName>-Info.plist or Info.plist, where <ProductName> is the name of your app.
  2. Remove the following keys, including device specific variations.
    • “Icon file” (CFBundleIconFile)
    • “Icon files” (CFBundleIconFiles)
    • CFBundleIcons

If your application is not using asset catalogs to manage its icons, one or more of the images listed under the CFBundleIconFiles key or the CFBundleIcons key in the information property list is not associated as a resource of your application, may not have been added to your project, or may have been accidentally removed from your project. Verify that all the images named by either of these keys is included in your project then follow the resolution steps listed under My icons don’t appear on the device to verify that it is associated with your application.

Error: Missing required icon file

Your have not included artwork for one or more of the required icons, based on your app’s supported devices and deployment target.

Refer to the tables above for the list of required icons. Verify that each of your icon images matches the size listed in the table.

If your application is not using asset catalogs to manage its icons, verify that all of your icon images are listed under the CFBundleIconFiles key or the CFBundleIcons key as described in Configuring Icons Without an Asset Catalog. Remember that if you include filename extensions in the Information Property List, you must specify all image files (including the high-resolution variants) explicitly.

My icons don’t appear on the device

If your project is using asset catalogs, your application may not be configured to use the correct icon set.

  1. Select the name of the project in the project navigator.
  2. Select the name of a target from the list in the left column of the project editor.
  3. Select the General tab at the top of the project editor.
  4. Verify that the name of the app icon set is selected in the Source menu under the App Icons section, as shown in Figure 5.
Figure 5  The Source menu controls which icon set is used as the app icon set.

If your project is not using asset catalogs to manage its icons, one or more of your icon images may not be associated with your app’s target.

  1. Select each of your icon images in the project navigator.
  2. In the utility panel, check the box next to your app’s target under the Target Membership pane as shown in Figure 6.
Figure 6  Associating an icon with a build target

Verify that your icon images use a supported color model. Images that do not use the RGB color model may appear correctly in Xcode but will fail to load on the device. If your icons include transparent areas, use your preferred graphics editing software to fill these areas with a solid color.

Some graphics software may produce images which load correctly in Xcode but fail to load on the device, resulting in a blank icon. Try exporting your icon images with a different graphics editor such as the built in Preview app.

A previous version of my icon appears on the device

Your testing device or simulator may have a partially outdated build. That is, Xcode failed to copy a modified resource to the app bundle it installed on the device as part of the build & run process. To force Xcode to copy the most recent resources from your project directory:

  1. Remove the app from your testing device or simulator.
  2. Clean the build directory. Hold down the Option key and choose Product > Clean Build Folder, then Product > Build from the Xcode menu bar
  3. Build and run your app.

If your project is using asset catalogs then you must replace the modified image in the asset catalog. Asset catalogs do not track files on disk, opting instead to make a copy of the image at the time it is added to the asset catalog.

My icon has a black background in the App Store

The Large App Icon you uploaded to iTunes Connect includes transparent areas. The iTunes Connect Developer Guide lists the complete requirements for the Large App Icon, including that it must be opaque.

You can use the Preview app to check your image for transparent areas, which will appear dark grey as shown in Figure 7. Use your preferred graphics editing software to fill in the transparent areas with the desired background color.

Figure 7  Preview’s dark grey canvas background is visible through transparent areas in an image.

The wrong icon appears in the App Store

Your application bundle includes additional images which are being detected as valid icon images.

You may encounter this issue if your icon images deviate from the naming convention shown in the above tables. If your application bundle also contains once or more images that match the naming convention in the tables above, these images may be detected as valid icon images by the App Store. This may occur regardless of whether those images are included in the asset catalog or are referenced by the application’s Information Property List. The solution is to rename or remove the images.

You may encounter this issue when building an app using a third party development environment or if your project was created using a template project provided by a third party. Both will usually include a default set of icon images. If you fail to remove these images or replace all of them with your own artwork, the App Store may display them in the search results for your app. Like the iOS home screen, the icons displayed in the search results depend upon the current device. It is possible that the incorrect icon is shown in the search results on certain devices but not others.

The solution is to delete any instances of the template-provided icons that remain in your project and remove any references to the deleted files from the information property list. Due to the wide variety of ways in which iOS versions have allowed developers to specify app icons in the Information Property List, you may find it simpler and less error prone to remove all icon related keys from the Information Property List and then reconfigure your app’s icons using the steps presented in Adding Icons to Your App. See Start Over.

Start Over

If the none of the above solutions resolve the problem, follow the steps below to remove all the icons and icon related configuration from your app. Then follow the steps in Adding Icons to Your App to re-configure the proper icons for your app.

Remove the Icon Set From Your Asset Catalog

  1. Select the asset catalog in the project navigator. It is named Images.xcassets by default.
  2. In the left column of the editor, control click the icon set and choose Remove Selected Items from the context menu. By default the icon set will be named ‘AppIcon’.

Remove Icon Images From Your Project

Using the Xcode file navigator, remove any icon images from your project your had previously added to your project as resources. Icon images usually have a file name beginning with ‘Icon’ or ‘AppIcon’.

Remove Icon Related Keys From The Information Property List

  1. Open the Information Property List for your application. It can be found under the Info tab in the project editor or in the navigator where it will be named either YourApp-Info.plist or Info.plist.
  2. Remove the following keys, including device specific variations.
    • “Icon file” (CFBundleIconFile)
    • “Icon files” (CFBundleIconFiles)
    • CFBundleIcons

Clean The Project

To remove any cached icons, clean your target. Choose Product > Clean from the menu bar.

Finally, follow the steps in Adding Icons to Your App to re-configure the proper icons for your app.

Additional Resources

For additional information, see the App Icons section in the iOS App Programming Guide.

For information about designing your application’s icons, see the App Icon section of the iOS Human Interface Guidelines.

For an example project with properly configured icons, see the Application Icons and Launch Images for iOS sample code.


Document Revision History

Date Notes
2014-12-01 Added iPhone 6 Plus icons. Further expanded the troubleshooting section.
Added iPhone 6 Plus icons. Further expanded the troubleshooting section.
Added iPhone 6 Plus icons. Further expanded the troubleshooting section.
2014-05-19 Added troubleshooting steps for incorrect icons appearing in the App Store search results.
2014-02-03 Updated for Xcode 5 and iOS 7.
2013-07-18 Added icon information for iPad with retina display.
2011-07-14 After iOS 4.3, order doesn’t matter in the icon arrangement. Added links to related references.
2010-07-14 Fixed outdated “Add Icon files in Info.plist” section.
2010-07-12 Updated for iOS 4 requirements.
2010-04-09 New document that explains how the icon files in an application bundle are used on iPad and iPhone.
Feedback
Posted in iOS, OSX | Comments Off

How to run IRC – ngIRCd on your Yosemite/Mac/OSX computer

It’s pretty simple really as it turns out.

Download the code from Here This is a page that contains the OS X versions, installed with Homebrew, MacPorts and another I’m not familiar with. You could build it yourself, but why bother ?

Install it, and in the case of HomeBrew, the config file is in /usr/local/etc – it’s default location.

Just run it as the user you are logged in as, that’s fine. In my case “robert” – and test it with your favourite irc client. Colloquy is good. It’s in the app store, and runs on OS X and on iOS, so you can check your irc while out and about.

you might want to also add the path to the binary to your bash_profile – /usr/local/sbin in the case of home-brew

If you want it to  start automatically on your OSX box, put this plist file in your local LaunchAgents folder

/Users//Library/LaunchAgents

I called it org.irc.plist – no mistakes there then. Now when you start your Mac, assuming you are the main user, it will automatically start irc.

My irc server is at ‘irc.shanghaitimes.uk’ and my usual channel is #Authors. See you there?


zeus:LaunchAgents robert$ cat org.irc.plist

---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.irc.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/ngircd</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
----------------------------

zeus:LaunchAgents robert$ pwd
/Users/robert/Library/LaunchAgents
zeus:LaunchAgents robert$

To manually start it, if you haven’t already, do this.
launchctl load Library/LaunchAgents/org.irc.plist

Don’t forget to allow the port 6667 through your router if you have to do port forwarding.

Posted in OSX | Comments Off

Live video streaming on Weather Display software

I have to write this down so I remember it.

On the Weather Display software, WD, I can not only now record a snapshot of the outside with my WebCam, with the webcamcapture.exe program that is part of WD, I can stream alive stream that can be read fairly easily with most video players that understand the mms:// type stream.

On the Mac Mini I have, I installed Flip4Mac 3.3.3.1, costing £3.99 and entered the address – and it worked. Amazing.

Small picture just like I want, and it sits there on my screen, very minimum bandwidth.

The setup in WD is east, has it’s own section. So set up capturing of your static j[g image for the website and underground etc, then select the next Tab, for Network Streaming, and forget the ASF stuff, unless of course you want it, just enable

. direct network streaming and save it. Click on the View able just next to that item, and wait a moment. If you have RealPlayer, or maybe even Windows Media Player installed it will pop up. you can then exit that. BUT give it time to load the stream. About half a minute it took first time…

Of course you will have to let it through your firewall and router. I used the Openmeetings port 5080, which I no longer use.

 

Posted in Weather | Comments Off

The Great Mac Clone and Restore Saga

Well, not really. Just sounds interesting…

I’ve used both Superduper! and Carbon Copy Clone recently. Both excellent programs. The Carbon Copy Clone looks a little less ‘geeky’ than SuperDuper!, but maybe that’s just me.

Both make first class backup and cloning packages. SuperDuper! though might have a couple of little tricks that make it slightly less – reliable? More on that later.

Carbon Copy Clone allows you to also make a clone – on the same backup disk, of the RecoveryPartition from your Mac.

When restoring from a clone – first things first. This next bit is copied from another site. But it’s as simple as.

Restore Your Mac Using A Cloned Backup

NOTE: Article on cloning.

  1. Boot from your Cloned backup. Usually the easiest way to do this is restart and hold down the Option key and then choose your cloned backup from the Startup Manager.
  2. Go to your cloned backup > Applications > Utilities > Disk Utility.
  3. Erase the disk/volume/partition that you wish to restore your clone to.
  4. Clone your backup to the original disk.

 

Why did I have to begin this exploration? My almost new Mac Mini is showing I/O errors on the disk. Usually these are sector/block errors, and SMART technology will move them out of the way – BUT – only when you write to disk. Reading does not change them. If you have LOTS of i/o errors, easy to clone -> erase -> restore.

But it takes ages and ages …. so beware.

 

Posted in OSX | Comments Off

Another year done here… Hello 2015

The year’s end. Writing, programming, drinking red wine, and going on a diet finally… well maybe the last one can wait a bit.

The Arduino weather station is running great guns. Connected to the Weather Display software, it runs on the Laptop 24/7, reporting to WeatherUnderground and various others, like the UK Met office, and one in Germany. As well as a little app I have on my iPhone I wrote called – iWS. You’ll find it on the Apple App store. Here.

StoreArt 1024x2

This little app relies on you being able to connect to your Weather Display station clientraw.txt file via it’s URL, and display it in a meaningful summary.

Nifty for a quick look at what the weather is doing at your station recorder site, where ever you are in the world.

 

Posted in Default Category | Comments Off

Bluetooth Chinese/Apple keyboard power supply.

I’ve discovered that if I rig in a 3.3 volt doc power pack to my Apple lookalike keyboard, in place of the batteries, then it doesn’t go to sleep on me all the time.

I use the Bluetooth keyboard to write on my iPad mini all the time, sitting at the dining table. It was driving me nuts with it going to sleep all the time, the keyboard that is, and as the batteries run down it gets worse and worse.

So, I took the batteries out and wired in a 3.3v doc power supply, just replacing the batteries with two short bamboo sticks with the wires at each end. Just temporarily. But it works, and best of all, the keyboard no longer goes to sleep.

It’s great for using it with my iPad, and probably other stuff too, especially in that situation.

The next step is to actually put a proper little power socket in the edge of the keyboard, so I can hook it up easily just be pluging in the power supply.

Keyboard. £20. Battery pack £5. Socket for keyboard edge, 50p about, and a bit of wire to solder it all together, and presto, a non sleeping Bluetooth keyboard.

 

Posted in Default Category | Comments Off

Making Shell Scripts Start at Login or System Startup

Making Shell Scripts Start at Login or System Startup

Now that you know how to write shell scripts and run them as commands, making them start when you log in to your account, or making them start when the system starts, is straightforward.

You’re already familiar with the Login preferences settings, and your ability to customize what programs start when you log in from it. An executable shell script is just another program as far as Unix is concerned, so you can configure scripts to start on login from there. If you’re going to be working from the command line with any frequency, you might want to consider adding a single shell script to your login preferences, and using that script to execute other scripts as necessary.

To add a shell script as an item that starts at system startup is also quite simple. Create a subdirectory for the script you want to run in the /System/Library/StartupItems/ folder, and place the script or a link to the script in the directory, giving it the same name as the directory. When the system starts, the script will execute. Remember that it’s not going to have a terminal attached, so if it does things such as echo data, the data will have nowhere to appear. In Chapter 20, “Command-Line Configuration and Administration,” we’ll cover the contents of the plist (properties list) file that you can add to the directory with your script to customize some of its behavior.

Posted in OSX | Comments Off

Testing PHP mail

How to test out php mail, especially if you are having issues on OS X.

Use THIS link

 

Watch out especially for gmail and others, as they will arbitrarily dump your messages.

Sending to a Gmail address, produced this.

 

 


This is the mail system at host localhost.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                  The mail system

<racuk12@gmail.com>: host gmail-smtp-in.l.google.com[64.233.166.27] said:
   550-5.7.1 [5.70.82.197      12] Our system has detected that this message
   is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to
   Gmail, 550-5.7.1 this message has been blocked. Please visit 550-5.7.1
   http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550
   5.7.1 more information. gh3si1572871wib.2 - gsmtp (in reply to end of DATA
   command)
Reporting-MTA: dns; localhost
X-Postfix-Queue-ID: CE2FDB89C03
X-Postfix-Sender: rfc822; robert@localhost.localhost
Arrival-Date: Tue,  4 Nov 2014 15:35:43 +0000 (GMT)

Final-Recipient: rfc822; racuk12@gmail.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.1 [5.70.82.197      12] Our system has detected
that this message is 550-5.7.1 likely unsolicited mail. To
reduce the
amount of spam sent to Gmail, 550-5.7.1 this message has been blocked.
Please visit 550-5.7.1
http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550
5.7.1 more information. gh3si1572871wib.2 - gsmtp

To: racuk12@gmail.com
Subject: the subject
From: racuk12@gmail.com
Reply-To: webmaster@chalmers.com.au
Date: 4 November 2014 15:35:43 GMT


hello

However, sending to an address on my own server, robert@chalmers.com.au, using the local mail server here, it went through fine.

Posted in OSX | Comments Off

How to Setup Postfix for Mac OSX and WordPress PHP Mail

How to Setup Postfix for Mac OSX and WordPress PHP Mail

I have been running a self hosted website off of my own computer for awhile now and wanted to use the Fast Secure Contact Form Plugin for WordPress. The problem was while the Apache web server was up and running along with PHP and MySQL to handle the back end for WordPress, there was no Mail Server for FS Contact Form to make use of.

Sendmail and Postfix are installed by default on a Mac OSX distribution although disabled by Apple. There are a variety of setup examples on the net; some useful, some not so. It took some tinkering, more than it should have in fact, so hopefully this process that I went through will help someone else.

Postfix will require some setup and one of the better instructions for doing that comes from Brett Hutley’s Blog. So armed with that I fired up the Terminal and went about editing ‘/etc/postfix/main.cf‘.

sudo nano /etc/postfix/main.cf

I use nano or pico (same thing) on occasion and am comfortable with them, but if you prefer emacs or vi go for it, but I mostly use the command line tool for TextWrangler named ‘edit‘. If you download and install TextWrangler.app (free and excellent text & code Editor with syntax coloring for the Mac) and install the command line tools with it, then ‘sudo edit filename‘ will open the file in TextWrangler so you can do your edits there. Way Cool.

I then put all of the following including comments for future reference at the End of /etc/postfix/main.cf:

######
# sudo nano /etc/postfix/smtp_sasl_passwords
# add ‘smtp.gmail.com:587 your.name@gmail.com:your.password’
# save and run ‘sudo postmap /etc/postfix/smtp_sasl_passwords’
# start postfix with ‘sudo postfix start’ 

# Minimum Postfix-specific configurations
relayhost = smtp.gmail.com:587

# Enable SASL authentication in the Postfix SMTP client.
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_passwords
smtp_sasl_security_options =

smtp_sasl_local_domain = diverge.blogdns.com
broken_sasl_auth_clients = yes
smtpd_pw_server_security_options = noanonymous

# Enable Transport Layer Security (TLS), i.e. SSL.
smtp_use_tls = yes
smtp_tls_security_level = encrypt
tls_random_source = dev:/dev/urandom

So far so good, and after following Brett’s instructions for generating the sasl_passwd and setting permissions, I launched PostFix:

sudo postfix start

… and the Console.app mail.log was filled with missing directories in the /private/var/spool directory. I tried creating these as they appeared and then permission errors were encountered. Attempts to set owner and groups got a little farther, but no joy, until after more research I discovered the following:

sudo postfix upgrade-configuration
sudo postfix set-permissions

Well, well. All necessary directories in place and properly configured and a test gave expected results.

telnet localhost 25

This showed access, but then the connection was dropped as my ISP blocks port 25 for SMTP.

date | mail -s ‘test email’ my@email.addy

This worked as expected and it was forwarded to my GMail account as the instructions in /etc/postfix/main.cf had dictated.

The next thing was to make this permanent between reboots and we need to:

sudo cp /System/Library/LaunchDaemons/org.postfix.master.plist /Library/LaunchDaemons/org.postfix.master.plist
cd /Library/LaunchDaemons/

We copy the file out of the System folder as we really shouldn’t be editing anything in the System Folder as System Updates can and will overwrite them.

Next we ‘sudo edit /Library/LaunchDaemons/org.postfix.master.plist‘ and add the following just before the closing ‘/dict‘ tag:

<key>RunAtLoad</key>
<false />
<key>KeepAlive</key>
<false />

I don’t require Postfix to be running all the time; only when the Contact Form on my website is used so I chose these options. You can of course change either to ‘true’ depending upon your requirements. We can then start this up by either rebooting or using ‘launchd‘ with:

sudo launchctl
launchd% load org.postfix.master.plist
launchd% quit

Back to WordPress and the FS Contact Form plugin. Test emails with that on my site were now giving errors and after more research the specific error was ‘Could not instantiate mail function’ and the Mail.log in Console.app was complaining about needing a -t switch for email Recipients or else Recipients must be issued from the command line. FS Contact form was passing information to sendmail correctly it seemed, and command line use was out of the question so more digging revealed PHP ‘mail’ needed one final change to ‘sudo edit /usr/local/php5/lib/php.ini‘.

Edit the php.ini file and search for ‘sendmail_path‘. Change the line that is there by adding the -t switch so that the final line looks like this:

sendmail_path = /usr/sbin/sendmail -t

Save the changes and now we need to restart the web server with:

sudo apachectl restart

And FINALLY … a test mail sent with the FS Contact Form plugin within WordPress running off of my web site hit gold!

Posted in Default Category | Comments Off

Upgrade to PHP 5.6 or 5.5 on Mac OSX 10.10 Yosemite

Too easy. Follow the links and so on found here.

Upgrade on Yosemite

Just substitute 5.6 in place of the 5.5 or 5.4 they mention.

Then also adjust your .profile, or .bash_profile to reflect the new path.

Of course – the next release of OSX 10.10 may just wipe out all your hard work … but hey, easy to fix again.

Posted in OSX | Comments Off