Permalink
Browse files

Use /data/data/$procname/$procname.trace on Android

So that applications with apitrace built-in with WRITE_EXTERNAL_STORAGE
permission can write traces on non-rooted devices too.

See issue #149.
  • Loading branch information...
1 parent b4051e3 commit 888112983ef9564b3a9d15699faa17c337d3942b @amonakov amonakov committed with jrfonseca Jul 2, 2013
Showing with 5 additions and 6 deletions.
  1. +3 −5 Dalvik.markdown
  2. +2 −1 common/trace_writer_local.cpp
View
@@ -36,12 +36,10 @@ use `-S` flag to `am start`:
adb shell am start -S $PROCNAME
Use `adb logcat \*:S apitrace` to examine apitrace debug output. Trace files
-are saved into '/data/' directory by default:
+are saved into '/data/data/$PROCNAME' directory by default:
- adb pull /data/$PROCNAME.trace
- adb shell rm /data/$PROCNAME.trace
-
-(you need to `chmod 0777 /data` beforehand).
+ adb pull /data/data/$PROCNAME/$PROCNAME.trace
+ adb shell rm /data/data/$PROCNAME/$PROCNAME.trace
Injecting tracing library globally
@@ -94,7 +94,8 @@ LocalWriter::open(void) {
process.trimDirectory();
#ifdef ANDROID
- os::String prefix = "/data";
+ os::String prefix = "/data/data";
+ prefix.join(process);
#else
os::String prefix = os::getCurrentDir();
#endif

0 comments on commit 8881129

Please sign in to comment.