Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Adds debugging tips #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions android/debugging_tips.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Debugging Tips


### Profiling code snippits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should move this to android/android_guide.md in the "Intermediate topics" section? e.g. I was going to add tips for reading the Android source code.

But it might be harder to find the debugging tips because they'd probably be overlooked.


You easily profile a section of your application programatically starting and stopping the profiler.

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add syntax highlighting:

```kotlin

Debug.startMethodTracingSampling("${context.filesDir}/something.trace", 0, 100)
// Code to profile
Debug.stopMethodTracing()
```

You can then find the results in the *Device File Explorer* under the path `Data > Data > org.mozilla.app.debug > something.trace` and load it in the profiler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Data to lowercase.

Also, I think it's org.mozilla.app.debug/files/something.trace, right?

Also, wonder if we should just make it a path: /data/data/org.mozilla.app.debug/...