SlideShare a Scribd company logo
Debugging webOS
  Applications
       Steve Lemke
   webOS Tools Engineering
        April 23, 2010
About Me

• Tools Engineer at Palm
  • Palm (webOS) Emulator
  • Internal and external SDK/PDK tools


• Previously
  •   Palm Computing (acquired by US Robotics)
  •   US Robotics    (acquired by 3Com)
  •   3Com           (spun out Palm Inc.)
  •   Palm Inc.      (spun out PalmSource)
  •   PalmSource     (acquired by Access Systems)
Overview

•   General Connectivity
•   JavaScript Logging
•   Palm Inspector and WORM
•   Host Mode for WebKit Inspector
•   Command Line Debugging
•   Ares Debugger
•   Emulator Tips and Tricks
•   Command Line Tips
•   Helpful Resources
•   Q&A
General Connectivity

• IP vs. USB
  • IP over USB is tricky
• novacom and novaterm
  •   Default target is most recently connected target
  •   Helpful if you realize it; confusing if not
  •   Leave emulator running
  •   Tip: connect device only when needed, then disconnect
• ssh
  •   Built-in to emulator (localhost:5522)
  •   Can be added to device (“pdk-device-install”)
  •   Useful on Windows (Putty)
  •   Can tunnel other ports (but novacom will too)
JavaScript Logging

• Use “Mojo.Log.Info” instead of “console.log”

• Viewing log output:
  • Good: “novaterm” + “tail -f /var/log/messages”
  • Better: “palm-log -f com.test.app”
  • Best: Ares has built-in log viewer
JavaScript Logging

• To enable logging in framework_config.json:
   • “loglevel”:99                (enable Mojo.Log.info/warn)
   • “logEvents”:true             (log framework/mouse events)
   • “timingEnabled”:true         (log scene transition timing)


• Restore default settings before shipping!
   • “loglevel”:0                 (disable Mojo.Log.info/warn)
   • “logEvents”:false            (no framework/mouse events)
   • “timingEnabled”:false        (no scene transition timing)


• MUST change system log level to see info/warn on device!
   • Default is “error” only
   • Type: palm-log --system-log-level info
Palm Inspector

• Launch application with “palm-launch -i <appname>”

• Launch “Palm Inspector” app
  • Type “palm-inspector” on Linux


• Emulator only
Palm WORM

• Launch “palm-worm” app

• Live graphs of:
   • Total DOM nodes
   • Open service handles
   • JavaScript heap usage


• Emulator only
Host Mode for WebKit Inspector

• Web server running inside Palm Emulator

• Set up a tunnel from host port 5581
  • ssh -p 5522 -L 5581:localhost:8080 root@localhost
  • See hints for Windows tunnel on developer.palm.com


• Use Safari (or Chrome) to inspect your app
  •   http://localhost:5581/Apps
  •   http://localhost:5581/PalmApps
  •   Enable “Develop Menu” in Safari: Prefs: Advanced
  •   Right-click and select “Inspect Element”
Command Line Debugging

• novaterm or ssh to device
• Type “debug” to run JavaScript debugger (like gdb)
  • Hit “enter” to stop/re-start
• Common commands:
  •   “help” and “scripts filename.js”
  •   “break /path/to/file.js:<lineno>”, “en exc all” (catch exceptions)
  •   “info break” and “clear <#>”
  •   “c” (continue), “fin” (step out), “next” (step over), “step” (into)
  •   “bt”, “down”, “up”, “frame <#>”, “scope”
  •   “list, “list -” or “list 5,10”
  •   “info args” or “info locals”
  •   “print <expr>” or “set <var> = <expr>”
Command Line Debugging

• Demo
   • $ palm-package DebugTest
   • $ palm-install com.demo.debug_1.0.0_all.ipk
   • $ palm-launch com.demo.debug


   • # novaterm
   • # debug
   • dbg> <return>


• Debugger should display:
   • break in [anonymous](), [unnamed] line 1 column 1
   • Undefined
Command Line Debugging

• Demo (cont’d)
   • scripts first-assistant.js                   (list script path)
   • b file:///media/…/first-assistant.js:25      (set brkpt)
   • en exc all     (enable exceptions all)
   • c              (continue, trigger brkpt)
   • bt             (backtrace)
   • l              (list)
   • n              (step over, hit exception)
   • print Mojo.Controller.stageController
   • set window.scene = Mojo.Controller.stageController.topScene()
   • p scene
   • p scene.sceneElement.querySelector('.palm-header').innerHTML
   • p scene.sceneElement.querySelector('.palm-header').innerHTML=“foo”
   • c              (continue; observe header change)
   • clear 1        (clear breakpoint; exit debugger)
Ares (IDE) Debugger

• Better than command-line debugger
  • Source-level debugging
  • Integrated log viewer
  • Interactive console


• Don’t have to develop in Ares to debug with it
  • http://ares.palm.com
  • Import your project, run, and debug
  • Use svn (or hg) to avoid re-importing to update
Ares (Standalone) Debugger

• Stand-alone Ares Debugger (NEW!)
  • Separate from IDE; no sources needed
  • Just attach and debug
  • http://ares.palm.com/AresDebug


• Stand-alone Ares Log Viewer
  • http://ares.palm.com/AresLog


• Ares will also be able to debug devices over USB
Ares (Standalone) Debugger

• Demo
Emulator Tips and Tricks

• GPS, Accelerometer, and Audio
   • GPS info: Search developer.palm.com for “luna-send”
   • Accelerometer: F5 to shake; F6–F9 to rotate
   • Sound: http://bit.ly/enableSound


• Suspend and Resume works!
   • Note: Novacom needs 5–10 seconds to reset


• VirtualBox GUI app
   • Renaming (or Deleting) VMs
   • Prefs: Check for Updates, Auto Capture Keyboard
Emulator Tips and Tricks

• Palm Emulator supports multiple webOS versions

• Current SDK emulator image installed here:
    • Mac:     /Applications/Palm Emulator.app/Contents/Resources/Images
    • Linux:   /opt/PalmSDK/Current/share/emulator/images
    • Windows: C:Program FilesPalmSDKshareemulatorimages


• You may store additional vmdk.zip files here:
    • Mac:     ~/Library/Application Support/Palm/SDK/Images
    • Linux:   ~/.Palm/SDK/Images
    • Windows: <user>/Local Settings/Application Data/Palm/SDK/Images


• Save old vmdk.zip before installing newer SDK
Command-Line Tips

• Just remember “palm-help”
   • Shows all available SDK commands
• Every command supports --help
   • Even “palm-help --help”
   • Try “palm-help --sdk-info”
• If emulator won’t boot…
   • “palm-emulator --list”
   • “palm-emulator --reset=<vmname>”
• If all else fails…
   • Remove ~/Library/VirtualBox (deletes all VMs!)
   • “palm-emulator --debug”
Helpful Resources

• http://developer.palm.com/
  • Online docs
  • Developer forums
  • Forum search is different from site search


• http://www.weboshelp.net/
  • (Third party site)


• IRC: irc.freenode.net
  • Firewall blocked? Try port 8000
  • Join #webos room
Q &A
Debugging webOS applications

More Related Content

What's hot

Project on refrigerator and ac
Project on refrigerator and acProject on refrigerator and ac
Project on refrigerator and ac
Arbinda Das
 
second law
 second law second law
4 reversed brayton_cycle
4 reversed brayton_cycle4 reversed brayton_cycle
4 reversed brayton_cycle
raushan kumar
 
Variable refrigerant flow systems
Variable refrigerant flow systemsVariable refrigerant flow systems
Variable refrigerant flow systems
VAHAB ABDUL
 
Vapour compression refrigeration system
Vapour compression refrigeration systemVapour compression refrigeration system
Vapour compression refrigeration system
naphis ahamad
 

What's hot (6)

Project on refrigerator and ac
Project on refrigerator and acProject on refrigerator and ac
Project on refrigerator and ac
 
second law
 second law second law
second law
 
4 reversed brayton_cycle
4 reversed brayton_cycle4 reversed brayton_cycle
4 reversed brayton_cycle
 
Variable refrigerant flow systems
Variable refrigerant flow systemsVariable refrigerant flow systems
Variable refrigerant flow systems
 
Vapour compression refrigeration system
Vapour compression refrigeration systemVapour compression refrigeration system
Vapour compression refrigeration system
 
VENDING MACHINE
VENDING MACHINEVENDING MACHINE
VENDING MACHINE
 

Viewers also liked

Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScript
fpatton
 
Capable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappCapable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox Webapp
Fred Lin
 
Palm WebOS Overview
Palm WebOS OverviewPalm WebOS Overview
Palm WebOS Overview
Craig Dickson
 
What is a shell script
What is a shell scriptWhat is a shell script
What is a shell script
Dr.M.Karthika parthasarathy
 
Chrome extensions
Chrome extensionsChrome extensions
Chrome extensions
Aleks Zinevych
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
Marakana Inc.
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
Kazuhiro Ogura
 
Introduction To Google Chrome Os
Introduction To Google Chrome OsIntroduction To Google Chrome Os
Introduction To Google Chrome OsSaurabh Jinturkar
 
Google Chrome Extensions
Google Chrome ExtensionsGoogle Chrome Extensions
Google Chrome Extensions
Samantha Morra
 
Web o sppt
Web o spptWeb o sppt
Web o sppt
psukhdeve
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOS
fpatton
 

Viewers also liked (11)

Internals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScriptInternals - Exploring the webOS Browser and JavaScript
Internals - Exploring the webOS Browser and JavaScript
 
Capable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox WebappCapable Web: Chrome Apps and Firefox Webapp
Capable Web: Chrome Apps and Firefox Webapp
 
Palm WebOS Overview
Palm WebOS OverviewPalm WebOS Overview
Palm WebOS Overview
 
What is a shell script
What is a shell scriptWhat is a shell script
What is a shell script
 
Chrome extensions
Chrome extensionsChrome extensions
Chrome extensions
 
Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
 
Introducing chrome apps (ogura)
Introducing chrome apps (ogura)Introducing chrome apps (ogura)
Introducing chrome apps (ogura)
 
Introduction To Google Chrome Os
Introduction To Google Chrome OsIntroduction To Google Chrome Os
Introduction To Google Chrome Os
 
Google Chrome Extensions
Google Chrome ExtensionsGoogle Chrome Extensions
Google Chrome Extensions
 
Web o sppt
Web o spptWeb o sppt
Web o sppt
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOS
 

Similar to Debugging webOS applications

How to deploy node to production
How to deploy node to productionHow to deploy node to production
How to deploy node to productionSean Hess
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
orkaplan
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
Hackito Ergo Sum
 
Coding for production
Coding for productionCoding for production
Coding for production
jehiah
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usage
videos
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
Pablo Godel
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsWO Community
 
php & performance
 php & performance php & performance
php & performance
simon8410
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
Tomas Doran
 
Here Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingHere Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript Debugging
FITC
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
Rami Sayar
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
Olve Hansen
 
Launch Impossible Current State of Application Control Bypasses on ATMs.
Launch Impossible Current State of Application Control Bypasses on ATMs.Launch Impossible Current State of Application Control Bypasses on ATMs.
Launch Impossible Current State of Application Control Bypasses on ATMs.
Payment Village
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
 
2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD
Simon Bennetts
 
Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Puppet
 
Monitoring your WebObjects apps
Monitoring your WebObjects appsMonitoring your WebObjects apps
Monitoring your WebObjects appsWO Community
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customization
jasondenning
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NoSuchCon
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 

Similar to Debugging webOS applications (20)

How to deploy node to production
How to deploy node to productionHow to deploy node to production
How to deploy node to production
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Coding for production
Coding for productionCoding for production
Coding for production
 
4. open mano set up and usage
4. open mano set up and usage4. open mano set up and usage
4. open mano set up and usage
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systems
 
php & performance
 php & performance php & performance
php & performance
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014
 
Here Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingHere Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript Debugging
 
FITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript DebuggingFITC - Here Be Dragons: Advanced JavaScript Debugging
FITC - Here Be Dragons: Advanced JavaScript Debugging
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java bin
 
Launch Impossible Current State of Application Control Bypasses on ATMs.
Launch Impossible Current State of Application Control Bypasses on ATMs.Launch Impossible Current State of Application Control Bypasses on ATMs.
Launch Impossible Current State of Application Control Bypasses on ATMs.
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD
 
Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)
 
Monitoring your WebObjects apps
Monitoring your WebObjects appsMonitoring your WebObjects apps
Monitoring your WebObjects apps
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customization
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 

Recently uploaded

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 

Recently uploaded (20)

Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 

Debugging webOS applications

  • 1. Debugging webOS Applications Steve Lemke webOS Tools Engineering April 23, 2010
  • 2. About Me • Tools Engineer at Palm • Palm (webOS) Emulator • Internal and external SDK/PDK tools • Previously • Palm Computing (acquired by US Robotics) • US Robotics (acquired by 3Com) • 3Com (spun out Palm Inc.) • Palm Inc. (spun out PalmSource) • PalmSource (acquired by Access Systems)
  • 3. Overview • General Connectivity • JavaScript Logging • Palm Inspector and WORM • Host Mode for WebKit Inspector • Command Line Debugging • Ares Debugger • Emulator Tips and Tricks • Command Line Tips • Helpful Resources • Q&A
  • 4. General Connectivity • IP vs. USB • IP over USB is tricky • novacom and novaterm • Default target is most recently connected target • Helpful if you realize it; confusing if not • Leave emulator running • Tip: connect device only when needed, then disconnect • ssh • Built-in to emulator (localhost:5522) • Can be added to device (“pdk-device-install”) • Useful on Windows (Putty) • Can tunnel other ports (but novacom will too)
  • 5. JavaScript Logging • Use “Mojo.Log.Info” instead of “console.log” • Viewing log output: • Good: “novaterm” + “tail -f /var/log/messages” • Better: “palm-log -f com.test.app” • Best: Ares has built-in log viewer
  • 6. JavaScript Logging • To enable logging in framework_config.json: • “loglevel”:99 (enable Mojo.Log.info/warn) • “logEvents”:true (log framework/mouse events) • “timingEnabled”:true (log scene transition timing) • Restore default settings before shipping! • “loglevel”:0 (disable Mojo.Log.info/warn) • “logEvents”:false (no framework/mouse events) • “timingEnabled”:false (no scene transition timing) • MUST change system log level to see info/warn on device! • Default is “error” only • Type: palm-log --system-log-level info
  • 7. Palm Inspector • Launch application with “palm-launch -i <appname>” • Launch “Palm Inspector” app • Type “palm-inspector” on Linux • Emulator only
  • 8.
  • 9. Palm WORM • Launch “palm-worm” app • Live graphs of: • Total DOM nodes • Open service handles • JavaScript heap usage • Emulator only
  • 10.
  • 11. Host Mode for WebKit Inspector • Web server running inside Palm Emulator • Set up a tunnel from host port 5581 • ssh -p 5522 -L 5581:localhost:8080 root@localhost • See hints for Windows tunnel on developer.palm.com • Use Safari (or Chrome) to inspect your app • http://localhost:5581/Apps • http://localhost:5581/PalmApps • Enable “Develop Menu” in Safari: Prefs: Advanced • Right-click and select “Inspect Element”
  • 12.
  • 13. Command Line Debugging • novaterm or ssh to device • Type “debug” to run JavaScript debugger (like gdb) • Hit “enter” to stop/re-start • Common commands: • “help” and “scripts filename.js” • “break /path/to/file.js:<lineno>”, “en exc all” (catch exceptions) • “info break” and “clear <#>” • “c” (continue), “fin” (step out), “next” (step over), “step” (into) • “bt”, “down”, “up”, “frame <#>”, “scope” • “list, “list -” or “list 5,10” • “info args” or “info locals” • “print <expr>” or “set <var> = <expr>”
  • 14. Command Line Debugging • Demo • $ palm-package DebugTest • $ palm-install com.demo.debug_1.0.0_all.ipk • $ palm-launch com.demo.debug • # novaterm • # debug • dbg> <return> • Debugger should display: • break in [anonymous](), [unnamed] line 1 column 1 • Undefined
  • 15. Command Line Debugging • Demo (cont’d) • scripts first-assistant.js (list script path) • b file:///media/…/first-assistant.js:25 (set brkpt) • en exc all (enable exceptions all) • c (continue, trigger brkpt) • bt (backtrace) • l (list) • n (step over, hit exception) • print Mojo.Controller.stageController • set window.scene = Mojo.Controller.stageController.topScene() • p scene • p scene.sceneElement.querySelector('.palm-header').innerHTML • p scene.sceneElement.querySelector('.palm-header').innerHTML=“foo” • c (continue; observe header change) • clear 1 (clear breakpoint; exit debugger)
  • 16. Ares (IDE) Debugger • Better than command-line debugger • Source-level debugging • Integrated log viewer • Interactive console • Don’t have to develop in Ares to debug with it • http://ares.palm.com • Import your project, run, and debug • Use svn (or hg) to avoid re-importing to update
  • 17. Ares (Standalone) Debugger • Stand-alone Ares Debugger (NEW!) • Separate from IDE; no sources needed • Just attach and debug • http://ares.palm.com/AresDebug • Stand-alone Ares Log Viewer • http://ares.palm.com/AresLog • Ares will also be able to debug devices over USB
  • 19. Emulator Tips and Tricks • GPS, Accelerometer, and Audio • GPS info: Search developer.palm.com for “luna-send” • Accelerometer: F5 to shake; F6–F9 to rotate • Sound: http://bit.ly/enableSound • Suspend and Resume works! • Note: Novacom needs 5–10 seconds to reset • VirtualBox GUI app • Renaming (or Deleting) VMs • Prefs: Check for Updates, Auto Capture Keyboard
  • 20. Emulator Tips and Tricks • Palm Emulator supports multiple webOS versions • Current SDK emulator image installed here: • Mac: /Applications/Palm Emulator.app/Contents/Resources/Images • Linux: /opt/PalmSDK/Current/share/emulator/images • Windows: C:Program FilesPalmSDKshareemulatorimages • You may store additional vmdk.zip files here: • Mac: ~/Library/Application Support/Palm/SDK/Images • Linux: ~/.Palm/SDK/Images • Windows: <user>/Local Settings/Application Data/Palm/SDK/Images • Save old vmdk.zip before installing newer SDK
  • 21. Command-Line Tips • Just remember “palm-help” • Shows all available SDK commands • Every command supports --help • Even “palm-help --help” • Try “palm-help --sdk-info” • If emulator won’t boot… • “palm-emulator --list” • “palm-emulator --reset=<vmname>” • If all else fails… • Remove ~/Library/VirtualBox (deletes all VMs!) • “palm-emulator --debug”
  • 22. Helpful Resources • http://developer.palm.com/ • Online docs • Developer forums • Forum search is different from site search • http://www.weboshelp.net/ • (Third party site) • IRC: irc.freenode.net • Firewall blocked? Try port 8000 • Join #webos room
  • 23. Q &A