From Mageia wiki
Jump to: navigation, search


Drakconf multiflag.png
Other languages
Deutsch ; English
Note:
An alternative is to use our package android-tools. It is not yet (October 2021) perfect, but see mga#28860

First, open a Console window. Now you need to install the libncurses5 package.

Login as root

su -

Password: Type your given root password here and press Enter. (Note that the letters you type will be hidden for security reasons).

Now at root-prompt type:

 urpmi libncurses5 --auto

When libncurses5 is installed and you get a new prompt, just exit the console by typing exit and then type exit and hit Enter again.

Open the Terminal-window and type

 cd $HOME
 wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
 unzip android-sdk_r24.4.1-linux.tgz
 cd android-sdk-linux/

To make sure that you can use the SDK correctly, you need to add the path to where you keep the SDK directory. In this case I used my home directory, therefor I changed directory to ~/ before I told wget where to download the SDK archive.

To add the unpacked directories to your profile you type

gedit .bash_profile

I used gedit as an editor to open .bash_profile with, but depending on which DE you're currently using you can use kwrite, kate or pluma or if you prefer to edit the file directly in the Terminal session you can use vi, vim and/or nano.

This will open the environment-file for your user. The file may look something like this:

  # .bash_profile

  # Get the aliases and functions
  if [ -f ~/.bashrc ]; then
	. ~/.bashrc
  fi

  # User specific environment and startup programs

  PATH=$PATH:$HOME/bin

  export PATH
  unset USERNAME

Now you add theese following lines to the end of the file:

 SDKDIR=~/android-sdk-linux
 PATH=$PATH:$SDKDIR/tools
 PATH=$PATH:$SDKDIR/platforms
 PATH=$PATH:$SDKDIR/platform-tools
  • Now save the change and exit your editor.

Now re-login to your used Desktop Environment for you path change to take place.


Notes

'Quick notes from first time user

  • I did not have any ~/.bash* file, so i created the file as above (for more info search web for .bashrc and .bash_profile)
  • adb was not included in that downloaded package above, so more is needed;
  • WARNING: I stupidly blindly followed the readme in the packed up folder and issued
~/android-sdk-linux/tools/android update sdk --no-ui

...and left computer, ended up with a large suite, ~/android-sdk-linux/ being 20 gigabytes! Apparently "updating" pulls a lot of other tools (but yes, adb is included there)

  • INSTEAD: To just get adb and not many gigabytes of other stuff, instead of the above run
~/android-sdk-linux/tools/android

which is the graphical "Andriod SDK Manager". Deselect everything except "Android SDK Platform-tools, click button "Install 1 package" down right, accept licence, install.

  • adb is now in platform-tools
~/android-sdk-linux/platform-tools/adb