How to create Huawei Android Emulator

后端 未结 4 2051
执笔经年
执笔经年 2021-01-03 19:41

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

相关标签:
4条回答
  • 2021-01-03 20:14

    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:

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

    0 讨论(0)
  • 2021-01-03 20:15

    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

    0 讨论(0)
  • 2021-01-03 20:18

    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;

    Updated Link https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-clouddebug-realtimedebug

    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.

    0 讨论(0)
  • 2021-01-03 20:18

    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!

    0 讨论(0)
提交回复
热议问题