How to test Unity app for Android platform in Emulator in Android Studio

(This was actual for unity version 5.5.1f1 and lower)

The steps below are only for the case when you are sure that you want to test your Unity application for Android platform directly in Android Studio in Emulator. For this:

  1. You need to export your application in Unity for Android platform – File/Build Settings… If you do not check “Export project” checkbox you will have “Build” button instead of “Export”.export
  2. Click “Export”.
  3. Start Android Studio. Make sure that you already have everything set up – Android SDK and JAVA_HOME variable.
  4. In Android Studio choose “Open an existing Android Studio project” then navigate to the just exported project folder.
  5. Shift+10 or Run, choose Emulator (you can also choose your Device).

In most cases you would not need to test your application like this. You will just work in Unity, “Build” the app for Android platform in Build Settings window and then test created *.apk file on any Android device clicking “Play” in Unity Editor. . For this you will need to have Unity Remote app installed on the Android device.

Setting up Unity Remote to test on the device from Unity:

  1. Download Unity Remote app in Play Store for Android device
  2. Connect your device to PC using USB cable
  3. In Unity go to Edit->Project Settings-> Editor and select Any device.
  4. Restart Unity so it will pick up Unity Remote.
  5. Click “Play” in Unity.

Installing Ant in Flex Builder 3

I was trying to install Ant in Flex Builder 3 using steps described here.

But after step ‘Click “Install all” to install Java Development Tools’ I got such errors:

Unable to complete action for feature “Eclipse Platform” due to errors.
Unable to complete action for feature “Eclipse RCP” due to errors.
Unable to create file “/C:/Program Files/Adobe/Flex Builder 3/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.3.R33x_v20080118\META-INF/eclipse.inf”. [C:\Program Files\Adobe\Flex Builder 3\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.3.R33x_v20080118\META-INF\eclipse.inf (Access denied)]

If you have Windows Vista then you can fix the problem this way:

1. Close FlexBuilder

2. Run FlexBuilder as administrator.

3. Repeat Ant installation steps again.