46

I'm developing an Android app using Huawei's Push service. I have installed DevEco IDE plugin within Android Studio. But I don't have any Huawei device to test. So my question is that there is any Huawei's Android phone emulator or not for Windows PC. So, I can test and debug app. Thanks in advance.

Android Geek
  • 573
  • 1
  • 4
  • 7

4 Answers4

24

Huawei provides cloud debugging functionality for Huawei developers as a free service.

If you use Huawei SDKs, you should have Huawei Developer Account. Just need to login Huawei developer console and follow below instruction;

Enables real-time debugging of apps on remote Android devices. Service Introduction

For details about how to use Cloud Debugging in your IDE, please refer to the HMS Toolkit Development Guide.

This functionality is really simple to use, The cloud debugging function allows for remote debugging on real devices. In the debugging process, you can view device information, upload and install your APK to the remote devices, obtain operation logs, and save the logs to your local computer for analysis.

AnasSafi
  • 5,353
  • 1
  • 35
  • 38
MSalihKarakasli
  • 422
  • 3
  • 13
  • Does it work at all ? I don't see any device in the Cloud Debugging tool – Javier Delgado Jan 29 '20 at 19:39
  • Yes, I used many times to test my apps. As I know, the feature is in Beta now, so you may not reach that moment. I tried today, it seems is fine. – MSalihKarakasli Feb 03 '20 at 12:23
  • 2
    This is a dead link – VelocityPulse Apr 04 '20 at 16:51
  • @MSalihKarakasli Thanks a lot ! – VelocityPulse Apr 22 '20 at 12:32
  • 4
    For a Huawei Developer Account, you are required to give them an ID image and a bank document. I don't trust Huawei so much...! – M. Marmor Nov 22 '20 at 10:05
  • @M.Marmor, Actually this information requested by Huawei because of security. You cannot find fake or dummy accounts or harmful applications in Huawei App Gallery thanks to this approach. After verification, your information will be deleted. So this is for you not for Huawei. – MSalihKarakasli Nov 23 '20 at 15:21
  • 2
    @M.Marmor Yes, I just halted my registration process because of that, I mean seriously Huawei? Who would create a developer account on Huawei if they ask for such information – beginner Feb 27 '21 at 05:50
12

If you don't have Huawei devices to test your apps, 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. Besides, you can debug apps on two real devices at the same time using one HUAWEI ID. Assume that you have applied for a device successfully.

  • 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 the screenshot below: Cloud Debugging of AGC

From: https://stackoverflow.com/a/63877454/13329100

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • You have to sign in first and after to sign in again as a developer in order to get access to cloud debugging and it's asking for documents like passport, ID etc... Really now? Please correct your instructions. – Nick Mar 07 '21 at 01:26
  • yes@Nick,As I said above, you need to sign in to [AppGallery Connect](https://developer.huawei.com/consumer/en/service/josp/agc/index.html#/) before using Cloud Debugging. – zhangxaochen Mar 08 '21 at 02:10
  • I don't know, uploading your debug build doesn't seem so safe, normally those apks are not protected by any significant means against hackers or containt significiant propietary information (if your app is relevant enough) – htafoya Feb 15 '23 at 18:55
7

If your app depends on any Hardware/Software specific service of Huawei device, using an emulator won't work. Also, Android Studio provides Google's generic Stock image so there's no way to create an emulator with EMUI (Huawei's Custom OS).

Fortunately, Google has Firebase Test Lab where you can test on real (5 tests/day) / virtual (10 tests/day) devices for free. Or you may try a 3rd party emulator like Genymotion

Prokash Sarkar
  • 11,723
  • 1
  • 37
  • 50
5

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.

Happy coding!

piotrek1543
  • 19,130
  • 7
  • 81
  • 94
  • But you will still need an actual device or a proper emulator if you want to use Map Kit for example: [Map kit restrictions](https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/hms-map-v4-abouttheservice) – A.R.H Sep 08 '20 at 13:44
  • Did you tried it already on emulator configured like above or just quoting the HMS Docs? I have no experience with Huawei Maps SDK, only auth, sms and push libraries. For me, Huawei Device means device with HMS Core. For maps I would rather try to use Mapbox, Nokia HERE or any other map service to give users the same experience and avoid missing feature problems – piotrek1543 Sep 08 '20 at 20:52
  • Yes, on emulator and on a Samsung device with HMS apk installed, both did not work. it showed an error in the logcat, and after searching I arrived at the link in my first reply. – A.R.H Sep 10 '20 at 11:57
  • 3
    Just note: provided APKs contains only ARM libraries inside APK, so only ARM devices are compatible – mtrakal Sep 24 '20 at 06:50
  • 1
    So - the question is, are there x86 apk around? Couldn't find any... – Petro Korienev Oct 27 '20 at 17:43
  • @PetroKorienev I downloaded from link above and installed on typical X86 Android Emulator provided with Android Studio 4.0 – piotrek1543 Oct 27 '20 at 20:21
  • 1
    I can confirm this works for testing InAppPurchases SDK from Huawei. You need to also install AppGallery APK , activate a test developer on huawei website, and log this account into AppGallery on the emulator. However what doesn't work yet are test ads. – CaptainCrunch May 31 '21 at 23:37