Quick-cocos2dx LUA debugging under Eclipse

quick-cocos2dx in Lua debugging under eclipse

Original December 18, 2013 11:56:18
    < li style="margin-left:30px;list-style:none;line-height:28px;">840< /li>

Configuring the compilation environment Basic steps:

  1. Install Visual Studio 2012
  2. Install Java SDK
  3. Install the latest Android ADT bundle and Android NDK
  4. Download quick-cocos2d-x source code
  5. Set environment variables
  6. Compile quick-x-player proj.win32 project
  7. Set the lua compilation environment of eclipse.
  8. Create a new project and test it on the real Android device li>
  9. xplayer+eclipse debugging lua

Step 1: Install Visual Studio 2012

Download Visual from http://www.microsoft.com/visualstudio/ Studio 2012 and install it.

Supported versions:

  • Visual Studio 2012
  • Visual Studio Express 2012 for Windows Desktop

Note: must use Windows Vista/7/ 8 Operating system.

Step 2: Install Java SDK

h2>

From http ://www.oracle.com/technetwork/java/javase/downloads/ Download the latest version of Java SDK (JDK, 32bit version is recommended), and Install it.

Step 3: Install the latest Android ADT bundle and Android NDK

  1. Download the latest ADT Bundle for Windows from http://developer.android.com/sdk/ (Recommend the 32bit version, or the version that matches the JDK).
  2. Unzip adt-bundle-windows-x86-2013????.zip.
  3. Rename the directory adt-bundle-windows-x86-2013???? renamed android.
  4. Rename the directory android\sdk to android\android-sdk- windows.
  5. Download from http://developer.android.com/tools/sdk/ndk/index.html Android NDK r?< /li>
  6. Unzip android-ndk-r?-windows-x86.zip
  7. Change the directoryandroid-ndk-r? Move to android\android-ndk-r?

    Final directory structure:

    \android\android-ndk-r?\android\android-sdk-windows\android\eclipse< /pre>

  8. Run android\android-sdk- windows\tools\android.bat, select Android SDK 2.2 (If you don’t To Android SDK 2.2, please set the proxy), and then install the required packages.

Step 4: Download quick-cocos2d-x source code

Download develop The quick version, quick-cocos2d-x-develop.zip, this version of the player adds the auto connect debugger function , Easy to debug lua.

Method 1: The fastest way to obtain the source code is through the download page on the quick-cocos2d-x official website. All stable versions and their download links are listed here.

Due to the Android SDK and NDK issues, there are certain requirements for the placement of the quick-cocos2d-x directory:

  1. must be in the same partition as Android SDK/NDK
  2. Cannot be placed in the root directory
  3. Chinese and spaces cannot be included in the path (So ​​don’t put the desktop)

Method 2: Use git The tool clones the quick-cocos2d-x repository. Start the Terminal application and run the command:

$ git clone git://github.com/ dualface/quick-cocos2d-x.git Cloning into 'quick-cocos2d-x'...

If access to github.com is too slow , You can use the domestic mirror warehouse, web page: https://code.csdn.net/liaoyulei01/quick-cocos2d-x

Step 5: Set environment variables

Open System Properties- > Advanced->Environmental variables:

Add the following environment variables (note the modificationFor the actual path where your quick-cocos2d-x source code is located):

ANDROID_NDK_ROOT=<PATH_TO>\android -ndk-r8eANDROID_SDK_ROOT=<PATH_TO>\android-sdk-windowsQUICK_COCOS2DX_ROOT=<PATH_TO>\quick-cocos2d-xCOCOS2DX_ROOT=%QUICK_COCOS2DX_ROOT%\lib\cocos2d-xANDROID_HOME=%ANDROID_SDK_ROOT%PATH=%QUICK_COCOS2DX_ROOT%\bin \win32

If the PATH variable already exists, add ;%QUICK_COCOS2DX_ROOT%\bin\win32 at the end of the PATH variable.

Step 6: Compile the quick-x-player proj.win32 project

Start Visual Studio 2012, open \\quick-cocos2d-x\player\proj.win32\quick-x-player_2012.sln Project.

If the file cannot be found when compiling, please check the following:< /p>

  1. Is the environment variable set correctly?
  2. After setting and modifying the environment variable, you must restart Visual Studio
  3. The default platform-tools setting of the project is v110xp, but compiling under win7-64, change it to v110.

After compiling, generate quick under quick-cocos2d-x-xx\player\bin\win32 -x-player.exe and quick-x-player-release.exe. (It seems that this step can be omitted, because these two exe are already in the downloaded zip package)

Step 7: Create a new project and run on real machine

Under the dos window, run the script

quick-cocos2d-xxx\bin\create_project.bat cn.abdemoGame

At this time The current directory generates a demoGame directory, in DemoGame contains projects for multiple platforms.

Under dos, run the script proj.win32/build_native.bat After a few minutes, a libGame.so will be generated under libs. This so is the static link library of Cocos2d.

Now use eclipse to open the proj.win32 project, connect to the real machine and you can debug it, but because there is no code added , I see a black screen on the real machine.

At this time, copy the scripts and res directories of samples/coinflip to the proj.android/assets directory, and run it again I can see the coinflip game on the real machine.

Step 8: eclipse LDT+quick-x-player debugging lua

Search ldt in the Help->eclipse market place window of eclipse, install lua development tools(LDT).

After installation, you can see the lua project under File->new->, create a lua project. Choose to create from existing code

then add before main.lua The following code above to support debugging

-- for debuggerlocal initconnection = require("debugger") initconnection('127.0.0.1', 10000,'luaidekey')

< /div>

(The above code references debugger, but now under the scripts directory There is no such file. This file will be added in the following steps)

In the debug configuration window, create a lua attach to application type configuration .

idekey and timeouts are set by default, and timeouts are changed to 60.

click Lua Debugger Client, in the subsequent directory selection window, select the scripts directory of this lua project, after the operation is complete , Ldt will copy a debugger.lua to the Scripts directory.

The preparation work is basically completed, and then you can debug.

1. Start lua in debug mode in ecplise, set breakpoints in the code, and wait for quick-x-player Connection.

2, start quick-x-player-release, check Auto connect debugger under file (only develop version Player only has this option)

then open project and select the previous project demoGame/proj.android/assets (note that it is not demoGame, otherwise an error will be reported when debugging).

Press F5, then eclipse can see that the code runs to the breakpoint.


Original address https://blog.csdn.net/u013197840/article/details/17392757

lua debugging of quick-cocos2dx under eclipse

< div class="article_bar clearfix" style="color:rgb(136,136,136);border-bottom:1px solid rgb(229,229,229);font-size:14px;line-height:38px;">

Original December 18, 2013 11:56:18
  • 840

Basic steps to configure the compilation environment:

  1. Install Visual Studio 2012
  2. Install Java SDK
  3. Install the latest Android ADT bundle and Android NDK
  4. Download quick-cocos2d-x source code
  5. Set environment variables
  6. Compile quick-x-player proj.win32 project
  7. Set the lua compilation ring of eclipse territory.
  8. Create a new project and test it on the real Android device li>
  9. xplayer+eclipse debugging lua

Step 1: Install Visual Studio 2012

Download Visual from http://www.microsoft.com/visualstudio/ Studio 2012 and install it.

Supported versions:

  • Visual Studio 2012
  • Visual Studio Express 2012 for Windows Desktop

Note: must use Windows Vista/7/ 8 Operating system.

Step 2: Install Java SDK

h2>

From http ://www.oracle.com/technetwork/java/javase/downloads/ Download the latest version of Java SDK (JDK, 32bit version is recommended), and Install it.

Step 3: Install the latest Android ADT bundle and Android NDK

  1. Download the latest ADT Bundle for Windows from http://developer.android.com/sdk/ (Recommend the 32bit version, or the version that matches the JDK).
  2. Unzip adt-bundle-windows-x86-2013????.zip.
  3. Rename the directory adt-bundle-windows-x86-2013???? renamed android.
  4. Rename the directory android\sdk to android\android-sdk- windows.
  5. Download from http://developer.android.com/tools/sdk/ndk/index.html Android NDK r?< /li>
  6. Unzip android-ndk-r?-windows-x86.zip
  7. Change the directoryandroid-ndk-r? Move to android\android-ndk-r?

    Final directory structure:

    \android\android-ndk-r?\android\android-sdk-windows\android\eclipse< /pre>

  8. Run android\android-sdk-windows \tools\android.bat, select Android SDK 2.2 (if you don’t see Android SDK 2.2, please set the proxy), and then install the required packages.

Step 4: Download quick-cocos2d-x source code

Download develop The quick version, quick-cocos2d-x-develop.zip, this version of the player adds the auto connect debugger function , Easy to debug lua.

Method 1: The fastest way to obtain the source code is through the download page on the quick-cocos2d-x official website. All stable versions and their download links are listed here.

Due to the Android SDK and NDK issues, there are certain requirements for the placement of the quick-cocos2d-x directory:

  1. must be in the same partition as Android SDK/NDK
  2. Cannot be placed in the root directory
  3. Chinese and spaces cannot be included in the path (So ​​don’t put the desktop)

Method 2: Use git The tool clones the quick-cocos2d-x repository.启动 终端 应用程序, 运行命令:

$ git clone git://github.com/dualface/quick-cocos2d-x.git Cloning into 'quick-cocos2d-x'...

如果访问 github.com 速度太慢,可以使用国内镜像仓库,网页:https://code.csdn.net/liaoyulei01/quick-cocos2d-x

 

Step 5: 设置环境变量

打开 系统属性 -> 高级 -> 环境变量:

添加下列环境变量(注意修改 为你 quick-cocos2d-x 源代码所在的实际路径):

ANDROID_NDK_ROOT=<PATH_TO>\android-ndk-r8eANDROID_SDK_ROOT=<PATH_TO>\android-sdk-windowsQUICK_COCOS2DX_ROOT=<PATH_TO>\quick-cocos2d-xCOCOS2DX_ROOT=%QUICK_COCOS2DX_ROOT%\lib\cocos2d-xANDROID_HOME=%ANDROID_SDK_ROOT%PATH=%QUICK_COCOS2DX_ROOT%\bin\win32

如果 PATH 变量已经存在,则在 PATH 变量最后添加;%QUICK_COCOS2DX_ROOT%\bin\win32

 

Step 6: 编译 quick-x-player proj.win32 工程

启动 Visual Studio 2012,打开 \\quick-cocos2d-x\player\proj.win32\quick-x-player_2012.sln 工程。

编译时如果提示文件找不到,请做以下检查:

  1. 环境变量设置是否正确
  2. 设置和修改环境变量后,必须重新启动 Visual Studio
  3. 工程默认的platform-tools设置的是v110xp,在win7-64下编译不过,改成v110.

编译完成以后,在quick-cocos2d-x-xx\player\bin\win32下生成quick-x-player.exe和quick-x-player-release.exe。 (貌似这一步可以省略,因为下载的zip包里面已经有这两个exe了)

 

Step 7: 创建新项目,真机运行

在dos窗口下,运行脚本

quick-cocos2d-xxx\bin\create_project.bat cn.a.b.demoGame

此时在当前目录生成一个demoGame目录,在demoG ame下包含多个平台的项目。

在dos下,运行脚本proj.win32/build_native.bat,几分钟过后在libs下生成一个libGame.so,这个so就是Cocos2d的静态链接库。

现在用eclipse打开proj.win32项目,连上真机就可以调试了,不过由于没有添加任何代码,在真机上看到的是黑屏。

此时将samples/coinflip的scripts和res目录拷贝到proj.android/assets目录下,重新运行就能在真机上看到coinflip游戏了。

 

Step 8: eclipse LDT+quick-x-player调试lua

在eclipse的Help->eclipse market place窗口中搜索ldt,安装lua development tools(LDT)。

安装以后,在File->new->下可以看到lua project了,创建lua项目。选择从已有代码创建

然后在main.lua前加上如下代码,以支持调试

-- for debuggerlocal initconnection = require("debugger") initconnection('127.0.0.1', 10000 , 'luaidekey')

(上述代码引用了debugger,但是现在scripts目录下并没有这个文件。下面步骤中会将这个文件加上)

在debug configuration窗口,创建一个lua attach to application类型的配置。

idekey和timeouts默认都已设置,timeouts改成60。

点击Lua Debugger Client,在随后的目录选择窗口中,选择本lua工程的scripts目录,操作完毕后,ldt会拷贝一个debugger.lua到Scripts目录下。

准备工作基本完成,接下来就可以调试了。

1、在ecplise中以debug方式启动lua,在代码中设置断点,等待quick-x-player的连接。

2、启动quick-x-player-release,在file下勾选Auto connect debugger(只有develop版本的player才有这个选项)

然后open project,选择之前项目demoGame/proj.android/assets(注意不是demoGame,不然调试的时候会报错)。

按F5,此时eclipse就可以看到代码运行到断点了。


原文地址 https://blog.csdn.net/u013197840/article/details/17392757

原创  2013年12月18日 11:56:18
  • 840

原创  2013年12月18日 11:56:18

配置编译环境的基本步骤:

  1. 安装 Visual Studio 2012
  2. 安装 Java SDK
  3. 安装最新的 Android ADT bundle 和 Android NDK
  4. 下载 quick-cocos2d-x 源代码
  5. 设置环境变量
  6. 编译 quick-x-player proj.win32 工程
  7. 设置eclipse的lua编译环境。
  8. 创建新项目,并在 Android 真机上进行测试
  9. xplayer+eclipse调试lua

 

Step 1: 安装 Visual Studio 2012

从 http://www.microsoft.com/visualstudio/ 下载 Visual Studio 2012,并进行安装。

支持的版本:

  • Visual Studio 2012
  • Visual Studio Express 2012 for Windows Desktop

注意:必须使用 Windows Vista/7/8 操作系统。

 

Step 2: 安装 Java SDK

从 http://www.oracle.com/technetwork/java/javase/downloads/ 下载最新版的 Java SDK (JDK, 推荐使用 32bit 版本),并进行安装。

 

Step 3: 安装最新的 Android ADT bundle 和 Android NDK

  1. 从 http://developer.android.com/sdk/ 下载最新的 ADT Bundle for Windows ( 推荐 32bit 版本,或者和 JDK 匹配的版本 )。
  2. 解压缩 adt-bundle-windows-x86-2013????.zip 。
  3. 将目录 adt-bundle-windows-x86-2013???? 改名为 android 。
  4. 将目录 android\sdk 改名为 android\android-sdk-windows 。
  5. 从 http://developer.android.com/tools/sdk/ndk/index.html 下载 Android NDK r?
  6. 解压缩 android-ndk-r?-windows-x86.zip
  7. 将目录 android-ndk-r? 移动到 android\android-ndk-r?

    最终的目录结构:

    \android\android-ndk-r?\android\android-sdk-windows\android\eclipse

     

  8. 运行 android\android-sdk-windows\tools\android.bat, 选中 Android SDK 2.2如果看不到 Android SDK 2.2,请设置代理), 然后安装需要的包。

     

 

Step 4: 下载 quick-cocos2d-x 源代码

下载develop版本的quick,quick-cocos2d-x-develop.zip,这个版本的player增加了auto connect debugger功能,方便调试lua。

方法 1: 最快速获得源代码的途径是通过 quick-cocos2d-x 官方网站上的下载页面。这里列出了所有的稳定版本及其下载链接。

由于 Android SDK 和 NDK 的问题,quick-cocos2d-x 目录的放置有一定要求:

  1. 必须和 Android SDK/NDK 在同一个分区
  2. 不能放在根目录
  3. 路径中不能包含中文和空格(所以别放桌面了)

 

方法 2: 使用 git 工具克隆 quick-cocos2d-x 仓库。启动 终端 应用程序, 运行命令:

$ git clone git://github.com/dualface/quick-cocos2d-x.git Cloning into 'quick-cocos2d-x'...

如果访问 github.com 速度太慢,可以使用国内镜像仓库,网页:https://code.csdn.net/liaoyulei01/quick-cocos2d-x

 

Step 5: 设置环境变量

打开 系统属性 -> 高级 -> 环境变量:

添加下列环境变量(注意修改 为你 quick-cocos2d-x 源代码所在的实际路径):

ANDROID_NDK_ROOT=<PATH_TO>\android-ndk-r8eANDROID_SDK_ROOT=<PATH_TO>\android-sdk-windowsQUICK_COCOS2DX_ROOT=<PATH_TO>\quick-cocos2d-xCOCOS2DX_ROOT=%QUICK_COCOS2DX_ROOT%\lib\cocos2d-xANDROID_HOME=%ANDROID_SDK_ROOT%PATH=%QUICK_COCOS2DX_ROOT%\bin\win32

如果 PATH 变量已经存在,则在 PATH 变量最后添加;%QUICK_COCOS2DX_ROOT%\bin\win32

 

Step 6: 编译 quick-x-player proj.win32 工程

启动 Visual Studio 2012,打开 \\quick-cocos2d-x\player\proj.win32\quick-x-player_2012.sln 工程。

编译时如果提示文件找不到,请做以下检查:

  1. 环境变量设置是否正确
  2. 设置和修改环境变量后,必须重新启动 Visual Studio
  3. 工程默认的platform-tools设置的是v110xp,在win7-64下编译不过,改成v110.

编译完成以后,在quick-cocos2d-x-xx\player\bin\win32下生成quick-x-player.exe和quick-x-player-release.exe。 (貌似这一步可以省略,因为下载的zip包里面已经有这两个exe了)

 

Step 7: 创建新项目,真机运行

在dos窗口下,运行脚本

quick-cocos2d-xxx\bin\create_project.bat cn.a.b.demoGame

此时在当前目录生成一个demoGame目录,在demoGame下包含多个平台的项目。

在dos下,运行脚本proj.win32/build_native.bat,几分钟过后在libs下生成一个libGame.so,这个so就是Cocos2d的静态链接库。

现在用eclipse打开proj.win32项目,连上真机就可以调试了,不过由于没有添加任何代码,在真机上看到的是黑屏。

此时将samples/coinflip的scripts和res目录拷贝到proj.android/assets目录下,重新运行就能在真机上看到coinflip游戏了。

 

Step 8: eclipse LDT+quick-x-player调试lua

在eclipse的Help->eclipse market place窗口中搜索ldt,安装lua development tools(LDT)。

安装以后,在File->new->下可以看到lua project了,创建lua项目。选择从已有代码创建

然后在main.lua前加上如下代码,以支持调试

-- for debuggerlocal initconnection = require("debugger") initconnection('127.0.0.1', 10000 , 'luaidekey')

(上述代码引用了debugger,但是现在scripts目录下并没有这个文件。下面步骤中会将这个文件加上)

在debug configuration窗口,创建一个lua attach to application类型的配置。

idekey和timeouts默认都已设置,timeouts改成60。

点击Lua Debugger Client,在随后的目录选择窗口中,选择本lua工程的scripts目录,操作完毕后,ldt会拷贝一个debugger.lua到Scripts目录下。

准备工作基本完成,接下来就可以调试了。

1、在ecplise中以debug方式启动lua,在代码中设置断点,等待quick-x-player的连接。

2、启动quick-x-player-release,在file下勾选Auto connect debugger(只有develop版本的player才有这个选项)

然后open project,选择之前项目demoGame/proj.android/assets(注意不是demoGame,不然调试的时候会报错)。

按F5,此时eclipse就可以看到代码运行到断点了。


原文地址 https://blog.csdn.net/u013197840/article/details/17392757

配置编译环境的基本步骤:

  1. 安装 Visual Studio 2012
  2. 安装 Java SDK
  3. 安装最新的 Android ADT bundle 和 Android NDK
  4. 下载 quick-cocos2d-x 源代码
  5. 设置环境变量
  6. 编译 quick-x-player proj.win32 工程
  7. 设置eclipse的lua编译环境。
  8. 创建新项目,并在 Android 真机上进行测试
  9. xplayer+eclipse调试lua

 

Step 1: 安装 Visual Studio 2012

从 http://www.microsoft.com/visualstudio/ 下载 Visual Studio 2012,并进行安装。

支持的版本:

  • Visual Studio 2012
  • Visual Studio Express 2012 for Windows Desktop

注意:必须使用 Windows Vista/7/8 操作系统。

 

Step 2: 安装 Java SDK

从 http://www.oracle.com/technetwork/java/javase/downloads/ 下载最新版的 Java SDK (JDK, 推荐使用 32bit 版本),并进行安装。

 

Step 3: 安装最新的 Android ADT bundle 和 Android NDK

  1. 从 http://developer.android.com/sdk/ 下载最新的 ADT Bundle for Windows ( 推荐 32bit 版本,或者和 JDK 匹配的版本 )。
  2. 解压缩 adt-bundle-windows-x86-2013????.zip 。
  3. 将目录 adt-bundle-windows-x86-2013???? 改名为 android 。
  4. 将目录 android\sdk 改名为 android\android-sdk-windows 。
  5. 从 http://developer.android.com/tools/sdk/ndk/index.html 下载 Android NDK r?
  6. 解压缩 android-ndk-r?-windows-x86.zip
  7. 将目录 android-ndk-r? 移动到 android\android-ndk-r?

    最终的目录结构:

    \android\android-ndk-r?\android\android-sdk-windows\android\eclipse

     

  8. 运行 android\android-sdk-windows\tools\android.bat, 选中 Android SDK 2.2如果看不到 Android SDK 2.2,请设置代理), 然后安装需要的包。

     

 

Step 4: 下载 quick-cocos2d-x 源代码

下载develop版本的quick,quick-cocos2d-x-develop.zip,这个版本的player增加了auto connect debugger功能,方便调试lua。

方法 1: 最快速获得源代码的途径是通过 quick-cocos2d-x 官方网站上的下载页面。这里列出了所有的稳定版本及其下载链接。

由于 Android SDK 和 NDK 的问题,quick-cocos2d-x 目录的放置有一定要求:

  1. 必须和 Android SDK/NDK 在同一个分区
  2. 不能放在根目录
  3. 路径中不能包含中文和空格(所以别放桌面了)

 

方法 2: 使用 git 工具克隆 quick-cocos2d-x 仓库。启动 终端 应用程序, 运行命令:

$ git clone git://github.com/dualface/quick-cocos2d-x.git Cloning into 'quick-cocos2d-x'...

如果访问 github.com 速度太慢,可以使用国内镜像仓库,网页:https://code.csdn.net/liaoyulei01/quick-cocos2d-x

 

Step 5: 设置环境变量

打开 系统属性 -> 高级 -> 环境变量:

添加下列环境变量(注意修改 为你 quick-cocos2d-x 源代码所在的实际路径):

ANDROID_NDK_ROOT=<PATH_TO>\android-ndk-r8eANDROID_SDK_ROOT=<PATH_TO>\android-sdk-windowsQUICK_COCOS2DX_ROOT=<PATH_TO>\quick-cocos2d-xCOCOS2DX_ROOT=%QUICK_COCOS2DX_ROOT%\lib\cocos2d-xANDROID_HOME=%ANDROID_SDK_ROOT%PATH=%QUICK_COCOS2DX_ROOT%\bin\win32

如果 PATH 变量已经存在,则在 PATH 变量最后添加;%QUICK_COCOS2DX_ROOT%\bin\win32

 

Step 6: 编译 quick-x-player proj.win32 工程

启动 Visual Studio 2012,打开 \\quick-cocos2d-x\player\proj.win32\quick-x-player_2012.sln 工程。

编译时如果提示文件找不到,请做以下检查:

  1. 环境变量设置是否正确
  2. 设置和修改环境变量后,必须重新启动 Visual Studio
  3. 工程默认的platform-tools设置的是v110xp,在win7-64下编译不过,改成v110.

编译完成以后,在quick-cocos2d-x-xx\player\bin\win32下生成quick-x-player.exe和quick-x-player-release.exe。 (貌似这一步可以省略,因为下载的zip包里面已经有这两个exe了)

 

Step 7: 创建新项目,真机运行

在dos窗口下,运行脚本

quick-cocos2d-xxx\bin\create_project.bat cn.a.b.demoGame

此时在当前目录生成一个demoGame目录,在demoGame下包含多个平台的项目。

在dos下,运行脚本proj.win32/build_native.bat,几分钟过后在libs下生成一个libGame.so,这个so就是Cocos2d的静态链接库。

现在用eclipse打开proj.win32项目,连上真机就可以调试了,不过由于没有添加任何代码,在真机上看到的是黑屏。

此时将samples/coinflip的scripts和res目录拷贝到proj.android/assets目录下,重新运行就能在真机上看到coinflip游戏了。

 

Step 8: eclipse LDT+quick-x-player调试lua

在eclipse的Help->eclipse market place窗口中搜索ldt,安装lua development tools(LDT)。

安装以后,在File->new->下可以看到lua project了,创建lua项目。选择从已有代码创建

然后在main.lua前加上如下代码,以支持调试

-- for debuggerlocal initconnection = require("debugger") initconnection('127.0.0.1', 10000 , 'luaidekey')

(上述代码引用了debugger,但是现在scripts目录下并没有这个文件。下面步骤中会将这个文件加上)

在debug configuration窗口,创建一个lua attach to application类型的配置。

idekey和timeouts默认都已设置,timeouts改成60。

点击Lua Debugger Client,在随后的目录选择窗口中,选择本lua工程的scripts目录,操作完毕后,ldt会拷贝一个debugger.lua到Scripts目录下。

准备工作基本完成,接下来就可以调试了。

1、在ecplise中以debug方式启动lua,在代码中设置断点,等待quick-x-player的连接。

2、启动quick-x-player-release,在file下勾选Auto connect debugger(只有develop版本的player才有这个选项)

然后open project,选择之前项目demoGame/proj.android/assets(注意不是demoGame,不然调试的时候会报错)。

按F5,此时eclipse就可以看到代码运行到断点了。


原文地址 https://blog.csdn.net/u013197840/article/details/17392757

-- for debuggerlocal initconnection = require("debugger") initconnection('127.0.0.1', 10000 , 'luaidekey')

Leave a Comment

Your email address will not be published.