Category: Mac

can't set locale
March 11th, 2018 by ronny

Can’t set locale; make sure $LC_* and $LANG are correct! This suddenly appeared on all my servers one day after some updates. All of them were running Debian. And I thought at first there was some bad packages or settings in some of the new updates. Little did I know the problem wasn’t related to Debian or my server at all. But my Laptop. I had also updated MacOS the same day.

Can’t set locale; make sure $LC_* and $LANG are correct!

If you get Can’t set locale; make sure $LC_* and $LANG are correct, is it only when using a particular program. Or is it when you SSH in from another computer? If you get it from SSH, try to see if you get the same error when using terminal locally. If it only appears when using SSH, you probably have the same issue I had. At least it is something with the SSH client.

To fix your SSH client, assuming you are running MacOS, you need to edit the /etc/ssh/ssh_config file. That is where the problem is. If you have an older OS X like Mountain Lion, you will find the file at /etc/ssh_config. What you need to do is remove or comment out this line: SendEnv LANG LC_*

can't set locale

By removing the SendEnv LANG LC_* you stop your client from sending invalid locale information to your server, or computer you SSH into.

Another type of error that can be caused by invalid locale, is various Python script errors. If you ever got this error “UnicodeEncodeError: ‘ascii’ codec can’t encode character …”. You should also try to remove the SendEnv LANG LC_* from ssh_config. Other users have reported that to be the solution to this issue.

Please also read SSH slow login on Debian based systems

Posted in Linux, Mac Tagged with:

Xcode 9 iOS icon sizes
December 17th, 2017 by ronny

Xcode 9 iOS icon sizes overview

Xcode 9 iOS icon sizes overview. They keep adding more and more icon sizes. Xcode 9 has the most icon sizes so far. No wonder since it is the version supporting the most iOS versions and iOS devices. Every iPhone since iPhone 5 and a bunch of iPads and iPods is supported. Many of the different devices have their own screen resolution and screen size. That requires a lot of different resolutions for their icons. Below is a complete list of all the different icon sizes you need to upload your app to App Store. Yes, you need them all.

I used to make an icon at 1024×1024 pixels, and just edit the resolution for all the different sizes in Photoshop. That is quite tedious work. If you cant be bothered to do that your self, jump to the end of this article where there is a short-cut.

Remember this

If you look at the icon form in Xcode where you put all the icons, there are some sizes listed. First time I created an app, I thought that was the size of the icons. It is the size, but not in pixels. They call it points. So if you see 29pt and under the icon, it says 2x. That means 29×2 pixels which should be 58×58 pixels. Here we go with the Xcode 9 iOS icon sizes.

Xcode 9 iOS icon sizes

xcode 9 ios icon sizes

iPhone Notification iOS 7-11
20pt – 2x – 40×40
20pt – 3x – 60×60

iPhone Spotlight iOS 5,6 & Settings iOS 5-11
29pt – 2x – 58×58
29pt – 3x – 87×87

iPhone Spotlight iOS 7-11
40pt – 2x – 80×80
40pt – 3x – 120×120

iPhone App iOS 7-11
60pt – 2x – 120×120
60pt – 3x – 180×180

iPad Notification iOS 7-11
20pt – 1x – 20×20
20pt – 2x – 40×40

iPad Settings iOS 5-11
29pt – 1x – 29×29
29pt – 2x – 58×58

iPad Spotlight iOS 7-11
40pt – 1x – 40×40
40pt – 2x – 80×80

iPad App iOS 7-11
76pt – 1x – 76×76
76pt – 2x – 152×152

iPad Pro App iOS 9-11
83,5pt – 2x – 167×167

App Store iOS
1024pt – 1x – 1024×1024

Shortcut

That’s all the icons sizes you need to publish your app in the App Store. As I promised at the beginning of the articles, here is a shortcut to your app icons sizes. You create one icon at 1536×1536 pixels and head over to MakeAppIcon. There you upload your one icon, the site process the icon and sends you an email with a link to download all the correct sizes you need. Saves you a ton of time. They even sell a MacOS app to create the icons for you. For me, the site does a good enough job.

You might find something interesting on my YouTube channel as well.

Check this if you are looking for the Xcode 8 icons.

Enjoy and happy app publishing!

Posted in Mac, Programming, Xcode Tagged with: , ,

how to uninstall unity
October 24th, 2017 by ronny

How to uninstall Unity on Mac

This is how to uninstall Unity on Mac.

Follow these simple steps and delete the following folders or files.

1. /Applications/Unity (Delete this folder)

2. ~/Library/Application Support/Unity (Delete this folder)

3. ~/Library/Caches/com.unity3d.* (Delete all files starting with com.unity3d)

4. ~/Library/Logs/Unity (Delete this folder)

5. ~/Library/Preferences/Unity (Delete this folder)

6. ~/Library/Preferences/com.unity3d.* (Delete all those files)

7. ~/Library/Preferences/com.OverTheEdge.BugReporter.plist (Delete this file)

8. ~/Library/Preferences/dk.Otee.* (Delete these files if you got them)

9. ~/Library/Unity (Delete this folder)

10. /Library/Application Support/PACE Anti-Piracy (Delete this folder)

11. /Library/Application Support/Unity (This contains the license file, so you might want to keep it)

PS! Note the difference between ~/Library and /Library. ~/Library is the library folder found in your home folder. /Library is found on the root of the hard drive.

Thats is how to uninstall Unity on Mac. So now you can install something else or re-install Unity.

Also read: Game engines list – 50+ engines

Happy uninstalling!

Posted in Mac, Unity Tagged with: , ,

Xcode 9 uiimage image not shown
September 30th, 2017 by ronny

Xcode 9 uiimage image not shown

Working on some ios apps created with Xcode 8 and your images don’t show after upgrading to Xcode 9? Took me awhile to find out why. Maybe you see this message in the console: “Could not load the image referenced from a nib in the bundle with identifier”.

Xcode 9 uiimage image not shown because Xcode 9 wants you to keep all your image files inside the Assets.xcassets file. Uiimage will let you select image files outside the Assets, but will make the uiimage control to not show at all.

If Xcode 9 uiimage image not shown move your images inside the Assets file, select the image again in the uiimage properties and give it another go. That worked for me.

Also, read Swift Change UIButton text

 

Happy coding!

Posted in Swift, Xcode Tagged with: ,

how to find minecraft on mac
April 6th, 2017 by ronny

How to find minecraft on mac

How to find minecraft on mac is quite easy. There is two places you need to look. The Minecraft game itself is located in the Application folder. By default called minecraft.app. The full path to the Application folder is /Application. It means it is in the root folder of your hard drive. This is just the executable. Not much you can do with that on. Unless you want to delete it.

How to find minecraft on mac if you are looking for your saved games, resource pack or skins. You need to look in the Application Support folder. So how to get to it?

 

How to find minecraft on mac containing saved maps and settings

Open your Finder window and go to your home folder. Look for a folder inside your home folder called Library. Can´t see it? No worries. While in your Finder click View on the menu. Almost at the bottom you will see Show View Options. And tick / select Show Library Folder. Now your Library folder should show. Go into the Library folder. Then go into Application Support. Inside Application Support you will find a folder called Minecraft. There you should find all the relevant Minecraft folders containing your maps and other stuff you need to modify your Minecraft.

minecraft folder

If you are looking for Minecraft maps to try out, go to Minecraft Maps.

If you are looking for resource packs, go to resourcepack.net.

Need help installing a Minecraft server for Debian? Go to this previous article http://soltveit.org/minecraft-server-debian-variants/

 

Posted in Mac, Minecraft Tagged with: ,

April 3rd, 2017 by ronny

Xcode 8 iOS icon sizes overview

Xcode 8 iOS icon sizes overview. There are even more icon sizes since Xcode 7. And it can be an extra challenging with all those different resolutions. Current Xcode (version 8), supports all iPhones since 4s, most iPods, and most iPads. You will need quite a few different icons sizes. That’s what I will list up here. A complete list of all different sizes for the different icons needed for an iOS application used today.

If you are looking for the Xcode 7 overview, please go to Xcode 7 iOS Icon sizes overview

If you are looking for the Xcode 9 overview, please go to Xcode 9 iOS Icon sizes overview

Xcode 8 iOS icon sizes overview – 17 icons

Xcode 8 iOS icon sizes

Just remember….

If you look at the picture above, you will see something like 29pt under the iPhone spotlight icon. First time I believed that was the icons size. And it is. But not in pixels. Above you see two empty icon windows saying 2x and 3x. That means 29 x 2 for the first window (58×58 pixels) and 29 x 3 for the second icon (87×87 pixels). Just multiply the pt value with x value, and you have the size in pixels. I usually create the largest icon (1024×1024 and uses photoshop (or any other image editing software) to make the smaller resolutions out of the biggest one.

Anyway, below you will find the list for the latest Xcode from when this article was written.

Icon Size list

Xcode 8 iOS icon sizes

iPhone Notification iOS 7-10
20pt – 2x – 40×40
20pt – 3x – 60×60

iPhone Spotlight iOS 5,6 & Settings iOS 5-10
29pt – 2x – 58×58
29pt – 3x – 87×87

iPhone Spotlight iOS 7-10
40pt – 2x – 80×80
40pt – 3x – 120×120

iPhone App iOS 7-10
60pt – 2x – 120×120
60pt – 3x – 180×180

iPad Notification iOS 7-10
20pt – 1x – 20×20
20pt – 2x – 40×40

iPad Settings iOS 5-10
29pt – 1x – 29×29
29pt – 2x – 58×58

iPad Spotlight iOS 7-10
40pt – 1x – 40×40
40pt – 2x – 80×80

iPad App iOS 7-10
76pt – 1x – 76×76
76pt – 2x – 152×152

iPad Pro App iOS 9-10
83,5pt – 2x – 167×167

iTunes Connect
App Icon – 1024×1024

Thats it about iOS icon sizes.

To read more about the subject, check out Apples Xcode documentation.
Or maybe check out my youtube channel.

Happy iconising!

Posted in Mac, Programming, Xcode Tagged with: , ,

Swift Capitalize
April 2nd, 2017 by ronny

Swift Capitalize, How to

Swift Capitalize is done with a string instance property. Check the example below to see how to use it. There is also a link at bottom to Apples Swift documentation.
let str = “first, second, third”
print(str.capitalized)

This will output: First, Second, Third

Swift Capitalize

It will capitalize every word in this string. Lets remove the commas and see what happens.

Change str = “first second third”

The output now will be: First Second Third

Check Apple Swift Capitalizion documentation for more information about the string instance property.

Swift Capitalizion
Produce a string with the first character from each word changed to the corresponding uppercase value.

Posted in Swift, Xcode Tagged with: ,

Record text to speech mac
March 19th, 2017 by ronny

Record text to speech mac

Record text to speech mac is an easy thing to do. All the software you need is included with your mac. You can also change between several voices and languages. If you need something else than American english you might need to download updates. That is easily done within your system preferences.

Record text to speech mac – How to

Record text to speech mac using only TextEdit and iTunes.

– Open TextEdit and write in the text you want to save as speech in an m4a file.

– Select all the text within TextEdit and right click (or double-tap).

– Add to iTunes as Spoken Track.

record text to speech mac

Next window click continue and the audio file will be added to iTunes.

record text to speech mac

You can now change to your iTunes window, it should already be open. And at the top you should see your new speech file. Right click it (or double-tap) and select show in finder. There is your new text to speech file saved as an m4a (mp4 or mpeg 4 audio). Most modern software where you can use audio files, can use m4a files. If not there is a ton of converters out there.

That is how you record text to speech mac.

This method uses the speech settings from your system preferences. If you need to change speech rate or anything. Go to System preferences -> Accessibility -> Speech

You can also watch the video below to see a demo on how it is done.

Thats it, happy speaking

Posted in Mac, OS X Tagged with: , ,

didMove never get called
March 11th, 2017 by ronny

didMove never get called in Xcode?

didMove never get called when creating a new project with Xcode using the Game template. I selected Swift and SpriteKit. I found this issue when I was following a course on Udemy.com, and I couldn’t get a simple project to run like in the course videos. Creating a new project after deleting the one I was working on, after trying to debug the error, gave me the same result. didMove never get called. I did only one change to the project created with game template. That was to put in print(“didMove did run”). But it never was.

The only way I would get the didMove to run was calling the scene like this in the GameViewController.
let scene = MainMenuScene(size: CGSize(width: 1536, height: 2048))

Tried to google, and I found this one post on Stack Overflow with the same issue. He said it was caused by a period in his project name. Crazy, but I did use a – in my project name. Was only a test project, so calling it physics-test was not a good idea. I renamed it to PhysicsTest, and the didMove was called.

Not sure if it is a language setting issue or anything. I’m using english language and Norwegian region settings on my computer. Not sure if that got anything to do with it, but in the tutorial video I was following it worked great using – in the project name.

Anyway, if you experience didMove never get called in Xcode, it might be worth removing any non letter and number characters.

Happy coding!

Posted in Swift, Xcode Tagged with: , ,

screenflick
November 27th, 2016 by ronny

Screenflick record gameplay or screen on a mac. You could also be using the preinstalled QuickTime software. It is great for recording the screen. If you want to record the sound as well, thats where it starts to get tricky. QuickTime doesn’t have an option for that out of the box. You need to install Soundflower to be able to record the sound from any game or other application you want the sound from.

An easier approach to the whole process is to buy Screenflick from Araelium. You can download a trial version to play with first. The only difference between the licensed version and trial version is that the trial version put a watermark on your video. However any recordings done with the trial version will have the watermark removed when you buy the full version.

Screenflick also helps you with installing the Soundflower, and use the correct settings to record any sounds. It also helps you with using the webcam if you want to put any recording of your self into your gameplay videos. All from a easy to understand control panel.

The price of Screenflick is only $29, and worth every penny if you are into screen or gameplay recording on a mac. And no I’m not affiliated to Araelium in any way. Doesn’t get a penny from them no matter what. Here is where you can download Screenflick.

Posted in Mac, OS X Tagged with: , ,

Optimization WordPress Plugins & Solutions by W3 EDGE