wiki:DeveloperGuidelines/EdenMobile/Debugging

Version 11 (modified by Fran Boon, 4 years ago) ( diff )

--

EdenMobile Debugging

Remote Debugging on Android Device

If you have an Android phone available for development, you can remote-debug the app.

  1. With the device connected to your computer via USB, open Google Chrome on your computer.
  2. Start the developer console (Ctrl-Shift-I), open the "More"-menu (three dots on the right), and select "Remote Devices" (under "More tools").
  3. In the left column of the dialog that opens, you will see all USB devices which are currently connected (so you should find your phone there too). If the entry for the phone shows "pending authorization", then you must enable USB debugging on the phone.
  4. Click on the entry for your phone, then choose "Inspect" for the EdenMobile app.

Now you will see the live screen of the app on your phone in the Chrome window, and you have the full Chrome developer console including HTML inspect, JS debugging with break points, single-stepping etc, to debug the app live on your phone. You can also interact with the app screen in the Chrome window.

See also: https://developers.google.com/web/tools/chrome-devtools/remote-debugging

Database on Android Device

To be able to view the EdenMobile database on an Android device, make sure that:

  • the App is built with debug-option
  • you have the Android Debug Bridge adb installed on your computer (part of the Android SDK)
  • the device allows USB debugging (Settings=>Developer Options)

Steps:

  1. Connect your device via USB
  2. Copy the database file to the SD card (you have an SD card in the phone, don't you?)
  3. Pull the database file to your development machine

Linux users can use the following script:

#!/bin/bash
PACKAGE=org.sahanafoundation.eden_mobile
FILENAME=emdb.db
adb shell run-as $PACKAGE chmod 777 /data/data/$PACKAGE/databases/
adb shell run-as $PACKAGE chmod 777 /data/data/$PACKAGE/databases/$FILENAME
adb shell cp /data/data/$PACKAGE/databases/$FILENAME /sdcard/
adb pull /sdcard/$FILENAME

(Windows users analogously, just not /bin/bash then ;))

Then use e.g. SQLiteBrowser to browse the database schema and data:

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.