Someone who never ported Unity game to mobile (iOS / Android) can tell that it’s pretty easy. If you think so, you are very wrong. When running i.e. WebPlayer version of your game it allows you throwing exceptions that are not caught and sometimes the game runs without any crash, only in the log file you can read note about it. Mobile version is less forgiving. Unhandled exception will crash your app.
Reading iOS crash logs helps a lot while debugging, but if they are still mystery for you, you can read great article about them here: Demystifying iOS Application Crash Logs. The problem is, that sometimes Unity creates crash on your iOS device that will not tell you much:
... 6 mygame 0x002328f4 ___lldb_unnamed_function7016$$mygame + 268 7 mygame 0x0122597c ___lldb_unnamed_function93440$$mygame + 200 8 mygame 0x01964224 ___lldb_unnamed_function136404$$mygame + 2152 9 mygame 0x01a06274 ___lldb_unnamed_function138276$$mygame + 132 10 mygame 0x015a08cc MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethod*, MonoObject*, MonoException**) (MonoUtility.h:452) 11 mygame 0x015a0918 MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethod*, MonoObject*) (MonoBehaviour.cpp:975) ...
It will tell you nothing because of ___lldb_unnamed_function (sometimes there is only memory address if automatic symbolication went totally crazy). Instead of this unnamed function you would like to see name of your method in your C# scripts. The problem is wrong calculation of method address by default Xcode symbolication tool (more details about these calculations you can find here). To ease you life I created a script that will symbolicate crash log for you. All you need is the archive from which you created your binary, name of the application and crash log itself.
Usage is as follows:
symbolicate_crash.sh <archive> <app_name> <crash_log> [<output_file>]
I’m working with git in termial only. Git command line client is fast, reliable and have all the features in comparison with any gui git client.
On the other hand, it’s nice to have some colors to quick distinguish between different type of information, i.e. when looking at git log. Following git log command nicely outputs history of commits with most important informations together with branch information:
git log --pretty=format:'%C(yellow)%h%Cred%d%Creset - %C(cyan)%an %Creset: %s %Cgreen(%cr)'
Following one prints commit history as colored graph:
git log --pretty=oneline --decorate --graph
You can either alias these commands in bash or any other shell you use or alias as git commands in .gitconfig file in [alias] section.
I like to work in text console and I’m usually using bash and git for my projects. When I have to switch between branches couple of times during the day and made changes I have to be careful which brach I have currently checked out. It can be done quickly by just typing “git branch”, but I don’t like to type it every time I need to do something.
One of the solution is displaying current git branch in bash prompt. My fouvrite one is as follows:
PS1='\[\e[32m\]\w `git branch 2>/dev/null | grep -e '\''^*'\'' | sed -E '\''s/^\* (.+)$/(\1) /'\''`\n\$\[\e[0m\] '
The interesting part is between “`” marks. This command lists all git branches, greps only the current one (with asterisk) and creates string with sed.
This prompt will not print anything about git branches if you are currently in the folder not handled by git repository. Normally above prompt will look like this:
If I will modify my prompt in the future, you can find the latest version here.