-->![Set up your android development environment mac Set up your android development environment mac](/uploads/1/2/6/3/126370503/301760782.png)
After selecting a branch, follow the appropriate instructions below to set up your build environment. Setting up a Linux build environment. These instructions apply to all branches, including master. The Android build is routinely tested in house on Ubuntu LTS (14.04) and Debian testing. Set Up Your Android Development Environment What You’ll Learn. In this step, you’ll learn. On Windows, Android is required for Mobile SDK development. On Mac OS X, if you don’t intend to support the Android platform, you can skip this section. Your Android development environment is ready for Mobile SDK native app development.
Before you can build your first skill, you need to set up your development environment. Here are a few things you may need to do:
- Set up access to cloud resources, as listed below.
- Make sure your PC or Mac has the necessary development tools and operating system version.
Important
Cortana currently supports only one locale: U.S. English (en-US).
- Set up Cortana on your machine.
- Optionally, set up your Android or iOS mobile device, or Harman Kardon Invoke speaker, to work with Cortana.
Step 1 - Set up cloud resources
Developing a Cortana skill requires a variety of cloud resources. For example, you need a Microsoft account in order to register your skill and connect it to Cortana. If you don't already have a Microsoft account, go to the Microsoft Account website to sign up for one.
Note
To develop a Cortana skill, you must use a Microsoft account rather than an Azure Active Directory (Azure AD) organizational account, such as an account associated with Office 365.
Other resources include:
- Bot Framework. To create a Cortana skill, you must first create a bot. Once the bot is working, sign into the Bot Framework Developer Portal using your Microsoft account, register the bot, and connect it to the Cortana channel to make it a Cortana skill.
- LUIS (Language Understanding Intelligent Service). Sign into LUIS.ai using your Microsoft account. This will allow you to create and manage LUIS applications that let you use language understanding technology in your Cortana skill.
- A cloud hosting service. Optionally, you can use a cloud hosting service such as Microsoft Azure. This is required if you want to want the skill to be available to Cortana using a web address.
Step 2 - Set up your PC, Mac, or Cortana device
You can develop a Cortana skill on either a Mac or a PC running Windows 10 Anniversary Update (build 1607), using your choice of development tools. The only requirement is that you have installed the Microsoft Bot Framework SDK.
Although you can use any development environment, Microsoft Visual Studio offers a variety of useful tools and features, including Bot Application, Bot Controller, and Bot Dialog templates. For information about installing Visual Studio, see Install Visual Studio 2019.
Note
The Bot Builder SDK for .NET currently supports C#. Visual Studio for Mac is not supported.
For either a Mac or PC environment, install the Bot Framework Emulator to be able to view and test your bot in action before registering it and connecting it to the Cortana channel.
If you are developing your skill on a Mac, or developing for an iOS, Android, or Harman Kardon Invoke device, you also need to set up the device where Cortana invokes the skill. Since Cortana is not available in a Mac environment, skills developed in a Mac environment must be invoked on a mobile device or in a virtual machine environment running Windows.
Step 3 - Set up Cortana
Make sure Cortana is set up to work with your skill:
- You must be signed into Cortana on your computer or device with your Microsoft account.
- Make sure the microphone on your computer or device is working and turned on so that you can speak to Cortana.
- Optionally, set debug mode under Cortana channel configuration through Azure Portal. When you invoke a Cortana skill in debug mode, Cortana gives you additional information that you can use fine-tune the skill.
Step 4 - Set up your Cortana device (optional)
Cortana is installed automatically on Windows devices, but if you want to use your skill on iOS or Android devices, you'll need to download the Cortana app from the device's app store. Sign into Cortana using the same Microsoft account that you used to register the skill.
Since Cortana is built into the Harman Kardon Invoke, you only need to sign into Cortana using the Microsoft account used to register the skill.
When building an Android app, it's important that you always test your app ona real device before releasing it to users. This page describes how to set upyour development environment and Android device for testing and debugging overan Android Debug Bridge (ADB) connection.
Note: Use the Android emulator to test your app ondifferent versions of the Android platform and different screen sizes. Alsoconsider using Firebase Test Labto run your app on a wide variety of real devices hosted in acloud-based infrastructure.Set up a device for development
Before you can start debugging on your device, there are a few things you mustdo:
- On the device, open the Settings app, select Developer options, andthen enable USB debugging.Note: If you do not see Developer options, follow the instructions toenable developer options.
- Set up your system to detect your device.
- macOS: No additional configuration required.
- Ubuntu Linux: Use
apt-get install
to install theadb
package. Thisgives you a community-maintained default set ofudev
rules for all Androiddevices.Make sure that you are in the plugdev group. If you see the followingerror message, adb did not find you in the plugdev group:Useid
to see what groups you are in. Usesudo usermod -aG plugdev$LOGNAME
to add yourself to the plugdev group.The following example shows how to install the Android adb tools package. - Windows: Install a USB driver for ADB. For an installation guide andlinks to OEM drivers, see the Install OEM USB driversdocument.
- Chrome OS: No additional configuration required.
Connect to your device
When you are set up and plugged in over USB, you can click Run in Android Studio to build and run your app on the device.
You can also use adb to issue commands,as follows:
- Verify that your device is connected by running the
adb devices
commandfrom yourandroid_sdk/platform-tools/
directory. Ifconnected, you'll see the device listed. - Issue any adb command withthe
-d
flag to target your device.
Troubleshoot device connection with the Connection Assistant
The Connection Assistant provides step-by-step instructions to help you set upand use a device over the ADB connection.
To start the assistant, choose Tools > Connection Assistant.
The Connection Assistant provides instructions, in-context controls, and a listof connected devices in a series of pages in the Assistant panel. Use theNext and Previous buttons at the bottom of the Assistant panel towork through the pages as needed:
- Connect your device over USB: The Connection Assistant begins by promptingyou to connect your device over USB, and it provides a Rescan USB devicesbutton with which you can start a new scan for connected devices.
- Enable USB debugging: The Connection Assistant then tells you how toenable USB debugging in the on-device developer options.
- Restart the ADB server: Finally, if you still don't see your device on thelist of available devices, you can use the Restart ADB server button on thelast page of the Connection Assistant. Restarting the ADB server also causesADB to scan for devices again. If you still don't see your device on the listof available devices, try the troubleshooting steps in the next section of thispage.
Resolve USB connection issues
If the Connection Assistant is not detecting your device over USB, you can trythe following troubleshooting steps to resolve the issue:
Check that Android Studio can connect to the Android Emulator
To check if the issue is being caused by a connection problem between AndroidStudio and the Android Emulator, follow these steps:
- Open the AVD Manager.
- Create a new AVD if you don't alreadyhave one.
- Run the emulator using your AVD.
- Do one of the following:
- If Android Studio can't connect to the emulator, download the latest SDK Platform Toolsand then try again.
- If the emulator starts successfully, check the USB cable.
Check the USB cable
To check if the issue is being caused by a faulty USB cable, follow the steps inthis section.
If you have another USB cable:
- Connect the device using the secondary cable.
- Check if the Connection Assistant can now detect the device.
- If the device is not detected, try the primary cable again.
- If the device still isn't detected, assume that the problem is with thedevice and check if the device is set up for development.
If you don't have another USB cable but you do have another Android device:
- Connect the secondary device to your computer.
- If the Connection Assistant can detect the secondary device, assume that theproblem is with the primary device andcheck if the device is set up for development.If the secondary device is not detected, the problem might be with the USBcable.
Check if the device is set up for development
To check if the issue is being caused by settings on the device, follow thesesteps:
- Follow the steps in the Set up a device for developmentsection.
- If this does not resolve the problem, contact the device OEM'scustomer support for help. Tell the customer support representative that thedevice won't connect to Android Studio using ADB.
![Set up your android development environment mac Set up your android development environment mac](/uploads/1/2/6/3/126370503/301760782.png)
RSA security key
When you connect a device running Android 4.2.2 (API level 17) or higher to yourcomputer, the system shows a dialog asking whether to accept an RSA key thatallows debugging through this computer. This security mechanism protects userdevices because it ensures that USB debugging and other adb commands cannot beexecuted unless you're able to unlock the device and acknowledge the dialog.