Sei sulla pagina 1di 4

How to install Android SDK on Ubuntu If you are using a 64-bit distribution of Ubuntu you need to install 32-bit

libraries since Android only runs in 32-bit environment. Open a terminal window and execute the following command: arch Check the result for "x86_64". This means you are running a 64-bit distribution. In this case install 32-bit libraries by executing the following command in the terminal window: sudo apt-get install ia32-libs Enter "Y" when you are asked to continue. You need latest jdk Download latest jdk and jre http://www.wikihow.com/Install-Oracle-Java-on-Ubuntu-Linux sudo mkdir -p /usr/local/java move your jdk and jre to above dir JAVA_HOME=/usr/local/java/jdk1.7.0_07 PATH=$PATH:$HOME/bin:$JAVA_HOME/bin JRE_HOME=/usr/local/java/jre1.7.0_07 PATH=$PATH:$HOME/bin:$JRE_HOME/bin export JAVA_HOME export JRE_HOME export PATH sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jre1.7.0_07/bin/java" 1 sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_07/bin/javac" 1 sudo update-alternatives --set java /usr/local/java/jre1.7.0_07/bin/java sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_07/bin/javac java -version java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode) javac -version javac 1.7.0_07 INSTALL ECLIPSE Extract eclipse cd /usr/share sudo mv ~/Downloads/eclipse /usr/share sudo chown -R root:root/ eclipse sudo touch /usr/bin/eclipse sudo chmod 755 /usr/bin/eclipse sudo gedit /usr/bin/eclipse & Copy this into gedit: #!/bin/sh export ECLIPSE_HOME="/usr/share/eclipse" $ECLIPSE_HOME/eclipse $* Save and close gedit. Create a Gnome menu item by executing the following command in the terminal window:

sudo gedit /usr/share/applications/eclipse.desktop & Copy this into gedit: [Desktop Entry] Encoding=UTF-8 Name=Eclipse Comment=Eclipse IDE Exec=eclipse Icon=/usr/share/eclipse/icon.xpm Terminal=false Type=Application Categories=GNOME;Application;Development; StartupNotify=true Save and close gedit. Note: If you get the following error when starting eclipse "JVM terminated. Exit code=13" then you have to install the correct java version (version 5 or version 6) or you are trying to run a 32-bit version of Eclipse on a 64-bit JVM. Install 64-bit version of eclipse in this case. Installing ADT (Android Development Tools) Plugin for Eclipse Start Eclipse. Click on the menu bar "Help" -> "Install New Software..." Click on "Add..." at the upper right and enter the following information. Name: your eclipse version EG juno, indigo Location: http://download.eclipse.org/releases/version_name Click again on "Add..." and enter the following information. Name: ADT Plugin Location: https://dl-ssl.google.com/android/eclipse/ Click on "OK" In the "Available Software" dialog window, select the checkbox next to "Developer Tools" and click "Next". In the next window, you will see a list of the tools to be downloaded. Click "Next". Read and accept the license agreements and click "Finish". Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click "OK". configure the ADT plugin restart Eclipse. A dialog window opens automatically: Choose "Use Existing SDKs", press the "Browse" button and select the "android-sdk-linux" directory in your home directory. Press "Next" Decide on sending usage statistics or not and click "Finish" If the dialog does not open automatically: Click on the menu bar "Window"->"Preferences". Then select "Android" on the left. To select the SDK location click the "Browse..." button and select the "android-sdk-linux" directory in your home directoy. Click "Apply". Expand the "Android" tab on the left and select "Usage Stats". Decide on sending usage statistics and click "OK" to close the window.

if adb command not found puth adb path in .bashrc export PATH=${PATH}:~/android-sdk-linux/tools export PATH=${PATH}:~/android-sdk-linux/platform-tools Uninstalling eclipse-sdk to uninstall eclipse in ubuntu or remove storage password dispose .eclipse folder in home folder, also entries you mad in /usr/share directory then install eclipse again $ adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached 04C06F49C2F7 device $ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 003 Device 002: ID 12d1:1038 Huawei Technologies Co., Ltd. Ideos (debug mode) Bus 001 Device 003: ID 04f2:b303 Chicony Electronics Co., Ltd Bus 002 Device 003: ID 0930:021d Toshiba Corp. we need the highlighted line above Product ID then vendor(PID:VID) ie 12d1:1038 mode is the permission $ sudo gedit /etc/udev/rules.d/51-android.rules SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12d1", MODE="0666" the above rule is for google ideos U8150-D sudo restart udev adb devices $ adb kill-server $ adb start-server

DEbug key in Eclipse, select Windows > Prefs > Android > Build to check the full path of your debugkeystore cd to folder where your .keystore file is stored keytool -list -v -alias androiddebugkey -keystore /home/brice/.android/debug.keystore -storepass android -keypass android we need the fingerprint in md5(thats why we added -v (verbose) in above line Go to below URL and create your keys https://developers.google.com/android/maps-api-signup

Release key mkdir release_keys cd release_keys sign your app file export export android application create new keystore create md5 fingerprint keytool -list -v -alias gps -keystore gps.keystore alias is the alias you created earlier, also keystore is the keystore from earlier create api keys sign your application again using existing keystore which you created earlier

Potrebbero piacerti anche