PhoneGap IOS 调试

Posted by wxianfeng Tue, 14 May 2013 04:07:00 GMT

phonegap ios 调试技巧, 目前几个我用过的:

1, chrome 有 ripple 模拟器插件, 但是会出现phonegap js api 不解释, 需要屏蔽掉

2, 利用 http://debug.phonegap.com/ 远程调试, 但是延时严重

3, 把 wenire 装到本地进行调试, 没有尝试.

4, 如果利用 浏览器调试, 可以判断 window.device 是否存在来屏蔽掉 phonegap js api

5, 模拟器和真机调试可以使用 safari web inspector

打开 safari -> preference -> advanced -> develop

最后附张模拟器调试的图, 可以实时调css, 还可以打js断点.

总结下来就是, 前期开发使用 浏览器, 后期细节调试使用 xcode 模拟器 或者真机 + safari web inspector 来调整.


netbeans debug rails 3.0

Posted by wxianfeng Sun, 31 May 2009 22:09:00 GMT

环境:ruby 1.9.2 + rails 3.0.3 + nb 6.9.1 + ubuntu 10.10

nb debug rails 3.0 还没有跟上,不可以debug rails 3.0项目了,网上也有很多人遇到,可能出现下面这个异常:

Uncaught exception: no such file to load -- script/rails

我有一个解决办法,把你要debug的项目path直接写进去,

需要用到的gem:

ruby-debug-base19 (0.11.24)
ruby-debug-ide (0.4.9)
linecache19 (0.5.11)

如果是debug test file 的话,还需要 test-unit

wxianfeng@ubuntu:~$ gem list ruby-

*** LOCAL GEMS ***

ruby-debug-base19 (0.11.24)
ruby-debug-ide (0.4.9)
wxianfeng@ubuntu:~$ gem list line

*** LOCAL GEMS ***

linecache19 (0.5.11)
wxianfeng@ubuntu:~$ gem list test

*** LOCAL GEMS ***

test-unit (2.1.2)

当前rvm环境;

wxianfeng@ubuntu:~$ rvm info

ruby-1.9.2-p0:

  system:
    uname:       "Linux ubuntu 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010 i686 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.1.5(1)-release (i686-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.1.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p0"
    date:         "2010-08-18"
    platform:     "i686-linux"
    patchlevel:   "2010-08-18 revision 29036"
    full_version: "ruby 1.9.2p0 (2010-08-18 revision 29036) [i686-linux]"

  homes:
    gem:          "/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0"
    ruby:         "/home/wxianfeng/.rvm/rubies/ruby-1.9.2-p0"

  binaries:
    ruby:         "/home/wxianfeng/.rvm/rubies/ruby-1.9.2-p0/bin/ruby"
    irb:          "/home/wxianfeng/.rvm/rubies/ruby-1.9.2-p0/bin/irb"
    gem:          "/home/wxianfeng/.rvm/rubies/ruby-1.9.2-p0/bin/gem"
    rake:         "/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0/bin/rake"

  environment:
    PATH:         "/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0/bin:/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0@global/bin:/home/wxianfeng/.rvm/rubies/ruby-1.9.2-p0/bin:/home/wxianfeng/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/system/mysql/bin:/usr/local/system/jdk1.6.0_22/bin"
    GEM_HOME:     "/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0"
    GEM_PATH:     "/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0:/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0@global"
    MY_RUBY_HOME: "/home/wxianfeng/.rvm/rubies/ruby-1.9.2-p0"
    IRBRC:        "/home/wxianfeng/.rvm/rubies/ruby-1.9.2-p0/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

注意把netbeans的 gem_home , gem_path 设置为 当前 rvm 对应的 gem_home , gem_path , 设置gem_path 时 nb 默认 .rvm 目录不显示,需要直接在 对话框中输入路径

最后修改

/home/wxianfeng/.rvm/gems/ruby-1.9.2-p0/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb

大概 110 行

      path = "/usr/local/system/projects/entos/ent_os/script/rails"
      bt = debug_load(path, options.stop, options.load_mode)
      #      bt = debug_load(Debugger::PROG_SCRIPT, options.stop, options.load_mode)

注释一行,添加两行

把你需要调试的项目 set as main project ,然后 debug main project !

ok~!

如果你需要debug 单个ruby 文件 , 那么 需要改回来 , 这里注意.

see:
http://forums.netbeans.org/topic31103.html