Unity notes

Unity + Git

I use source-tree to setup my .gitignore file. A bit crude but seems to work. Right click on a file to start ignoring similar files. Right click on a directory to start ignoring its content.

Ignore...
  • all *.sln (created by mono-develop)
  • all *.userprefs
  • all *.csproj
  • the Library folder
Cross-references

[PENDING]

Building

If you run into serious issues trying to run Unity apps on a given device, take patience and learn how to run native apps. If you can't run a native app a fortiori you can't run a Unity app.

Testing on iOS

To clarify a couple of points, plugging an iOS device into your windows PC will not work, you need a Mac; additionally, you need a developer license. You can buy this from Apple.

Currently, Unity apps run on iOS except that you have to start them manually from inside XCode.

Testing on Android

Coming from an iOS background I unsurprisingly had a harder time building on Android.

Downloading and installing the JDK

Follow information here and there. Do not attempt installing 'everything' as it will take forever and consume over 32GB on your hard drive. Also, have a read at the Unity docs.

(Unlike what the Google pages say) you don't need to run the install tool via terminal; right click and open will do it.

Installing requires a JRE. I find that the Oracle install doesn't work for this purpose. Instead, I use a (deprecated?) JRE install provided by Apple.

Do not confuse the JDK (java development kit) and the JRE (Java runtime environment, used to run java applications).

Finding java home

While finding java home may be plagued by a number of issues, the most common problem is that it isn't clear exactly which folder is the 'java home'.

So, which one is it? Well, after installing the JDK (from Oracle) open terminal and type  /usr/libexec/java_home will return a path and that is the java home. Copy-paste or navigate to the path.

Running on device

  • Enable dev mode. On your device Settings > About Phone and tap the build number 7-8 times. Yes, it's voodoo and it works.
  • Next under Settings > Applications > Development select Enable USB debugging
  • You should be good to Build and Run
  • If your device is still not recognised, try swapping the cable (really). When your device is recognised you will see an on-device notice asking to permission your computer and okay that, a few seconds later your app will be up and running.

No comments:

Post a Comment