<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>绿色记忆 &#187; 远程调试</title>
	<atom:link href="https://blog.gmem.cc/tag/%e8%bf%9c%e7%a8%8b%e8%b0%83%e8%af%95/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.gmem.cc</link>
	<description></description>
	<lastBuildDate>Fri, 17 Apr 2026 09:20:32 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.14</generator>
	<item>
		<title>使用GapDebug调试Phonegap应用</title>
		<link>https://blog.gmem.cc/gapdebug</link>
		<comments>https://blog.gmem.cc/gapdebug#comments</comments>
		<pubDate>Fri, 19 Feb 2016 02:41:02 +0000</pubDate>
		<dc:creator><![CDATA[Alex]]></dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[远程调试]]></category>

		<guid isPermaLink="false">https://blog.gmem.cc/?p=11043</guid>
		<description><![CDATA[<p>GapDebug简介 一个移动混合应用（hybrid mobile apps）调试工具，它是一个Eclipse RCP应用，集成了Chrome Dev Tools（用于Android调试）和Webkit Inspector（用于iOS调试）。GapDeug的主要界面在Chrome浏览器中运行。 GapDebug的价值在于，它整合了很多原先需要手工执行的繁琐步骤。GapDebug可以自动的识别设备、进行安装与配置、启动应用并执行调试，并且同时支持iOS、Android设备的远程调试。 联合使用GapDebug和Phonegap Developer App，可以进行无缝调试：包括DOM结构检查、断点、实时代码更新。 前置条件 要让GapDebug正确运行，必须满足以下条件：   Android iOS 移动设备  Android 4.4+或者更高版本 推荐使用 Genymotion模拟器 <a class="read-more" href="https://blog.gmem.cc/gapdebug">[...]</a></p>
<p>The post <a rel="nofollow" href="https://blog.gmem.cc/gapdebug">使用GapDebug调试Phonegap应用</a> appeared first on <a rel="nofollow" href="https://blog.gmem.cc">绿色记忆</a>.</p>
]]></description>
				<content:encoded><![CDATA[<div class="wri_content_clear_both"><div class="blog_h1"><span class="graybg">GapDebug简介</span></div>
<p>一个移动混合应用（hybrid mobile apps）调试工具，它是一个Eclipse RCP应用，集成了Chrome Dev Tools（用于Android调试）和Webkit Inspector（用于iOS调试）。GapDeug的主要界面在Chrome浏览器中运行。</p>
<p>GapDebug的价值在于，它<span style="background-color: #c0c0c0;">整合了很多原先需要手工执行的繁琐步骤</span>。GapDebug可以自动的识别设备、进行安装与配置、启动应用并执行调试，并且同时支持iOS、Android设备的远程调试。</p>
<p>联合使用GapDebug和Phonegap Developer App，可以进行<span style="background-color: #c0c0c0;">无缝调试</span>：包括DOM结构检查、断点、实时代码更新。</p>
<div class="blog_h1"><span class="graybg">前置条件</span></div>
<p>要让GapDebug正确运行，必须满足以下条件：</p>
<table class=" full-width fixed-word-wrap">
<thead>
<tr>
<td style="width: 20%; text-align: center;"> </td>
<td style="text-align: center;">Android</td>
<td style="text-align: center;">iOS</td>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;"><strong>移动设备</strong></td>
<td>
<ol>
<li><span style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 22px;"> Android 4.4+或者更高版本</span></li>
<li>推荐使用 Genymotion模拟器</li>
<li>启用USB调试</li>
</ol>
</td>
<td>
<ol>
<li><span style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 22px;"> iOS 7+</span></li>
<li>启用Web Inspector</li>
</ol>
</td>
</tr>
<tr>
<td style="text-align: center;"><strong> 移动应用程序</strong></td>
<td> 启用调试</td>
<td> 应用程序必须使用iOS开发者证书和Provisioning Profile签名</td>
</tr>
<tr>
<td style="text-align: center;"><strong>工作站 </strong></td>
<td>
<ol>
<li><span style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 22px;"> Android驱动（Windows）</span></li>
<li>Chrome/Chromium浏览器</li>
</ol>
</td>
<td>
<ol>
<li><span style="color: #333333; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 22px;"> 安装iTunes</span></li>
<li>Chrome/Chromium浏览器</li>
</ol>
</td>
</tr>
</tbody>
</table>
<div class="blog_h1">移动端配置 </div>
<div class="blog_h2"><span class="graybg">iOS</span></div>
<div class="blog_h3"><span class="graybg">启用Web Inspector</span></div>
<p>Settings ⇨ Safari ⇨ Advanced ⇨ Web Inspector，滑动打开</p>
<div class="blog_h2"><span class="graybg">Android</span></div>
<div class="blog_h3"><span class="graybg">启用USB调试</span></div>
<p>Settings ⇨ Developer Options ⇨ 勾线 USB Debugging</p>
<div class="blog_h3"><span class="graybg">允许应用调试</span></div>
<p>以Phonegap应用为例，编辑<pre class="crayon-plain-tag">platforms/android/AndroidManifest.xml</pre>，添加：</p>
<pre class="crayon-plain-tag">&lt;manifest&gt;
     ....
     &lt;application android:debuggable="true" /&gt;
     ....
&lt;/manifest&gt;</pre>
<p>如果使用Phonegap Developer App，则不需要上述设置。 </p>
<div class="blog_h1"><span class="graybg">工作站配置</span></div>
<ol>
<li>下载并安装GapDebug：<a href="https://www.genuitec.com/products/gapdebug/">https://www.genuitec.com/products/gapdebug</a></li>
<li>下载并安装Chromium，推荐绿色版：<a href="https://sourceforge.net/projects/crportable/">https://sourceforge.net/projects/crportable/</a></li>
</ol>
<div class="blog_h2"><span class="graybg">GapDebug配置</span></div>
<p>打开GapDebug，系统托盘中右键GapDebug图标 ⇨ Settings：</p>
<table class=" full-width fixed-word-wrap">
<thead>
<tr>
<td style="width: 25%; text-align: center;">设置路径</td>
<td style="text-align: center;">说明</td>
</tr>
</thead>
<tbody>
<tr>
<td>Chrome and Server</td>
<td>
<p>Server Setting：</p>
<ol>
<li>修改GapDebug的Web服务的端口，指定一个空闲端口</li>
</ol>
<p>Google Chrome Settings：</p>
<ol>
<li>定位到新下载的Chromium绿色版</li>
<li>取消勾选“Launch the debugger in Google Chrome application mode”</li>
</ol>
</td>
</tr>
<tr>
<td>General</td>
<td>
<p>Debug web browser pages：勾选后，可以调试手机上的Safari或者Chrome浏览器</p>
<p>Start app after installation：勾选后，新安装的应用程序会自动启动</p>
</td>
</tr>
</tbody>
</table>
<div class="blog_h1" style="text-align: center;"><span class="graybg">调试移动应用</span></div>
<div class="blog_h2"><span class="graybg">开始调试</span></div>
<ol>
<li>系统托盘中右键GapDebug图标 ⇨ Open Debug Tools，在Chromium浏览器中打开GapDebug主界面</li>
<li>打开模拟器，或者通过USB电缆连接设备。如果设备提示Allow USB debugging（Android）或者Trust This Computer（iOS），点击确定</li>
<li>最好关闭设备的自动锁定或者睡眠功能</li>
<li>在GapDebug左侧面板，会出现设备图标。并显示设备设备IP地址和ADB端口，以及设备名称和固件版本信息</li>
<li>点击左侧面板上“奔跑的小人”图标，会显示设备上可远程调试的应用程序列表。点击其中一个应用程序，即开始启动并开始调试。第一次调试某个新的设备时，可能需要到外网下载一些文件，应保证网络畅通</li>
<li>右侧面板出现基于Chrome Dev Tools或者Webkit Inspector的调试界面</li>
</ol>
<div class="blog_h2"><span class="graybg">用户界面</span></div>
<p>下面的是调试Android Phonegap应用时的截图：<a href="https://blog.gmem.cc/wp-content/uploads/2016/02/gapdebug-ui.jpg"><img class="aligncenter wp-image-11058" src="https://blog.gmem.cc/wp-content/uploads/2016/02/gapdebug-ui.jpg" alt="gapdebug-ui" width="700" height="428" /></a></p>
<p>左侧面板，设备上方有四个按钮，分别用于：</p>
<ol>
<li>启动某个设备应用程序以调试</li>
<li>截取设备屏幕</li>
<li>安装新的应用程序到设备。另外，直接拖拽APK/IPA文件到设备图标上，也可以进行安装</li>
<li>隐藏/显示应用程序列表</li>
</ol>
<p>左侧面板，应用程序列表，每个条目对应一个正在运行的移动Web应用程序。条目右侧有一个两个图标：</p>
<ol>
<li>小圆点，当前正被调试的应用程序的小圆点图标变亮</li>
<li><img class="aligncenter size-full wp-image-11062 inlineBlock" src="https://blog.gmem.cc/wp-content/uploads/2016/02/auto-active.png" alt="auto-active" width="16" height="16" />，点击后，可以启用即时调试（Instant Debugging）—— 应用程序启动后GapDebug会自动检测到，并立即启动一个Debugger附着到此应用程序上。</li>
</ol>
<p>可以看到，右侧第一个选项卡就是Chrome Dev Tools，相信Web开发者都很熟悉：</p>
<ol>
<li>点击菜单栏放大镜按钮，可以Inspect DOM元素，应用程序界面会和你的操作互动，就像调试普通网页时一样</li>
<li>点击放大镜旁边的手机按钮，可以进行屏幕转播（Screencast），即在Gapdebug界面中实时显示手机UI。此UI支持用户交互</li>
</ol>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div><p>The post <a rel="nofollow" href="https://blog.gmem.cc/gapdebug">使用GapDebug调试Phonegap应用</a> appeared first on <a rel="nofollow" href="https://blog.gmem.cc">绿色记忆</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gmem.cc/gapdebug/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用Eclipse进行远程调试</title>
		<link>https://blog.gmem.cc/remote-debug-with-eclipse</link>
		<comments>https://blog.gmem.cc/remote-debug-with-eclipse#comments</comments>
		<pubDate>Wed, 05 May 2010 08:36:50 +0000</pubDate>
		<dc:creator><![CDATA[Alex]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[远程调试]]></category>

		<guid isPermaLink="false">http://blog.gmem.cc/?p=1586</guid>
		<description><![CDATA[<p>一些基础知识 JPDA(Java Platform Debugger Architecture)是实现Java远程调试的基础，它是一个CS架构，包含三个组件： JVMTI（JVM Tool Interface ）：服务端，即debuggee端。该接口代替JDK1.4的JVMDI，为被调试VM提供支持 JDWP（Java Debug Wire Protocol）：描述了调试信息、请求信息的格式。支持前后端的通信 JDI（Java Debug Interface）：客户端，即debugger端。Eclipse实现了JDI 理论上，任何实现了JDI的前端，均可调式支持JPDA的VM。 JDWP相关的虚拟机参数 通过设置VM参数，可以把VM作为调试服务端或者客户机： 参数名  参数说明  -Xdebug 启用调试特性 <a class="read-more" href="https://blog.gmem.cc/remote-debug-with-eclipse">[...]</a></p>
<p>The post <a rel="nofollow" href="https://blog.gmem.cc/remote-debug-with-eclipse">使用Eclipse进行远程调试</a> appeared first on <a rel="nofollow" href="https://blog.gmem.cc">绿色记忆</a>.</p>
]]></description>
				<content:encoded><![CDATA[<div class="wri_content_clear_both"><div class="blog_h2"><span class="graybg">一些基础知识</span></div>
<p>JPDA(Java Platform Debugger Architecture)是实现Java远程调试的基础，它是一个CS架构，包含三个组件：</p>
<ol>
<li><span style="color: #222222;">JVMTI（JVM Tool Interface ）：服务端，即debuggee端。该接口代替JDK1.4的JVMDI，为被调试VM提供支持</span></li>
<li>JDWP<span style="color: #222222;">（</span><span style="color: #222222;">Java Debug Wire Protocol<span style="color: #222222;">）：描述了调试信息、请求信息的格式。支持前后端的通信</span></span></li>
<li>JDI（Java Debug Interface）：客户端，即debugger端。Eclipse实现了JDI</li>
</ol>
<p>理论上，任何实现了JDI的前端，均可调式支持JPDA的VM。</p>
<div class="blog_h2"><span class="graybg">JDWP相关的虚拟机参数</span></div>
<p>通过设置VM参数，可以把VM作为调试服务端或者客户机：</p>
<table style="width: 100%;" border="1" cellspacing="0" cellpadding="5">
<thead>
<tr>
<td style="width: 150px; text-align: center;">参数名</td>
<td style="text-align: center;"> 参数说明</td>
</tr>
</thead>
<tbody>
<tr>
<td> -Xdebug</td>
<td>启用调试特性</td>
</tr>
<tr>
<td> -Xrunjdwp:&lt;子选项&gt;</td>
<td>包含一系列的子选项，来控制调试行为：</p>
<div style="padding-left: 30px;">
<p>transport：传输方式，通常使用套接字server：如果为y，表示当前VM是debuggee，否则为debugger</p>
<p>address：对于debuggee，指定监听地址和端口；对于debugger，指定需要连接的地址和端口</p>
<p>suspend：如果为y，则VM暂停，直到debugger连接</p>
</div>
</td>
</tr>
</tbody>
</table>
<strong>debuggee虚拟机参数样例：</strong><br />
<pre class="crayon-plain-tag">-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000</pre><br />
<strong>debugger虚拟机参数样例：</strong><br />
<pre class="crayon-plain-tag">-Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8000</pre>
<div class="blog_h2"><span class="graybg">在Eclipse中配置远程调试客户端</span></div>
<p>点击工具栏上的Debug按钮，选择Debug Configurations，新建一个调试配置，其中Host、Port分别填写被调试VM的地址和调试端口。参考下图：<br />
<a href="/wp-content/uploads/2010/05/eclipse-remote-debug.jpg"><img class="alignnone size-full wp-image-1600" src="https://blog.gmem.cc/wp-content/uploads/2010/05/eclipse-remote-debug.jpg" alt="eclipse-remote-debug" width="769" height="560" /></a></p>
<div class="blog_h2"><span class="graybg">配置远程调试服务端</span></div>
<p>下面以Tomcat和Weblogic为例，描述如何配置远程调试的服务端，本质上都是添加对应的VM参数</p>
<div class="blog_h3"><span class="graybg">Tomcat 6.0远程调试服务端</span></div>
Tomcat6已经内置了对JDPA的支持，只需要按如下命令启动即可：<br />
<pre class="crayon-plain-tag">#监听默认的8000端口
catalina jpda start</pre><br />
亦可修改脚本catalina.bat，添加类似以下内容：<br />
<pre class="crayon-plain-tag">SET CATALINA_OPTS=-server -Xms1024m -Xmx1024m -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</pre>
<div class="blog_h3"><span class="graybg">Weblogic 7.0远程调试服务端（JDK1.4）</span></div>
在weblogic的启动目录中修改startWLS.cmd这一文件，它位于%weblogic_home%\server\bin\目录下，添加如下一行：<br />
<pre class="crayon-plain-tag">set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n</pre><br />
然后，把默认的set JAVA_VM=-hotspot后面的参数-hotspot去掉，否则会启动不了，提示参数错误
</div><p>The post <a rel="nofollow" href="https://blog.gmem.cc/remote-debug-with-eclipse">使用Eclipse进行远程调试</a> appeared first on <a rel="nofollow" href="https://blog.gmem.cc">绿色记忆</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.gmem.cc/remote-debug-with-eclipse/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
