Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any effective way to test an app for the Huawei Store using Android Studio emulator?

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 :/

like image 723
Augusto Carmo Avatar asked Aug 12 '20 18:08

Augusto Carmo


People also ask

How do you test an app on an emulator?

Run your app on the emulatorIn the toolbar, select the AVD that you want to run your app on from the target device drop-down menu. Click Run. The emulator might take a minute or so to launch for the first time, but subsequent launches will use a snapshot and should launch faster.

Can Huawei apps run on Android?

Huawei's Phone Clone app is an excellent way of porting applications from a Google Play-enabled device. It won't work for all apps, but it's effective. All Huawei smartphones have this pre-installed, but you will need a separate, Google-Play-enabled device for this to work.

Can I run an APK in Android Studio?

Or, if you already have a project open, click File > Profile or Debug APK from the menu bar. In the next dialog window, select the APK you want to import into Android Studio and click OK. Android Studio then displays the unpacked APK files, similar to figure 1.


2 Answers

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!

like image 195
piotrek1543 Avatar answered Sep 19 '22 16:09

piotrek1543


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.

like image 35
shirley Avatar answered Sep 23 '22 16:09

shirley