appetizerio / replaykit

[DEPRECATED] Command line tools for recording, replaying and mirroring touchscreen events for Android
Apache License 2.0
245 stars 61 forks source link

Cannot Start Trepn Profiler with replaykit #18

Closed danielWatson3141 closed 6 years ago

danielWatson3141 commented 6 years ago

Hi,

I am trying to use replaykit to trigger Trepn Profiler to start profiling. Generally, ADB shell commands work fine. Like this one (my replaykit executable is called starfish):

starfish devices control $target shell input keyevent KEYCODE_WAKEUP

However, this command does not work:

starfish devices control $target shell am broadcast -a com.quicinc.trepn.start_profiling -e com.quicinc.trepn.database_file

And gives me this error:

usage: starfish.exe [-h] [-v VERBOSE] {version,update,trace,adb,devices,plan,insight} ... starfish.exe: error: unrecognized arguments: -a com.quicinc.trepn.start_profiling -e com.quicinc.trepn.database_file trepnTemp

But this command works just fine over adb: adb shell am broadcast -a com.quicinc.trepn.start_profiling -e com.quicinc.trepn.database_file "trepnTemp"

This has been tested and confirmed a problem on Windows and Mac. We can work around this problem by looping through our target list and calling adb commands in stead but this is ugly and time consuming.

Thank you for spending your time on this helpful tool. It has been of use in our research.

mingyuan-xia commented 6 years ago

I think the host shell (Linux/Windows) might misinterpret -a ... as the parameters for starfish. Please try starfish devices control $target shell "am broadcast -a com.quicinc.trepn.start_profiling -e com.quicinc.trepn.database_file". This will help to send am broadcast ... as a whole to the device. I will add this usage to README later.

danielWatson3141 commented 6 years ago

Indeed that works perfectly on Windows.Will test Linux later. Thanks!