Run android application windows

Тестирование на устройстве или эмуляторе Android Test on an Android device or emulator

Существует несколько способов тестирования и отладки приложения Android с помощью реального устройства или эмулятора на компьютере Windows. There are several ways to test and debug your Android application using a real device or emulator on your Windows machine. В этом разделе описаны некоторые рекомендации. We have outlined a few recommendations in this guide.

Запуск на реальном устройстве Android Run on a real Android device

Чтобы запустить приложение на реальном устройстве Android, сначала необходимо включить устройство Android для разработки. To run your app on a real Android device, you will first need to enable your Android device for development. Параметры разработчика на Android были скрыты по умолчанию, начиная с версии 4,2, и их включение может варьироваться в зависимости от версии Android. Developer options on Android have been hidden by default since version 4.2 and enabling them can vary based on the Android version.

Подготовка устройства к разработке Enable your device for development

Для устройства под управлением последней версии Android 9.0 +: For a device running a recent version of Android 9.0+:

  1. Подключите устройство к компьютеру разработки Windows с помощью USB-кабеля. Connect your device to your Windows development machine with a USB cable. Вы можете получить уведомление для установки драйвера USB. You may receive a notification to install a USB driver.
  2. Откройте экран параметров на устройстве Android. Open the Settings screen on your Android device.
  3. Выберите о телефоне. Select About phone.
  4. Прокрутите вниз и коснитесь пункта номер сборки семь раз, пока вы не станете разработчиком! Scroll to the bottom and tap Build number seven times, until You are now a developer! . is visible.
  5. Вернитесь на предыдущий экран, выберите система. Return to the previous screen, select System.
  6. Выберите Дополнительно, прокрутите вниз и нажмите кнопку Параметры разработчика. Select Advanced, scroll to the bottom, and tap Developer options.
  7. В окне Параметры разработчика прокрутите вниз, чтобы найти и включить отладку по USB. In the Developer options window, scroll down to find and enable USB debugging.

Сведения об устройстве, на котором работает более старая версия Android, см. в разделе Настройка устройства для разработки. For a device running an older version of Android, see Set Up Device for Development.

Запуск приложения на устройстве Run your app on the device

На панели инструментов Android Studio выберите свое приложение в раскрывающемся меню Run Configurations (конфигурации запуска ). In the Android Studio toolbar, select your app from the run configurations drop-down menu.

В раскрывающемся меню целевое устройство выберите устройство, на котором требуется запустить приложение. From the target device drop-down menu, select the device that you want to run your app on.

Читайте также:  Windows c integer types

Выберите запустить ▷. Select Run ▷. Это приведет к запуску приложения на подключенном устройстве. This will launch the app on your connected device.

Запуск приложения на виртуальном устройстве Android с помощью эмулятора Run your app on a virtual Android device using an emulator

Первое, что нужно узнать о запуске эмулятора Android на компьютере Windows, это то, что независимо от интегрированной среды разработки (Android Studio, Visual Studio и т. д.) производительность эмулятора значительно улучшена за счет поддержки виртуализации. The first thing to know about running an Android emulator on your Windows machine is that regardless of your IDE (Android Studio, Visual Studio, etc), emulator performance is vastly improved by enabling virtualization support.

Включить поддержку виртуализации Enable virtualization support

Перед созданием виртуального устройства с помощью эмулятора Android рекомендуется включить виртуализацию, включив компоненты Hyper-V и платформы низкоуровневой оболочки Windows (ВХПКС). Before creating a virtual device with the Android emulator, it is recommended that you enable virtualization by turning on the Hyper-V and Windows Hypervisor Platform (WHPX) features. Это позволит процессору компьютера значительно повысить скорость выполнения эмулятора. This will allow your computer’s processor to significantly improve the execution speed of the emulator.

Для запуска платформы Hyper-V и низкоуровневой оболочки Windows компьютер должен: To run Hyper-V and Windows Hypervisor Platform, your computer must:

  • Доступно 4 ГБ памяти Have 4GB of memory available
  • Наличие 64-разрядного процессора Intel или ЦП AMD ризен с преобразованием адресов второго уровня (SLAT) Have a 64-bit Intel processor or AMD Ryzen CPU with Second Level Address Translation (SLAT)
  • Запустите Windows 10 Build 1803 + (Проверьте номер сборки) Be running Windows 10 build 1803+ (Check your build #)
  • Обновлены графические драйверы (диспетчер устройств > видеоадаптеры, > обновление драйвера) Have updated graphics drivers (Device Manager > Display adapters > Update driver)

Если компьютер не соответствует этим критериям, вы можете запустить гипервизор Intel HAXM или AMD. If your machine doesn’t fit this criteria, you may be able to run Intel HAXM or AMD Hypervisor. Дополнительные сведения см. в статье аппаратное ускорение для производительности эмулятора или в документации по эмулятору Android Studio. For more info, see the article: Hardware acceleration for emulator performance or the Android Studio Emulator documentation.

Убедитесь, что оборудование и программное обеспечение компьютера совместимы с Hyper-V, открыв командную строку и введя следующую команду: systeminfo Verify that your computer hardware and software is compatible with Hyper-V by opening a command prompt and entering the command: systeminfo

В поле поиска Windows (в нижнем левом углу) введите «компоненты Windows». In the Windows search box (lower left), enter «windows features». Выберите Включение или отключение компонентов Windows в результатах поиска. Select Turn Windows features on or off from the search results.

После появления списка компонентов Windows прокрутите экран, чтобы найти Hyper-V (включая средства управления и платформу) и платформу низкоуровневой оболочки Windows, убедитесь, что флажок установлен, чтобы включить обе функции, а затем нажмите кнопку ОК. Once the Windows Features list appears, scroll to find Hyper-V (includes both Management Tools and Platform) and Windows Hypervisor Platform, ensure that the box is checked to enable both, then select OK.

Перезагрузите компьютер при появлении соответствующего запроса. Restart your computer when prompted.

Эмулятор для разработки машинного кода с Android Studio Emulator for native development with Android Studio

При создании и тестировании собственного приложения Android рекомендуется использовать Android Studio. When building and testing a native Android app, we recommend using Android Studio. Когда приложение будет готово к тестированию, вы можете создать и запустить приложение, выполнив следующие действия. Once your app is ready for testing, you can build and run your app by:

Читайте также:  Восстановление почты windows live

На панели инструментов Android Studio выберите свое приложение в раскрывающемся меню Run Configurations (конфигурации запуска ). In the Android Studio toolbar, select your app from the run configurations drop-down menu.

В раскрывающемся меню целевое устройство выберите устройство, на котором требуется запустить приложение. From the target device drop-down menu, select the device that you want to run your app on.

Выберите запустить ▷. Select Run ▷. Запустится Android Emulator. This will launch the Android Emulator.

После установки приложения на устройстве эмулятора можно использовать параметр Применить изменения для развертывания определенных изменений кода и ресурсов без создания нового apk. Once your app is installed on the emulator device, you can use Apply Changes to deploy certain code and resource changes without building a new APK.

Эмулятор для кросс-платформенной разработки с помощью Visual Studio Emulator for cross-platform development with Visual Studio

Для компьютеров с Windows доступно множество вариантов эмулятора Android . There are many Android emulator options available for Windows PCs. Мы рекомендуем использовать эмулятор AndroidGoogle, так как он предоставляет доступ к последним образам ОС Android и Google Play службам. We recommend using Google’s Android emulator, as it offers access to the latest Android OS images and Google Play services.

Установка эмулятора Android с помощью Visual Studio Install Android emulator with Visual Studio

Если вы еще не установили его, скачайте Visual Studio 2019. If you don’t already have it installed, download Visual Studio 2019. Используйте Visual Studio Installer, чтобы Изменить рабочие нагрузки и убедиться, что у вас есть Рабочая нагрузка для разработки мобильных приложений на .NET. Use the Visual Studio Installer to Modify your workloads and ensure that you have the Mobile development with .NET workload.

Создайте новый проект. Create a new project. После настройки Android Emulatorможно использовать Android Device Manager для создания, дублирования, настройки и запуска различных виртуальных устройств Android. Once you’ve set up the Android Emulator, you can use the Android Device Manager to create, duplicate, customize, and launch a variety of Android virtual devices. Запустите Android Device Manager из меню Сервис с помощью средства: инструменты > Android > Android Device Manager. Launch the Android Device Manager from the Tools menu with: Tools > Android > Android Device Manager.

После открытия Android Device Manager выберите + создать , чтобы создать новое устройство. Once the Android Device Manager opens, select + New to create a new device.

Необходимо присвоить имя устройству, выбрать тип базового устройства из раскрывающегося меню, выбрать процессор и версию ОС, а также несколько других переменных для виртуального устройства. You will need to give the device a name, choose the base device type from a drop-down menu, choose a processor, and OS version, along with several other variables for the virtual device. Дополнительные сведения см. Android Device Manager главном экране. For more information, Android Device Manager Main Screen.

На панели инструментов Visual Studio выберите Отладка (присоединяется к процессу приложения, выполняемому в эмуляторе после запуска приложения) или режим выпуска (отключает отладчик). In the Visual Studio toolbar, choose between Debug (attaches to the application process running inside the emulator after your app starts) or Release mode (disables the debugger). Затем выберите виртуальное устройство в раскрывающемся меню устройство и нажмите кнопку Play ▷ ( воспроизвести ), чтобы запустить приложение в эмуляторе. Then choose a virtual device from the device drop-down menu and select the Play button ▷ to run your application in the emulator.

How to Run Android Apps in Windows 10 [Updated]

Update 8/24/202o: After a few weeks in beta, the new Your App update is rolling out publicly for Windows 10, and it looks like Microsoft is extending the feature to include non-Samsung devices as well . This article has been updated to reflect those changes.

One of the coolest announcements Samsung displayed at its Unpacked 2020 event was new functionality coming to the Your Phone app on Windows 10 that will give you full control of your Android device on PC.

Читайте также:  Auslogics windows slimmer portable

The Your Phone app already lets Android users view notifications, texts and files on their Windows 10 PC , but many Android devices can now run apps and mirror the device’s screen directly to your PC’s desktop. The list of compatible phones only includes Samsung devices at the moment , but Microsoft says further device support is rolling out and will continue expanding over time.

Android apps will behave like a native Windows application; they run in their own app windows and can be pinned to your Windows taskbar and Start menu. And since everything runs off your phone, you won’t need to install the apps on your PC. You can even mirror your device’s main screen in a separate window on your desktop while other apps are running.

The Best Pre-Order Deals for the Samsung Galaxy Note 20 Phones

Most pre-orders go live tonight for the new Samsung Galaxy Note 20 and Galaxy Note 20 Ultra…

Only select phones—like the Samsung Note 20 and Note 20 Ultra —will be able to run multiple apps simultaneously on desktop, but the other features will work on supported devices running Android 9 pie or higher and can be linked to Windows 10 via the Your Phone app.

How to connect your Android phone to Windows 10

The new Your App features entered beta in early August, but should now be available to users who have installed Windows 10 version 1809 or later. The exact availability of the feature will vary for all users, but here’s how to connect your Android phone to Windows 10 once you receive the update:

  1. Make sure your phone and PC are on and connected to the same wifi network.
  2. Install the Your Phone app on your Windows 10 PC ( Microsoft Store ).
  3. Run the app and sign in with your Microsoft account when prompted.

From here, things will work slightly differently based on your device’s OEM.

  • For Samsung users: Swipe down on the screen to open the quick-access menu and tap the “Link to Windows” icon. Sign in with your Microsoft account again, then follow the on-screen instructions.
  • For other Android devices: refer to this guide for connecting your Android phone to Windows 10 .

How to open and control Android apps in Windows:

Once your phone and PC are connected, the Your Phone app window should appear on your desktop. Here’s how to open your apps on desktop:

  1. Click the “Apps” shortcut from the left-hand menu to see a list of all applications installed on your device.
  2. Click an app from the list to run it on your PC (note: some apps may not have full keyboard/mouse support, and may have visual/audio display errors).
  3. You can also click “Open Phone’s Screen” to mirror the device’s screen in a separate window.

Once the app is open on your desktop, you can drag it around or swap to other programs, as with any other Windows 10 application window. To control the apps on desktop:

Оцените статью