Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flashlight CLI crashes locally using Android 10 device with release app #307

Open
anton-patrushev opened this issue Jul 19, 2024 · 4 comments

Comments

@anton-patrushev
Copy link

I just followed README and downloaded [email protected]

I tried to run flashlight measure and it successfully launched the local web app on the localhost:3000
I also can successfully fetch the Auto Detect app bundle id.

But as soon as I press on Start Measuring — it fails in the CLI and shows an alert:
Here is my CLI log:

➜  ~ flashlight measure
[13:54:21] ℹ️  Installing C++ profiler for arm64-v8a architecture
[13:54:21] ✅  C++ Profiler installed in /data/local/tmp/BAMPerfProfiler

 Flashlight web app running on: http://localhost:3000

/snapshot/flashlight-cloud/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: Command failed: adb shell atrace --async_stop
    at checkExecSyncError (node:child_process:820:11)
    at Object.execSync (node:child_process:891:15)
    at execSync (pkg/prelude/bootstrap.js:2111:30)
    at AndroidProfiler.startATrace (/snapshot/flashlight-cloud/flashlight-open-source/packages/platforms/android/dist/src/commands/platforms/AndroidProfiler.js:62:38)
    at AndroidProfiler.installProfilerOnDevice (/snapshot/flashlight-cloud/flashlight-open-source/packages/platforms/android/dist/src/commands/platforms/AndroidProfiler.js:28:18)
    at AndroidProfiler.getCpuClockTick (/snapshot/flashlight-cloud/flashlight-open-source/packages/platforms/android/dist/src/commands/platforms/UnixProfiler.js:95:14)
    at AndroidProfiler.pollPerformanceMeasures (/snapshot/flashlight-cloud/flashlight-open-source/packages/platforms/android/dist/src/commands/platforms/UnixProfiler.js:123:90)
    at PerformanceMeasurer.<anonymous> (/snapshot/flashlight-cloud/flashlight-open-source/packages/commands/test/dist/PerformanceMeasurer.js)
    at Generator.next (<anonymous>) {
  status: 255,
  signal: null,
  output: [ null, null, null ],
  pid: 5608,
  stdout: null,
  stderr: null
}

Node.js v18.5.0
➜  ~

And this is a pretty generic alert I see in the web app
image

I found one similar issue in this repo, but I think:

  1. it's a pretty old one since I'm not using Flipper (and I can't) since I need to have a connection to the Release app.
  2. it's not relevant to me, more info below

Here is the issue link: #103

I tried a few suggestions from that issue, and here is my results:

➜  ~ adb devices
List of devices attached
a7276a2c	device

➜  ~ ps | grep "adb shell"
 5699 ttys001    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn --exclude-dir=.idea --exclude-dir=.tox adb shell
➜  ~ adb shell atrace --async_stop
Error: Did not find trace folder
No trace folder found
➜  ~
@anton-patrushev anton-patrushev changed the title Flashlight CLI crashes locally using Android 10 devices with release app Flashlight CLI crashes locally using Android 10 device with release app Jul 19, 2024
@anton-patrushev
Copy link
Author

@Almouro would you be able to take a look 🙏 ?

@Almouro
Copy link
Member

Almouro commented Jul 23, 2024

Hi @anton-patrushev, that's quite weird!

The error seems to be coming from here in the Android source code
It checks for one of those folders:

  • /sys/kernel/debug/tracing/
  • /sys/kernel/tracing/

What's your device model and Android version?

@anton-patrushev
Copy link
Author

it's a pretty old and custom one 😅

Model: Xiaomi Redmi Note 5
Android OS: 10

But it has a custom OS since I reset MIUI and re-install a Pixel-like OS on this device 😅

Does it make sense to try to connect this device to the Android Studio profiler and see if it's a device-specific issue or a Flashlight edge case?

cc: @Almouro

@Almouro
Copy link
Member

Almouro commented Jul 24, 2024

Hmm the fact that it's custom might be why indeed 🤔

We only use atrace to measure FPS, so I'm not sure if Android Studio profiler uses it, you could try running a system trace from "Profiler" > Click on CPU graph > Record system trace

I'm guessing running a trace with Perfetto would fail as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants