Health Timeout
Health Timeout

Reputation: 19

Detect heart rate in WEAR OS Emulator in Android Studio

How to Detect heart rate in WEAR OS Emulator in Android Studio

The code I am trying does not give errors, but I cannot see the heart rate in the emulator. I am using wearos3 and Android API 30 Is it possible to detect heart rate in emulators or not? I am using synthetic exercise commands

adb shell am broadcast \ -a "whs.synthetic.user.START_RUNNING" \ com.google.android.wearable.healthservices
Broadcasting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x400000 pkg= -a }
Broadcast completed

Can you please share suggestions?

Detect heart rate in emulator in android studio

Upvotes: 0

Views: 107

Answers (1)

Gustavo Pagani
Gustavo Pagani

Reputation: 6988

Yes, according to this Simulate sensor data with Health Services:

If you're testing on an emulator running Wear OS 3, you can also use synthetic data to test your app.

Have you followed the steps described in Enable synthetic data generation?

  1. Enable developer options.
1. Open the watch's Settings.
2. Tap System > About > Versions.
3. Tap the Build number item seven times.
4. A message appears confirming that you are now a developer.
  1. Issue the following adb command to enable synthetic mode:
adb shell am broadcast \
-a "whs.USE_SYNTHETIC_PROVIDERS" \
com.google.android.wearable.healthservices

Upvotes: 0

Related Questions