THIS IS A WORK IN PROGRESS
Android development has piqued my interest! Here are the steps I took to get Android Studio/SDK installed in Debian Wheezy 64bit. As always, read it, test it out, and provide feedback. Here we go...
ASSUMPTIONS
INSTALL ANDROID STUDIO/SDK SYSTEM REQUIREMENTS
- Enable Debian multiarch i386 to allow 32bit applications to run.
dpkg --add-architecture i386
apt-get update
- Install required libs for Android SDK.
apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386
- Ensure you have contrib enabled in sources.list for java-package.
nano /etc/apt/sources.list
deb http://http.debian.net/debian wheezy main contrib non-free
deb-src http://http.debian.net/debian wheezy main contrib non-free
# update after edit sources.list
apt-get update
- Oracle JDK is no longer available in Debian Wheezy. Install java-package so we can create a JDK8 deb. We are using multiarch so you will need to specify the architecture to install.
apt-get install java-package:amd64 fakeroot:amd64
- Edit java-package to allow building of a JDK8 deb. Insert the following at line 49.
nano -c /usr/share/java-package/oracle-j2sdk.sh
"jdk-8u"[0-9]"-linux-x64.tar.gz") # SUPPORTED
j2se_version=1.8.0+update${archive_name:6:1}${revision}
j2se_expected_min_size=310 #Mb
j2se_priority=319
found=true
;;
"jdk-8u"[0-9][0-9]"-linux-x64.tar.gz") # SUPPORTED
j2se_version=1.8.0+update${archive_name:6:2}${revision}
j2se_expected_min_size=310 #Mb
j2se_priority=319
found=true
;;
- Download JDK8 (as of this writing): Oracle Java Download
- Generate a Debian package.
make-jpkg jdk-8u25-linux-x64.tar.gz
- Install the binary package created.
dpkg -i oracle-j2sdk1.8_1.8.0+update25_amd64.deb
- Set default java.
update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javaws
- Verify your java version.
java -version
javac -version
INSTALL ANDROID STUDIO
- Download Android Studio: Android Studio Download
- Extract the package. I just right clicked > Extract here.
- As root or using sudo, move the package to it's destination.
mv /home/melissa/Downloads/asb/android-studio /opt/
- Create a symbolic link so studio can be launched from the command line.
ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/asb
- Make a menu option for your installed application.
leafpad android-studio.desktop
[Desktop Entry]
Name=Android-Studio
Comment=your comments
Exec=/opt/android-studio/bin/studio.sh
Icon=/opt/android-studio/bin/idea.png
Terminal=false
Type=Application
Categories=Utility;IDE;Development;
- Install the menu option just created.
desktop-file-install android-studio.desktop
INSTALL ANDROID SDK
- Download Android SDK "for existing ide": Android SDK Download
- Extract the package. I just right clicked > Extract Here.
- As root or using sudo, move the extracted package to it's destination.
mv android-sdk-linux /opt/
- Create a symbolic link so Android Debugger can be launched from the command line.
ln -s /opt/android-sdk-linux/platform-tools/adb /usr/local/bin/
SET SDK LOCATION WITHIN ANDROID STUDIO
- Start Android Studio from your new menu option.
- Navigate to Configure > Project Defaults > Project Structure.
- Fill in the Android SDK Location: /opt/android-sdk-linux/
- Click Apply > Ok.
REFERENCES
http://askubuntu.com/questions/421389/where-to-unpack-the-android-studio-file
http://forums.debian.net/viewtopic.php?f=16&t=114690
http://tutorialforlinux.com/2014/03/13/how-to-install-android-studio-bundle-on-debian-wheezy-7-3264bit-linux-easy-guide/
https://developer.android.com/sdk/installing/studio.html
https://wiki.debian.org/JavaPackage
https://wiki.debian.org/Multiarch/HOWTO
https://wiki.debian.org/Java/Sun
https://developer.android.com/sdk/installing/adding-packages.html
https://developer.android.com/tools/help/sdk-manager.html
https://developer.android.com/tools/help/adb.html
http://crunchbang.org/forums/viewtopic.php?id=34556
https://www.java.com/en/download/faq/java_webstart.xml
GNU nano 2.2.6 File: ConnectPhoneToAndroidStudio
ReplyDelete1. Create a file called android.rules
2. Without switching directories, run the following commands :
a. sudo cp android.rules /etc/udev/rules.d/51-android.rules
b. sudo chmod 644 /etc/udev/rules.d/51-android.rules
c. sudo chown root. /etc/udev/rules.d/51-android.rules
d. sudo service udev restart
e. sudo your-path-to-adb-executable/adb kill-server
f. sudo your-path-to-adb-executable/adb start-server
g. your-path-to-adb-executable/adb devices
3. Will be able to see on Android Studio
[Credits: http://stackoverflow.com/questions/9210152/set-up-device-for-developm$
Thank you for the tips! It will definitely help other people looking to connect their phones once Android Studio is setup!
ReplyDeleteReally its a very nice written document
ReplyDeleteHow do I make the menu of options shown in Step 5?
ReplyDeleteWhat is leafpad?
Thank you, excuse my ignorance about it.
Leafpad is a graphical text editor. So in step 5 if you execute that command in the terminal it will launch Leafpad and edit/create the android-studio.desktop file needed so you can paste and save the remaining Desktop Entry into it and save. Step 6 then has you install the file you just created. I hope that helps clear things up.
ReplyDeleteIt says, Key file does not start with a group
ReplyDeleteSorry for the late reply. What specific step are you getting this response on?
DeleteSure way of installing and using Android Studio!
ReplyDeleteI'm truly amazed at your exact instruction. Even though I'm not a linux expert I could make it.
Warm thanks, Melissa.
Melissa,
ReplyDeleteAmazing sure way of installing and using Android Studio!
Your succinct and exact instruction made me succeed.
The only thing I chaned is x64 -> i586 for an intel laptop user.
I deeply thank you.
You're very welcome. If there is anything you would like explored in linux, let me know and I will write it up the best I can.
Delete