What if you can still get the android SDK tools and emulator without installing the whole Android Studio? cool right!:)
Mobile development has always required developers installing Android Studio *(and XCode for Mac)* and as we all know running Android on a less powerful laptop is a time bomb waiting to explode.
### setup the the sdk manager
Go to [android studio website](https://developer.android.com/studio) , scroll down to the downloads section and the header with **Command line tools only** section and download the tool for your platform.
> Disclaimer: this article is geared more towards Unix system
Extract the zip and move the `cmdline-tools` into any folder of choice such as `android_sdk/`. our main focus would be on the `sdkmanager` executable.
Inside the `cmdline-tools` folder, create a new folder called `latest` and move everything that was previously in the `cmdline-tools` *(including* `bin/`, `lib/` directories) inside the new `latest` folder
to test if the `sdkmanager` is working, type:
```bash
~/android_sdk/cmdline-tools/latest/bin/sdkmanager
```
you should see something like the following displayed:
```bash
Usage:
sdkmanager [--uninstall] [<common args>] [--package_file=<file>] [<packages>...]
sdkmanager --update [<common args>]
sdkmanager --list [<common args>]
sdkmanager --list_installed [<common args>]
sdkmanager --licenses [<common args>]
sdkmanager --version
...
...
```
If you get something like the above *(congrats)*.
Optionally, type the script below to get the latest `cmdline-tools`.
```bash
android_sdk/cmdline-tools/latest/bin/sdkmanager --install "cmdline-tools;latest"
```
> you can change the `"cmdline-tools;latest"` to `"cmdline-tools;5.0"` or another specific version
#### Installing packages
Now it's time to install the packages we need to build an app and the platform we want to build it for.
To install packages, use the following syntax:
```bash
android_sdk/cmdline-tools/latest/bin/sdkmanager "platform-tools" "platforms;android-33" "build-tools;33.0.0"
```
#### Accept the licences
To finalize everything you should accept the licenses for all platform/build-tools downloaded
```bash
android_sdk/cmdline-tools/latest/bin/sdkmanager --licenses
```
Add the following in your `.bashrc` feel free to comment out line 2 and 3.
```bash
# Android SDK
export ANDROID_HOME=~/android_sdk
# export ANDROID_SDK_ROOT=$ANDROID_HOME
# export PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin
```
And Congrats, you can now build your android apps with either Flutter or React Native. type `flutter doctor` and see most things checked.
> update the sdk-root path for flutter with \`flutter config —android-sdk /path/to/android\_sdk\`
> quick side note, while writing this I found out Linux Mint *(and most Ubuntu based distro)* already has a package named `google-android-cmdline-tools-<version>-installer`
I have not tested it yet but I am sure it does the above too.
#### References
* the official [sdkmanager docs](https://developer.android.com/tools/sdkmanager)
* another [great stackoverflow help](https://stackoverflow.com/questions/27202353/how-to-open-the-avd-manager-on-ubuntu-linux-from-the-command-line/57019574)