The overall process is divided into the following 6 steps:
1, installation Java_jdk
2. Configuring Java Environment variables
3. Update the Android SDK
4. Release the apk file from Unity3d
5. Create an Android virtual machine and run it
6. Install the APK file into the Android virtual machine
(for the convenience of novice, in the following for each step of the specific operation and problems may be encountered in detail to mention)
1, installation Java_jdk
Official website (www.java.com), free, I installed the name of the file is Jdk-7u10-windows-i586.exe, the version has new and old, you download to the version number may be different from me, not in the way;
2. Configuring Java Environment variables
Right-click My computer → properties → advanced system settings → advanced → environment variables, tap the New button in the system variable below
Input variable name Java_home
The input variable value is the installation path of JAVA_JDK in the previous step, and mine is C:\Program Files (x86) \java\jdk1.7.0_10
Click OK;
Create a new variable named Classpath, and the value of the variable is as follows:
.; %java_home%\lib\tools.jar;%java_home%\lib\dt.jar;%java_home%\bin
(Don't drop the front point) here is the relative path, so you can copy my, click OK;
Find an existing system variable path, edit its value, do not change the original content, add at the end
; C:\Program Files (x86) \java\jdk1.7.0_10\bin
(Note that this comes with your java_jdk, and I write the content to be the same)
At this point, the Java environment variable configuration is finished;
3. Update the Android SDK
Run SDK Manager.exein the SDK folder of Android and update your desired Android version as needed;
4. Release the apk file from Unity3d
Before build, make the necessary settings in Player settings, the following are required:
Company in Com.Company.ProductName in ①Bundle identifier* must be changed to another name
②Install location is set to automatic, otherwise it will fail to run in the Android virtual machine, prompting "unfortunately,*** has stopped." Such as
The Android version in ③Minimum API level must be below or equal to the Android version in the Android virtual machine you are creating
Then build on it, the first build, you will be prompted to choose the path of the Android SDK, note to the SDK level (my is "E:\Tools\Android\adt-bundle-windows-x86\sdk ”);
5. Create an Android virtual machine and run it
Run the AVD Manager.exein the SDK folder of Android and click New ... button to create a virtual machine, a variety of options to fill, relatively simple, a little to note, be sure to hit the emulation options in the use of the Host GPU tick, or to install the APK file in the virtual machine will be an error, the hint "failure Install_ Failed_container_error";
After creating the virtual machine, be sure to run the virtual machine before installing the APK file;
6. Install the APK file into the Android virtual machine
Move the published apk file to the platform-tools folder in the Android SDK path and open the CMD console, first to the Platform-tools path in the SDK path of Android, and the command is "CD + Specific path ", My is" CD E:\Tools\Android\adt-bundle-windows-x86\sdk\platform-tools ", then enter;
After entering, enter the ADB install +apk file name, enter and so on, if the installation is successful, will prompt success, such as
Then, find your apk in the virtual machine and play it. (Attached to my own below)