Some notes about porting an iPhone game to Android using Unity3d

Yesterday I commenced porting Gluddle to the Android platform. Some notes and remarks for those who are interested below the line.

Android on OSX

The installation of the Android development kit on OSX basically brought back good old DOS memories. All this shouldn’t be necessary on a PC according to the manual, but on OSX your friend is the terminal app. Follow all the steps described in the Android Installation Guide.

Installing the API in the Android installation tool failed on my computer with an error like:
“Failed to fetch URL

The solution for me was to check force http://.. sources to be fetched using http:// in the options of the Android installation tool.

Emulator (AVD – Android Virtual Device)

I spent a lot of time trying to make the emulator run my Unity3d game package. The created AVDs did not install correctly and this had to do with the permissions of the Users folder. When I finally got the .apk file to install on the virtual device, the game closed almost immediately (“Unfortunately, Gluddle has stopped”). When I plugged in a Samsung Galaxy, the game worked perfect from the start. The AVD-software doesn’t seem to be particularly fond of Unity-games. Get an Android device instead and you’ll be fine.

Some more notes: 

  • fix the install_failed_container_error: select force internal memory instead of external memory or auto in the Unity player settings.
  • The debugging command is: ./adb logcat -s Unity
  • To be more specific: ./adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG
  • Install a package on the connected device: ./adb install gluddle.apk (Unity3d does this for you if the device is connected and you execute build & run).

To be continued.