SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
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

Contenu connexe

En vedette

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 GargentaMarakana 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 ExtensionsSamantha Morra
 
Intro To webOS
Intro To webOSIntro To webOS
Intro To webOSfpatton
 

En vedette (6)

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
 

Similaire à 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.jsorkaplan
 
[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 productionjehiah
 
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 usagevideos
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo 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 & performancesimon8410
 
Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Sensu and Sensibility - Puppetconf 2014
Sensu and Sensibility - Puppetconf 2014Tomas Doran
 
Here Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingHere Be Dragons – Advanced JavaScript Debugging
Here Be Dragons – Advanced JavaScript DebuggingFITC
 
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 DebuggingRami Sayar
 
Docker presentasjon java bin
Docker presentasjon java binDocker presentasjon java bin
Docker presentasjon java binOlve 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 AnsibleRayed Alrashed
 
2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CD2021 ZAP Automation in CI/CD
2021 ZAP Automation in CI/CDSimon 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 customizationjasondenning
 
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 CoreNoSuchCon
 
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 ProductionJoe Ferguson
 

Similaire à 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
 

Dernier

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 

Dernier (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

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