11

I would like to know if there is any effective way to test an app for Huawei Store using an Android Studio emulator.

I tried disabling the Google Play Services, but for some reason Retrofit requests stopped working :/

Augusto Carmo
  • 4,386
  • 2
  • 28
  • 61

3 Answers3

6

You can use Cloud Debugging of AppGallery Connect to test your app for Huawei Devices. Cloud Debugging tests your app using mainstream Huawei devices provided by Huawei. You can run your app on the latest and most popular Huawei devices to test app functions.

  • Work with Cloud Debugging
  1. Sign in to AppGallery Connect and select My projects.
  2. Select an app to be tested.
  3. Go to Quality > Cloud Debugging.
  4. Filter devices by Series, Android version, EMUI version, and Resolution.
  5. In the Apply for device model dialog box that is displayed, set Debug duration based on your needs. The options are 30 min, 1 h, and 2 h.
  6. Wait for the device initialization to finish.
  7. Click the Debugging tab.
  8. Click Upload to upload an APK.
  9. Check the APK upload progress and install the APK after the upload is complete.
  10. In the displayed dialog box indicating that the app is being installed, click OK. When the installation is complete, you can see the app icon on the device screen on the left.
  11. Operate the device by moving or clicking your cursor on the device screen, or clicking the power button, home button, menu button, or back button. The device will respond like your own phone.

Check Screenshot below: enter image description here

You can check out the official documentation for a more complete answer.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • Thanks to the above I'm getting closer to being able to use this AppGallery as a testing platform. I'll point out I'm still in the opening bits of being able to try it as first you have to essentially create and identity in AppGallery and then become certified by uploading a photo of your ID (driver license, like) and a bank document (credit card, like). That's taken two business days; I'll keep you informed of anything else. My main aim is to upload and app and try it out on their devices with their OS levels. – Joel Butler Oct 27 '21 at 19:03
2

Well, I was trying here to make Retrofit work in this condition and I found a way. I don't know if it is the best solution, but I will post it anyway.

  • disable the Google Play Services;
  • force stop your app;
  • restart the emulator;
  • check if it is working now (if not, try to force stop your app again).

P.S.: Google Play Services is not re-enabled upon reboot.

Augusto Carmo
  • 4,386
  • 2
  • 28
  • 61
  • Hey, @DanielSouza. Thanks a lot for your reply. I have just tried it here and it really worked! Retrofit is working now with the Google Play Services disabled. I'll just not mark this answer as correct for now to see if there is a best answer for that. Again, thanks a lot for your effort. – Augusto Carmo Aug 12 '20 at 19:54
2

For most cases, you can simply grab HMS Core APK and install it on emulator or physical device

You do not need for most cases Huawei device. Here is my battle-tested solution.

If you're implementing HMS (Huawei Mobile Services) feature like push notifications, sms retrieving or auth(orization) you can do simply:

  1. Grab HMS Core APK from: https://www.huaweicentral.com/download-the-latest-huawei-mobile-services-apk/
  2. Create new or run existing Android emulator via Android Studio or ADB
  3. Install HMS Core APK downloaded from 1.
  4. Go to Settings -> Apps & Notifications
  5. Make sure that HMS Core has required permissions like SMS for SMS retrieving or push notifications
  6. If you forget about 5., HMS library will return exception "Permissions not enabled"

I am pretty sure that instead of emulator you can use any of physical devices, grab APK and install HMS Core on it.

From: https://stackoverflow.com/a/63790263/4730812

Happy coding!

piotrek1543
  • 19,130
  • 7
  • 81
  • 94
  • Thanks for that solution. It's worked and really saved my time. Note: If anyone uses Samsung as a physical testing device Huawei core services (latest version from Google play) crashing, you should use this version of Huawei core services: https://www.apkmirror.com/apk/huawei-internet-services/huawei-mobile-services/huawei-mobile-services-4-0-0-331-release/huawei-mobile-services-4-0-0-331-android-apk-download/ – Aydın Ahmed Nov 22 '21 at 10:39