- How to install the Android SDK on Windows, Mac and Linux
- What to choose?
- Manually installing the Android SDK
- Prerequisites
- Installing the tools
- Setting your PATH
- On Windows
- On a Mac
- On Linux
- Wrapping it up
- Have you listened to this week’s Android Central Podcast?
- Samsung needs to bring back its iPod competitor
- VoLTE: How to use it and why you should care
- PlayStation reportedly planning service to compete with Xbox Game Pass
- These are the best USB-C cables you can find for Android Auto
- Как настроить Android Studio на вашем Mac (и почему вы этого хотите)
- Зачем беспокоиться с Android?
- Затмение с ADT или Android Studio?
- Начало работы с Android Studio
- Добавление пакетов SDK
- Портирование приложений iOS на Android
How to install the Android SDK on Windows, Mac and Linux
Source: Android Central
Most of us will never need to install the Android SDK. The reason why is right in the name — Software Development Kit. It’s built for people writing Android apps who need tools to work with Android from a computer.
But those tools can also be handy for folks wanting to do some more advanced stuff. Stuff like manually updating software or rooting their phone. Fastboot and ADB are vital if you’re into «hacking» at the Android software. And Google provides it free for everyone.
What to choose?
There are two ways to get a working set of Android tools on your computer. The easy way is just to install Android Studio. Everything needed to run and use the Android command line tools is part of Android Studio, as well as a way to keep the tools updated. While it’s designed for folks who want a complete development environment and includes a code editor, Android emulator, and compiler, you can use just the command line tools and never open the rest.
If you’re not afraid to get your feet wet, you can install just the SDK components outside of Android Studio. Installing them is easy (they’re inside a zip file), but setting up your computer to use them isn’t a straightforward process.
Manually installing the Android SDK
Source: Android Central
Download the SDK direct from Google by clicking here. Scroll down a bit and find the section marked «Get just the command line tools» and save it somewhere easy to get to, like your desktop. We’ll be extracting it to a better location in the next step.
The file you downloaded is compressed. You’ll need to be familiar with compressed files — and how to extract them — to go any further. If you’re not, stop here and spend the time to learn about them.
Extract your compressed file into the following location:
- Windows: The root of your C: drive
- OS X: Your home folder
- Linux: Your home folder
Rename the extracted folder to «Android». This will make the rest of this guide, and your time with the SDK, much easier.
Prerequisites
Source: Android Central
You’ll need a working version of Java to run the SDK components. For most things, you’ll be doing with the SDK, both Open Java and Sun Java from Oracle (yes, that Oracle) will work.
- On a Mac, it’s pretty easy because you’ll already have it installed unless you uninstalled it. If you did, install it again — you should know how to do that if you knew how to uninstall it.
- On Windows, head to the Oracle website and download the correct version (32- or 64-bit) for your computer. Again, if this gives you any trouble, stop what you’re doing and learn a bit more about your computer. If you can’t install Java, maybe you’re not yet ready to use the Android SDK.
- On a Linux computer, you’ll also need to install Java. You can find x86 and x64 binaries for Sun Java from Oracle at their website. OpenJDK also works for most things you’ll need to do with the SDK. (OpenJDK is now bundled with Android Studio which includes the SDK as well as a development environment) and you’ll find complete instructions to get it installed at the OpenJDK website. If you need more assistance or want to use a package manager to install Sun Java, you’ll need to refer to the documentation for your particular distro.
Linux users will also have to make sure they have some 32-bit libraries installed if they are running a 64-bit version of the operating system. If you’re using Ubuntu or another Debian variant, install ncurses5 and stdc++6 through your terminal:
sudo apt-get install lib32ncurses5 lib32stdc++6
If you’re using a different flavor of Linux, find the correct packages for ncurses5 and stdc++6 and install them.
Installing the tools
Extract the file you downloaded above into a folder named Android on the root of your C drive (Windows) or into your Home folder (Mac, Linux). You might notice a few things are missing if you’ve ever downloaded the command line tools before as the tools and platform-tools folders are missing. That’s OK; we’re about to get them using the included SDK manager.
Open the bin folder in the extracted download and find the SDK manager executable file. It may look like a terminal or shell command, but it will open a GUI as long as you have Java installed correctly.
Source: Android Central
In the SDK manager, you’ll choose to install Android SDK Tools and Android SDK Platform-Tools. If you’re using Windows, you’ll also want to install the Google USB Driver, and if you plan on building AOSP from the source, you may want to install the Android SDK Build-Tools.
Choose the correct files and proceed through the process (it will show you a license agreement you should read), and both tools folders will be installed. But you’re not quite finished!
The tools will be installed into the application data folder. On Windows, it’s in Windows\users\YourUserName\AppData\Local\Android, and on a Mac or Linux, it’s in .Android (notice the dot!) in your home folder. Create a symbolic link (information for Windows users here) for both tools folders in the Android folder you created earlier. This will help get them into your PATH and make life a lot easier.
Setting your PATH
Source: Android Central
The PATH variable in your computer’s operating system tells it where to look when you want to run a command from a terminal or the command line. For example, to run the ADB command, you either need to type and provide the complete path — ie, the folder ADB is actually in, inside the SDK folder — or have the location set in the PATH variable itself. It’s a bit confusing, but the good news is that doing it is easier than explaining it.
For these directions to work as written, you will have to have extracted and renamed the SDK download folder as mentioned above, and to the correct location for this tutorial.
On Windows
Unless you’re still using an older version of Windows, you no longer can set the PATH in the autoexec.bat file or autoexec.nt file. You’ll need to update the system Environment Variable settings instead. Here’s how it’s done on a Windows 10 machine:
- Hit the Start key on your Keyboard.
- Start typing the words Environment Variables.
- As you type, you’ll see the choice to Edit the system environment variables. Choose it.
- In the Environment Variables window, select the PATH line item in the User variables for (your user name) section, then click the Edit button.
Add the full path to the Android SDK tools and Android SDK platform-tools folders in the edit box, separated by a semi-colon. It should look something like this:
For older versions of Windows, refer to the documentation that came with your computer for assistance on setting the PATH. And, again: If you’ve installed your SDK somewhere other than \Android, you’ll need to adjust accordingly.
On a Mac
Source: Android Central
You can set your PATH variable on a machine running OS X in your bash profile. Doing so is easy, and is all done in one file.
In your Home folder is a file named .bash_profile. Open it with any text editor. Never touch the .bashrc or .bash_profile files you might find in the /etc. directory!
You may see a blank file, or it may be full of other information. All we need to do is add a couple of lines to the top of the file:
(Did we mention that if your SDK is in another location, you’ll need to adjust things accordingly? Good.)
Save the file and reboot your computer so that the new PATH is sourced properly.
On Linux
Setting the PATH on a Linux computer is almost the same as on a Mac, you just edit a different file.
Using your favorite text editor, open the
/.bashrc file. It will probably exist and have multiple entries. If you get an error that the file does not exist, simply create a new file and save it as
/.bashrc when finished.
You’ll want to add the following two lines to the END of the .bashrc file:
Save the file and close the terminal window. Open a new instance of the terminal and type this command:
Your session will reference the changes you made, and the SDK will be in your PATH.
Wrapping it up
Source: Android Central
You should now have a working set of Android command-line tools and be able to do things like flash the latest factory images or manually update your phone with a zip file. And because you did it yourself, you have what you need to fix it when things go wrong.
Good luck, and have fun!
Have you listened to this week’s Android Central Podcast?
Every week, the Android Central Podcast brings you the latest tech news, analysis and hot takes, with familiar co-hosts and special guests.
- Subscribe in Pocket Casts: Audio
- Subscribe in Spotify: Audio
- Subscribe in iTunes: Audio
We may earn a commission for purchases using our links. Learn more.
Samsung needs to bring back its iPod competitor
I don’t want to buy an iPod Touch. Since I want a reasonably priced PMP with acceptable audio hardware that can install a few crucial apps, I might have to.
VoLTE: How to use it and why you should care
VoLTE — or Voice over LTE — is the new standard for calling throughout the U.S., Canada, and parts of Europe. Not only does it facilitate much higher call quality between cell phones, but it allows devices to stay connected to LTE while on a call, improving data speeds for everyone.
PlayStation reportedly planning service to compete with Xbox Game Pass
Sony is planning to create a service similar to Xbox Game Pass, according to a new report. The service could launch as early as sometime in the spring of 2022, with multiple tiers.
These are the best USB-C cables you can find for Android Auto
Android Auto is an absolute necessity when driving, regardless of whether you’re headed out to the grocery store or for a long road trip. These cables will ensure your phone stays protected and charged, no matter what.
Источник
Как настроить Android Studio на вашем Mac (и почему вы этого хотите)
Вам может понадобиться Mac, чтобы создавать свои собственные приложения для iOS
, но если вы больше похожи на зеленых пришельцев, Android IDE (интегрированная среда разработки) также доступна на OS X (среди других платформ).
Если вы готовы перейти от создания приложений для iPhone
или вам не терпится создать следующую большую вещь для Android, установка IDE — это первый шаг в этом путешествии. Или, если мы движемся слишком быстро, почему бы вам не начать с курса
Зачем беспокоиться с Android?
Если вы разбираетесь в разработке для OS X и iOS, вы можете спросить себя, зачем вообще беспокоиться об Android?
Многие разработчики iOS уклоняются от Android из-за фрагментации устройства и необходимости дальнейшего исправления / повторного создания приложений для разных версий ОС, которых много. Я не буду пытаться продать вам, какой из этих двух вариантов лучше, так как они оба предлагают многочисленные преимущества для разработчиков, но я скажу, что для создателей приложений, которые хотят зарабатывать на жизнь своими приложениями, найти какой-то баланс между устройствами никогда не бывает плохой идеей.
Кроме того, вы обнаружите, что общий опыт работы с Android гораздо менее строг. С одной стороны, Google Play (Android App Store) не имеет многих из тех же ограничений, что и Apple, и не требует от разработчиков ежегодной платы в 99 долларов (для Google — 25 долларов). Google предоставляет вам доступ к внутренним функциям Android (посредством модели с открытым исходным кодом), которая позволяет создавать такие вещи, как эмуляторы, загрузчики и настраиваемые доки, значки, стартовые экраны — как вы это называете — что просто невозможно в iOS ,
Если вы строго следите за показателями доходов, Apple App Store по-прежнему будет вашей основной целью. В то время как Google Play имеет на 60 процентов больше ежегодных загрузок, чем App Store, Apple App Store фактически приносит на 70 процентов больше годового дохода от приложений. Это не значит, что вы не можете быть прибыльным на Android или что вам следует избегать платформы в целом, на самом деле, наоборот.
В то время как приложения могут иметь более высокие показатели дохода в Apple App Store, показатели загрузки значительно выше в Google Play, что делает его интересной платформой для тестирования и настройки бесплатного приложения перед выпуском премиум-версии или бесплатной версии.
Затмение с ADT или Android Studio?
В прошлые дни у вас был постоянно запутывающийся выбор между пакетом, включающим Eclipse и плагином ADT (Android Developer Tools), или официальной Android Studio, основанной на платформе IntelliJ — IDE на основе Java.
К счастью, в последних итерациях процесс несколько упростили, выпустив всего одну версию Android Studio.
Фактически, хотя возможность использования Eclipse все еще существует, Google официально рекомендует начать процесс перехода на Android Studio, поскольку поддержка ADT заканчивается. Если вам нужна помощь в переносе ваших проектов, вам поможет эта статья в блоге разработчиков Android.
Теперь, если вы просто ищете эмуляторы, которые поставляются в комплекте с Android Studio, важно отметить, что есть и другие, более легкие способы
сделать это на вашем ПК с Windows, OS X или Linux без необходимости загружать и устанавливать Android Studio. На Mac попробуйте BlueStacks, или вы можете просто загрузить и запустить Android на вашем ПК с Windows. Если вы ищете сверхлегкую эмуляцию Android, попробуйте этот браузерный эмулятор для Chrome
Начало работы с Android Studio
Сначала мы должны загрузить и установить Android Studio, пакет, который состоит из:
- Android Studio IDE
- Android SDK (комплект разработки программного обеспечения)
- Платформа Android 5.0 (Lollipop)
- Образ системы эмулятора Android 5.0 с API Google
Запустите файл .dmg и перетащите Android Studio в папку «Приложения».
Откройте Android Studio и следуйте инструкциям мастера установки. Иногда вы сталкиваетесь с ошибкой, когда файл «поврежден» или ненадежен и должен быть перемещен в корзину. Если это произойдет, вам просто нужно настроить параметры безопасности и конфиденциальности, чтобы приложение могло работать, перейдя в Системные настройки> Безопасность Конфиденциальность > генеральный а затем выбрав В любом месте где написано «Разрешить загрузку приложений из:»
Если вам нужно использовать инструменты Android SDK из командной строки, вы можете получить к ним доступ, открыв Терминал (Приложения> Утилиты> Терминал) и используя следующее:
/ Users / имя пользователя / Library / Android / SDK /
Просто не забудьте добавить свое имя пользователя вместо имя пользователя .
Добавление пакетов SDK
Android SDK (комплект разработки программного обеспечения), который поставляется с пакетом Android Studio, не включает в себя все необходимое для разработки приложений для Android. Сам SDK — это утилита, используемая для разделения ваших инструментов, платформ и компонентов на пакеты с помощью Android SDK Manager.
Поэтому нам нужно добавить несколько пакетов, чтобы подготовить все к разработке. Не волнуйся, это простой процесс.
Сначала откройте менеджер SDK под Сервис> Конфигурировать> SDK Manager.
Замечания: С этого момента, чтобы быть кратким, мы будем предполагать, что если я не упомяну что-то конкретно, это означает одну из двух вещей:
- Он предварительно выбран и будет установлен автоматически, как только мы закончим.
- Вам это не нужно … по крайней мере, прямо сейчас.
Хорошо, давайте продолжим. Выберите следующее:
- Инструменты Android SDK
- Android SDK Платформа-инструменты
- Android SDK Build-tools (самая высокая версия)
Откройте папку для самой высокой версии Android в списке (5.1.1 на момент написания статьи) и выберите:
- Платформа SDK
- Изображение системы ARM EABI v7a
Открой Дополнительно каталог и загрузите следующие API для библиотеки поддержки Android:
- Репозиторий поддержки Android
- Библиотека поддержки Android
Откройте каталог Extras и загрузите пакет услуг Google Play, чтобы получить еще больше API. Добавлять:
- Google Repository
- Сервисы Google Play
- Нажмите Установить 22 пакета (или сколько угодно отчетов менеджера SDK).
- Нажмите на название каждого пакета слева, чтобы принять условия лицензии для каждого.
- Нажмите Установить.
Замечания: Не выходите из SDK manager, пока установка не будет завершена!
После завершения установки вы можете сразу же приступить к разработке
и даже запускать приложения для Android
прямо с вашего верного Mac (или Hackintosh) под управлением OS X.
Портирование приложений iOS на Android
Из-за отсутствия сходства в двух операционных системах нет ничего, что предлагало бы решение «подключи и работай» для переноса приложений из другой ОС.
Тем не менее, есть программа под названием Apportable, которую я чувствовал, стоит отметить. Apportable по сути переводит Swift и Objective-C для запуска машинного кода ARM и x86, который способен понять Android. Вы также найдете дополнительные плагины для дальнейшего снижения нагрузки на разработку, такие как плагин SpriteBuilder. Тем не менее, не все API-интерфейсы Apple доступны в Apportable, поэтому, несмотря на то, что это лучшее, что у нас есть, оно по-прежнему не является решением «включай и работай».
Основные преимущества Apportable заключаются в более быстрой кросс-компиляции без необходимости в эмуляторах, виртуальных машинах или альтернативе на Java. В то время как Java обеспечивает отличную кросс-совместимость в мобильных приложениях, она оставляет версии для iOS и Android не очень нативными. На самом деле, большинство чувствуют себя как дешевые порты от других ОС.
Опять же, это не идеальное решение, но оно должно значительно облегчить вашу рабочую нагрузку, если вам придется перемещаться между Android и iOS.
Счастливого развития, и обязательно поделитесь тем, что вы нам придумали, здесь, на сайте Use Use Of.
Вы разработали приложение для iOS или Android? Какая платформа, на ваш взгляд, предлагает лучшие инструменты для разработчиков?
Источник