|Version 13 (modified by 3 years ago) ( diff ),|
Remote Debugging on Android Device
If you have an Android phone available for development, you can remote-debug the app.
- With the device connected to your computer via USB, open Google Chrome on your computer.
- Start the developer console (Ctrl-Shift-I), open the "More"-menu (three dots on the right), and select "Remote Devices" (under "More tools").
- 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.
- 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.
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)
Access the file live on the device:
# Add extension at the end, if necessary, e.g. .ucce PACKAGE=org.sahanafoundation.eden_mobile FILENAME=emdb.db adb shell run-as $PACKAGE sqlite3 /data/data/$PACKAGE/databases/$FILENAME
Steps to copy the file to your PC:
- Connect your device via USB
- Copy the database file to the SD card (you have an SD card in the phone, don't you?)
- Pull the database file to your development machine
Linux users can use the following script:
#!/bin/bash # Add extension at the end, if necessary, e.g. .ucce 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 run-as $PACKAGE 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: