Senlern
Reprint please specify, original link: http://blog.csdn.net/zhang429350061/article/details/37959489
In the previous article I shared the example of setting up project under Win32 configuration environment. Don't look at the children's shoes please read this article first: http://blog.csdn.net/zhang429350061/article/details/37958275
-----------------------------------------Download the JDK configuration environment variable---------------------------------
Download URL:http://www.oracle.com/technetwork/java/javase/downloads/index.html
The system environment variables need to be configured after a successful installation:
New variable: CLASSPATH values are: .
New variable:java_home value: The actual installation path of the JDK
new additions in Path %java_home%\bin; ( Note the last semicolon )
------------------------------Download the NDK configuration environment variable---------------------------
: http://developer.android.com/tools/sdk/ndk/index.html
After the download is complete, it is a compressed package. Decompression is possible.
New variable: The Ndk_root value is: You can go inside the extracted path.
---------------------------start the command-line compilation Androidproject------------------------
First, in CMD, first CD to your project's E:\MyGame\proj.android, and then execute the build_native.py script directly
We see the following output of the Select NDK toolchain version was 4.8! That's great!
The next step is a lengthy compilation process.
Then there will be output such as the following:
After compiling it, it looks like this:
Congratulations! Done
--------------------------------------Project to import Eclipse and run on your Android phone---------------------------------------
We use an integrated ADT directly, with the SDK for Eclipse and Android. :http://developer.android.com/sdk/index.html
After downloading the extract, we open the Eclipse directory Eclipse.exe to start eclipse.
Click File->new->project after booting:
Then select Android Project from Existing Code:
Then select your project's proj.android folder in root directory and click Finish
Wait, is not project name there is a red fork, seemingly there is a mistake, how to do?? Haha, do this:
Right-click Item project and select Import:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvemhhbmc0mjkzntawnje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">
Then select the displayed selections:
Then Select the following path in Root directory (for your own path setting):
Note: The following project only selects the first one to be able, the other is not selected, you can first select Deselect all in the button on the right side, and then select the first one individually. and finish.
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvemhhbmc0mjkzntawnje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">
Is not a mistake, it is so wonderful
Now we are able to run on our own Android phone. Right-click on project to select for example:
Then you will be prompted to select a phone box, double-click on it:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvemhhbmc0mjkzntawnje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">
At this point we can see the output below the console:
Is your game now running on your phone???!!
。
Finally, let's give you a little knowledge, assuming you want to just view the debug output of cocos2d-x in Logcat, you can click on this green plus sign:
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvemhhbmc0mjkzntawnje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/center ">
Then set this:
And then there's Jiangzi:
Ok! Is it so much easier to view the debug information.
----------------------------------------Notes------------------------------------
Limited capacity. Welcome to the Exchange. I would appreciate it if I could correct you. ( Everyone help to the top )
Android cross-compilation "Cocos2d-x 3.0" game development