How to run Viber on Visual Studio Emulator for Android

1124-how_to_run_viber_on_visual_studio_emulator_for_android_s.jpg

Recently I needed to set up a Viber app for the phone number that is not used on a smartphone. Obviously, Viber could be installed as a desktop app but it still requires an app on a mobile device for the same number. The same is true for WhatsApp and some other messengers.

Scenario

Let’s consider Windows 10 (build 1803) with installed Hyper-V role. A user needs Viber and WhatsApp applications and could be able to access emulated device. Also, a user is not a mobile developer so it is necessary just emulate mobile phone without digging too deep inside development stuff. As Android Studio emulator couldn’t be used along with Hyper-V role, Microsoft proposes to use Visual Studio emulator for Android that could be installed as a standalone application. Then required apps will be installed and the emulator will be run by a startup script.

Solution

Applications

Find and download apk files for required applications:

  • download apk file for Viber;
  • download apk file for WhatsApp.

SDK tools

The emulator has its own device images but requires adb.exe to install applications. Download and extract Android command line tools to a folder which path doesn’t include spaces, for example, %ProgramData%\Android\sdk. By using sdkmanager  install platform-tools:

"%ProgramData%\Android\sdk\tools\bin\sdkmanager" "platform-tools"