[SCRIPT] Simplest way to set up Android build environment on your Linux - Miscellaneous Android Development

Hey folks!
What is it? :silly:
Basically, my friend wanted to set up a build environment on Ubuntu 12.04 and was asking me for help. So instead of helping him in every step, I made a script :lazy:
So thought of sharing it with you guys too
How to?
Its as easy as 1... 2... 3...
(By script.sh, I mean every script file you want to execute. Example, if you want to execute build_environment and java, first follow all the steps with build_environment.sh by replacing build_environment.sh with script.sh, and then with java.sh)
Download the required script(s)
Then enter the following command for every
script sudo chmod 7777 script.sh
Click to expand...
Click to collapse
Then for every script, enter the following command
sudo ./script.sh
Click to expand...
Click to collapse
Done!
Easy, isn't it?
ALSO SEE THE NOTE SECTION IN THE SECOND POST.
Downloads
Mediafire
Will it work on my PC? :silly:
It works on every system running Ubuntu (or based) 12.04 or above.

What does script.sh do?
all.sh - It does everything. From installing required packages, to java, to ADB configuration, to repo. ALL
build_environment.sh - It sets up the stuff required for build environment. The packages and the ADB configuration
java.sh - It lets you decide the java to install. It asks if you want to install OpenJDK 6, OpenJDK 7, both or none
repo.sh - It install the repo tool to your system
Note:
If working with Ubuntu 14.04 or higher (or based), you need to install some additional packages. Just enter the following command.
sudo apt-get install bison g++-multilib git gperf libxml2-utils -y
Click to expand...
Click to collapse
USB configuration is add as ROOT and not as user.
java.sh, when executed, will prompt to install OpenJDK 6 first, then OpenJDK 7. Press 'y' to install the package and 'n' to not install it, according to your choise
You need to set proper execute permissions to for the scripts before executing. And need to execute as root.

Reserved for thanks

Related

Installing Debian + Gnome, KDE, IceWM or LXDE Desktop on your rooted G1!

Found an easy way to install Debian, resize the debian.img, and run a desktop on your rooted G1!
1. Installing Debain - has an installer.
For step 6. Do this instead:
Code:
# su
# ./installer.sh
OR
# su ./installer.sh
2. Resize debain.img
3. Installing Desktop
For those who run into problems or errors while installing/downloading tightvncserver and/or LXDE follow these modifications:
1. type:
Code:
cd /etc/apt
nano sources.list
2. add after the first one:
Code:
deb http://ftp.debian.org/debian lenny main contrib non-free
deb-src http://ftp.debian.org/debian lenny main contrib non-free
3. Hold down the trackball and hit o
4. Hit return (to save the new sources.list)
5. Hold the trackball and hit x (to exit nano)
6. Type (enter after each one):
Code:
apt-get update
apt-get install tightvncserver
apt-get install lxde
For Haykuro's builds [Thanks to buttkicker!]:
The procedure is same for 5.0.2H versions as well.
However, some files need to be modified.
I am attaching two sets of files.
Use as needed.
1: debian_v21-sdcard.zip
extract to /sdcard/debian
2: debian_v21-system-sd.zip
extract to /system/sd/debian (ext2 partition)
Replace the files in the original downloaded package with the ones in this post.
If you chose option 2, remember to type
Code:
cd /system/sd/debian
in step 4
Mirrors of Installer & debian.img:
Code:
http://mindsofwisemen.com/fileso/other/debian_v21.zip
http://www.filedropper.com/debianv21
Mirrors of Attached:
Code:
http://www.filedropper.com/debianv21-sdcard
http://www.filedropper.com/debianv21-system-sd
Thanks for this info, I'd also like to know if anyone hs tried it using the H build roms .... as apposed to JF's rom ... as stated in the instructions!
Thanks will try this on my G1 verry nice.
does this make a dual boot option? or how does it work?
no it doesn't. you run debian via the terminal emulator, then you run the Desktop app through a VNC viewer (i think, something like that anyway)
also this has been around for ages and doesn't have much use as all of them run stupidly slowly. (that being said, now we can get the processor running faster it might be better)
n1 on the guides though, much more helpful than trawling through countless threads
joeydsmith said:
does this make a dual boot option? or how does it work?
Click to expand...
Click to collapse
This is not dual boot. This runs Debian "like" an app running in the android Shell. Calls and everything will still work while in the debian.
Meltus said:
no it doesn't. you run debian via the terminal emulator, then you run the Desktop app through a VNC viewer (i think, something like that anyway)
also this has been around for ages and doesn't have much use as all of them run stupidly slowly. (that being said, now we can get the processor running faster it might be better)
n1 on the guides though, much more helpful than trawling through countless threads
Click to expand...
Click to collapse
Actually it isnt that "laggy" nor slow. Practical for developing code on the go. (you can have the gcc on here )
SatanR1 said:
Thanks for this info, I'd also like to know if anyone hs tried it using the H build roms .... as apposed to JF's rom ... as stated in the instructions!
Click to expand...
Click to collapse
I just finished installing on 5.0.2Gr3
The procedure is same for 5.0.2H versions as well.
However, some files need to be modified.
I am attaching two sets of files.
Use as needed.
1: debian_v21-sdcard.zip
extract to /sdcard/debian
2: debian_v21-system-sd.zip
extract to /system/sd/debian (ext2 partition)
Replace the files in the original downloaded package with the ones in this post.
If you chose option 2, remember to type
Code:
cd /system/sd/debian
in step 4.
buttkicker said:
I just finished installing on 5.0.2Gr3
The procedure is same for 5.0.2H versions as well.
However, some files need to be modified.
I am attaching two sets of files.
Use as needed.
1: debian_v21-sdcard.zip
extract to /sdcard/debian
2: debian_v21-system-sd.zip
extract to /system/sd/debian (ext2 partition)
Replace the files in the original downloaded package with the ones in this post.
If you chose option 2, remember to type
Code:
cd /system/sd/debian
in step 4.
Click to expand...
Click to collapse
Awesome...now everyone has instruction on how to acheive this
Everytime i do this when it comes to the bit of typing
su (hit return)
chmod 4755 *
UPDATED! 6.as root (or su) run the installer like this:
installer.sh
It says unable to chmod bootdeb: operation not permited when i do the 1st
then that means i cant install the last one
Anyhelp guys? i would really appreciate it please im not sure whether i should Downgraid back to JF? Ill miss the pros of Haykuros H build but if i can get debian workn then its worth it
Does anyone have a youtube video running debian with kde or gnome on their g1?
Oh my...zeezee, you are a girl and you know more about computer stuffs more than i do, it's a shame for me, so embarrassing, but anyways i'm stuck at installing LXDE, could you help me out? I have debian and vncserver installed but when i run this command, i got an error msg
localhost:/# vncserver -geometry 480x320
vncserver -geometry 480x320
bash: vncserver: command not found
Do you have idea how to solve this problem? i've been hours try to figure it out but i'm totally clueless.
phuthanvinh said:
Oh my...zeezee, you are a girl and you know more about computer stuffs more than i do, it's a shame for me, so embarrassing, but anyways i'm stuck at installing LXDE, could you help me out? I have debian and vncserver installed but when i run this command, i got an error msg
localhost:/# vncserver -geometry 480x320
vncserver -geometry 480x320
bash: vncserver: command not found
Do you have idea how to solve this problem? i've been hours try to figure it out but i'm totally clueless.
Click to expand...
Click to collapse
Did you install vnc server by running this?
Code:
apt-get install tightvncserver
and, did the installation finish without errors.
buttkicker said:
Did you install vnc server by running this?
Code:
apt-get install tightvncserver
and, did the installation finish without errors.
Click to expand...
Click to collapse
yes i did, but everytime i run a command to install something, there were always errors that the links are not valid (404). However I run get update fix missing file command afterward.
Still no reply then? hmmmm...
ben29pickett said:
Everytime i do this when it comes to the bit of typing
su (hit return)
chmod 4755 *
UPDATED! 6.as root (or su) run the installer like this:
installer.sh
It says unable to chmod bootdeb: operation not permited when i do the 1st
then that means i cant install the last one
Click to expand...
Click to collapse
can you try
Code:
su ./installer.sh
For those (like me) who get errors when apt-get'ing thightvncserver and/or lxde:
(from the thread at androidfanatic.com)
instructions
cd /etc/apt
nano sources.list
now add
deb http://ftp.debian.org/debian lenny main contrib non-free
deb-src http://ftp.debian.org/debian lenny main contrib non-free
after the first one
then hold down the trackball and hit o
then hit return (to save the new sources.list)
then hold the trackball and hit x (to exit nano)
then type
apt-get update
apt-get install tightvncserver
apt-get install lxde
That did the trick for me at least.
/Mats
its actually the seccond part i get an error on chmod 4755 * saying something not permited bla bla bla lol
Hay there. ok i have debian setup and lxde but when i got to the vnc and connect all i get is a gray screen can any body help?
i know this has already been adressed but i cant find the thread again.
Nice howto. Cheers

[GUIDE] Get Android 2.2 source for n00bs

I did this in Ubuntu 10.4 linux that i installed on a 14gig partition of my laptop.
You can do this in VMware or make a partition of your HDD and download wubi.exe to install linux on your partition... its easier than installing windows. You can use this to help develop if you know anything, or as i have done, used it to get the uncompiled .9.png's to edit for themeing, bypassing the draw9patch step cause the guides are already there ready to go through eclipse IDE.
INSTALL ALL LINUX UPDATES THAT WILL POPUP WITH AUTO-UPDATER BEFORE GETTING SOURCE.
on to the good stuff.... open up the terminal and run the following commands
Code:
sudo nano /etc/apt/sources.list
Then add the following to the bottom by scrolling down with your arrow keys and pasting by right clicking, CTRL-V WONT WORK.

Code:
deb http://cz.archive.ubuntu.com/ubuntu jaunty-updates main multiverse
Hit CTRL O and ENTER to save and CTRL X to return to the command line. Now lets get the repo packages cached onto your box using the following command.
Code:
sudo apt-get update
install Java 5 SDK and all the other little packages needed to build Android with this command.
32-bit x86
Code:
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
64-bit x86
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev
Code:
sudo update-java-alternatives -s java-1.5.0-sun
Code:
sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so
moving on
INSTALLING REPO
You can install repo tool any place in your path. We choose a bin directory in our home folder:
Code:
$cd ~
$mkdir bin
$export PATH=$PATH:~/bin
$curl https://android.git.kernel.org/repo >~/bin/repo
$chmod a+x ~/bin/repo
DOWNLOADING ANDROID SOURCE CODE:
Create an empty directory to hold your working files:
Code:
$mkdir mydroid
$cd mydroid
# Run repo init to bring down the latest version of Android with all its most recent bug fixes. You must specify a URL for the manifest:
Code:
$repo init -u git://android.git.kernel.org/platform/manifest.git
NOTE: using -b option we can choose which android version to install:
Code:
$repo init -u git://android.git.kernel.org/platform/manifest.git -b froyo
To pull down files to your working directory from the repositories as specified in the default manifest, run
Code:
$repo sync
NOTE: mydroid directory size grows up to 3.6G.
BUILDING ANDROID
Simply on top of your android directory execute make command:
Code:
$cd mydroid
$make
After some time it will finish.
We get the installed file list in this file:
out/target/product/generic/installed-files.txt
Also some images are created in the same directory: (system.img userdata.img ramdisk.img)
mydroid$ ls out/target/product/generic/
android-info.txt data obj ramdisk.img symbols system.img
clean_steps.mk installed-files.txt previous_build_config.mk root system userdata.img
We have built android source code but now we want to test it:
run the Android Emulator, which comes within the Android SDK
http://developer.android.com/guide/developing/tools/emulator.html
Download Android SDK
http://developer.android.com/sdk/index.html
Install Android SDK
http://developer.android.com/sdk/installing.html
ill post the location of the framework-res.apk drawables and stock app apks to edit for those of you interested in theming.
I appreciate the effort but isn't this almost the same from android central by gbhil?
Sent from my HERO200
Wouldnt know. Die hard xda member. Im sure im not the only one that checks this site only. Im just trying to do my part. We need devs and themers with creative ideas. This is the one of the first few steps toward those interested in learning.
Sent from my Hero CDMA using XDA App
Thank You!!!!!!!
WELL DONE SIR!!!!! Thank you for posting a good repo link for froyo!!!!!
riggsandroid said:
I appreciate the effort but isn't this almost the same from android central by gbhil?
Sent from my HERO200
Click to expand...
Click to collapse
Isn't android central a different website?
myth_mn said:
Isn't android central a different website?
Click to expand...
Click to collapse
Yes, I was thinking if he took it from there to give credit. But the effort is appreciated and not trying to start a problem.
Sent from my HERO200
Made this because of all the errors i ran into and gathered all my sources of research of linux commands like changing your $PATH and installing java after my machine wouldnt find it in the repository, or not being able to get repo installed. Im just trying to help. I would have sourced gbhil if i took it from there. And this isnt a college essay, work cited pages arent necessary, its a courtesy out of respect. Besides... my sources where from blogs and most didnt have anything to do with android. Just throwin that out there. ©
epitaphromance said:
Made this because of all the errors i ran into and gathered all my sources of research of linux commands like changing your $PATH and installing java after my machine wouldnt find it in the repository, or not being able to get repo installed. Im just trying to help. I would have sourced gbhil if i took it from there. And this isnt a college essay, work cited pages arent necessary, its a courtesy out of respect. Besides... my sources where from blogs and most didnt have anything to do with android. Just throwin that out there. ©
Click to expand...
Click to collapse
no problem. i appreciate the work, I'm gonna give it a shot at some piont when I get some time to install ubuntu.
not doubting you didn't do the work, it was only fresh in my mind because i literally looked at it yesterday. thanks again for the info gathering.
Welcome
Sent from my Hero CDMA using XDA App
Just hope your patient between builds... or at least the first build unless you have a real killer machine. Tried it on my laptop (1.8ghz dual core amd)... 2hrs and had to ctrl+c cause I had to go to bed...
Just wanted to say that this also works on linux mint kde 8 (also known as user friendly linux) it is taking forever though as posted good write-up. oh by the f ubuntu. just saying
Hello,
Not sure if you follow this thread or not anymore but I get an error I was hoping someone could help me with? When I run the last "make" commange I get this error:
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.
Your version is: java version "1.6.0_20".
The correct version is: 1.5.
Please follow the machine setup instructions at
http://source.android.com/download
************************************************************
build/core/main.mk:117: *** stop. Stop.
Any ideas?
Thanks
jschill31 said:
Hello,
Not sure if you follow this thread or not anymore but I get an error I was hoping someone could help me with? When I run the last "make" commange I get this error:
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.
Your version is: java version "1.6.0_20".
The correct version is: 1.5.
Please follow the machine setup instructions at
http://source.android.com/download
************************************************************
build/core/main.mk:117: *** stop. Stop.
Any ideas?
Thanks
Click to expand...
Click to collapse
Assuming you've installed an openjdk-6-jdk package, you can override the normal build restriction of Java 5 by editing the file build/core/main.mk and changing the Java version test to match against "1.6" instead of "1.5". You'll need to do it in two places, once for java and once for javac. I never had to do this to build Cyanogenmod, but you may need to for AOSP.
Decad3nce said:
Assuming you've installed an openjdk-6-jdk package, you can override the normal build restriction of Java 5 by editing the file build/core/main.mk and changing the Java version test to match against "1.6" instead of "1.5". You'll need to do it in two places, once for java and once for javac. I never had to do this to build Cyanogenmod, but you may need to for AOSP.
Click to expand...
Click to collapse
Decad3nce, thanks for posting so fast. The funny thing is I figured it out within 5 minutes of posting but got sucked in to finalizing my source code that I am now just getting back to the post. There are several here in this forum that really help out and you are one of them. I am just now getting brave enough to start cooking but catch on fast. Can't wait to see what you, nfinite and beezy do to the wildfire port!

[Recovery] CWM Recovery 4.0.0.8 for Compaq Airlife 100

Hi all,
Note: I'm still testing these files and they are not final. I'm not responsible if you brick your device with these files. Use it at your own risk and only if you know what you are doing!
If you want to make sure that you don't loose anything use romdump to perform a backup for your device.
Files
Boot: boot-insid3r-0.1.img
Recovery: recovery-insid3r-0.1.img
How to prepare your PC
===== On Windows (I tried on Windows 7): =====
1)Download the latest Android SDK from here.It's the installer_r12-windows.exe file.
2)Run the installer. It will start a download all the files needed. Note:You must have Java JDK installed.
3)Boot your Compaq Airlife 100 to Fastboot Mode (BACK + POWER). It will show a black(empty) screen thats normal!
4)Connect your Compaq Airlife 100 through the USB Cable to your PC
5)Open Windows Start Menu and type: cmd.exe
6)Navigate to your Android SDK folder like this:
cd /
cd "Program Files\Android\android-sdk\tools"
7)Run fastboot:
fastboot.exe devices
(it will show only an '?', its normal)
8) Jump to "How to Use"
===== On Ubuntu (I tried on Ubuntu 11.04): =====
1)Download the latest Android SDK from here. It's android-sdk_r12-linux_x86.tgz file.
2)Unpack it.
3)Open terminal and navigate to <android-sdk-linux_x86>/tools and execute "android" script. This will start the download of the needed files.
4)Navigate to your Android SDK folder like this:
cd android-sdk-linux_x86/platform-tools/
5)Run fastboot:
./fastboot devices
(it will show only an '???????', its normal)
6) Jump to "How to Use"
How to use
1)Root your device, using an app like Universal Androot
2)boot your device into fastboot mode (BACK+POWER)
3)flash both images on Ubuntu:
Code:
./fastboot flash boot boot-insid3r-0.1.img
./fastboot flash recovery recovery-insid3r-0.1.img
or on Windows
Code:
fastboot.exe flash boot boot-insid3r-0.1.img
fastboot.exe flash recovery recovery-insid3r-0.1.img
4)boot your device into recovery mode (HOME+POWER)
Demo
ClockworkMod Recovery for Compaq Airlife 100: http://www.youtube.com/watch?v=rh8DhuDt0FY
Images
ClockworkMod Info
This recovery was compiled with the 4.0.0.8 source code, and it still under tests before final github submission for aproval.
Any question, just ask.
If you are familiar with Cyanogen porting please send me a PM.
Best Regards
Hey INSID3R great work!!!!
I come from CHW forum.
I`ll try this now!
Hi,
I noticed that people already downloaded the files. Can you provide some feedback?
Note: adb is now working but only over wi-fi.
Better chance for newer Android ?
Hi,
I just got an idea which are the capabilities of ClockworkMod. Using this tool I am able to install a better Android than 1.6.
But is any newer Android for this device out there?
Regards
Svgt99
svgt99 said:
Hi,
I just got an idea which are the capabilities of ClockworkMod. Using this tool I am able to install a better Android than 1.6.
But is any newer Android for this device out there?
Regards
Svgt
Click to expand...
Click to collapse
I'm working on that too. It will take some time to have a ROM ready since I'm not working full-time on this.
Cheers
How do I enter commands paar after this in FastBoot?? how I do this in Windows? Please put clearer instructions in order to offer a feedback
cesargdmi said:
How do I enter commands paar after this in FastBoot?? how I do this in Windows? Please put clearer instructions in order to offer a feedback
Click to expand...
Click to collapse
hi cesargdmi,
Just updated the first post with more instructions on how to prepare your PC.
If you still have questions feel free to ask.
Best Regards
Up and running now, I'm trying to create a ROM for this device but I never did, so I'll have to read much to make, I am not relying on these links.
http://forum.xda-developers.com/showthread.php?t=633246
http://theunlockr.com/2010/03/26/ho...om-for-android-part-1-setting-up-the-kitchen/
but apparently, it is not easy, you've made ​​some progress in creating the ROM? to please me feedback.
cesargdmi said:
Up and running now, I'm trying to create a ROM for this device but I never did, so I'll have to read much to make, I am not relying on these links.
http://forum.xda-developers.com/showthread.php?t=633246
http://theunlockr.com/2010/03/26/ho...om-for-android-part-1-setting-up-the-kitchen/
but apparently, it is not easy, you've made ​​some progress in creating the ROM? to please me feedback.
Click to expand...
Click to collapse
In the next few days I'll give an update on my developments. But I'm still on an early stage, I still don't have a bootable ROM .
I'm trying to build a custom ROM from Cyanogen code. This is how to prepare the Cyanogen code for your PC:
Install the Build Packages
1)Install using the package manager of your choice:
For 32-bit & 64-bit systems:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
For 64-bit only systems:
Code:
sudo apt-get install g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
NOTE: gcc-4.3-multilib g++-4.3-multilib is no longer available for Ubuntu 11.04 64-bit, but should still build without issue.
NOTE: On Ubuntu 10.10, and variants, you need to enable the parter repository to install sun-java6-jdk:
add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Create the Directories
You will need to set up some directories in your build environment.
To create them:
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
Install the Repository
Enter the following to download make executable the "repo" binary:
Code:
curl [url]http://android.git.kernel.org/repo[/url] > ~/bin/repo
chmod a+x ~/bin/repo
NOTE: You may need to reboot for these changes to take effect.
Now enter the following to initialize the repository:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync -j16
This will take about two hours.
With this tutorial you will have the Cyanogen Android OS 2.3.5 code on your system.
To start a ROM for Compaq Airlife 100 you will need to create these under the device/ directory:
Code:
mkdir compaq
cd compaq
mkdir airlife
cd airlife
And paste these files there.
This is only a basic start, we will need to learn by your own from here. Try to see the other directories inside the device/ folder and learn from other devices settings.
hehe
I'm just installing Ubuntu 9.10 to start doing the procedure, although I was reading says that is only valid for HTC but do not lose anything by trying.
if you run into any progress let me know
Adb
Hi Insid3r can you try to modify this file "default.prop" in the root folder? Inside this is a command with this name "persist.service.adb.enable=0", try to put a 1.. My english is bad sorry.!
I'll post that later, already did that to make the ADB work via Wi-Fi. Even with that option enabled the ADB doesn't work via USB.
Best Regards.
Ok, I did not know, but at least I tried. I also managed to install Flash Player 10.1, but can not get it to work with the native browser and others like opera and dolphinn either. Could you help me?
Best regards
Pleace, I'll go creazy thinking about how to install flash player plugin.
The file I used is on various internet sites is called "flash for 21" and I change and put in the AndroidManifest.xml "minsdk = 4" to install in the airlife.! Can you help me with this?
Thank you!!!!
Greetings.
@insid3r
Hi! I'm going to try this... have you stoped trying to port it? Or is any limitation? Is the bootloader unlocked? I don't undertand if the reason that there's NO roms is that it's blocked somehow, or is it for there's not many poeopl souporting this kidn of projects =/
I WANT to follow with this, please contact me through PM
Greetings from Argentina.
Insid3r, thanks ever answer but I need ask you something about update the compaq airlife 100, after you make the fastboot (back+power) and connect the netbook to the USB computer.
What driver you'd use? because in my Hardware Administrator not show the device, just says Android 1.0 (and its unrecognized) and in cmd when call the function fastboot devices (in the help command says must show a list of devices and not appear the compaq)
Best and thanks for your time.

[GUIDE] Setting up ADB and fastboot on ChromeOS using Crouton

**I TAKE NO RESPONSIBILITY FOR WHATEVER HAPPENS TO YOUR CHROMEBOOK.**
Follow this guide at your own risk
First, I would like to say that I have no built anything myself. All the work shown here has been compiled from the internet.
Second, I am no expert at this kind of thing but I have tried out everything myself and this is what has worked for me with Acer C7. ADB and fastboot work without any problems on my computer.
Third, this can actually go beyond just ADB and fastboot. You can develop with minimal restraints, but I will only be covering how to install ADB and fastboot.
Finally, I would appreciate if someone familiar with all of this would tell me what I can cut out/add as this was done by a trial and error process so I’m not entirely too sure what is necessary and what is not, or if there is an easier way of going about things.
This is a guide for anyone who wants to be able to run ADB and fastboot on their chromebook. Just note that it may take a lot of memory (it took around 4-5 GB for me), so you may want to install it on an SD card.
WARNING!
In order to run crouton and install Ubuntu you will have to go into developer mode which will wipe your device.
Instructions can be found here: http://www.chromium.org/chromium-os/poking-around-your-chrome-os-device
You can work with virtual terminal 2 or crosh shell. I recommend using a crosh shell because it’d be easier to look back here for info.
Files you’ll need (Choose according to 32 or 64 bit)
Crouton- http://goo.gl/fd3zc (Official site: https://github.com/dnschneid/crouton)
Android SDK- http://dl.google.com/android/adt/adt-bundle-linux-x86-20131030.zip OR http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20131030.zip (Official Site: https://developer.android.com/sdk/index.html?hl=sk )
JDK- http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.tar.gz or http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz
I will not go over the actual installation of crouton as that can be found here: https://github.com/dnschneid/crouton
I used precise and xfce:
Code:
-e ~/Downloads/crouton -t xfce
Okay now that you have crouton installed and running, let’s get to work. First comes the installation of JDK. Download the version of JDK for your bit version and extract it. Go over to Ubuntu (using the command:
Code:
sudo startxfce4
) and using terminal emulator move it over to /usr/lib/jvm with the code
Code:
sudo mv jdk1.7.0_51 /usr/lib/jvm/
Using the file manager go to /home/<USERNAME> and open the .bashrc file using gedit text editor and add this code at the end, DO NOT OVERWRITE ANYTHING
Code:
PATH=${PATH}:/usr/lib/jvm/jdk1.7.0_51/bin
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_51
Wit that, you are done with installing JDK.
Moving onto the actual Android SDK, first download it.
Extract it and move the SDK into /local/usr
Assuming that the file is in your Downloads directory, use the commands:
Code:
sudo mv adt-bundle-linux-x86-20130219 /usr/local/
Next you’ll make a symlink to make typing commands easier:
Code:
sudo ln -s /usr/local/adt-bundle-linux-x86-20130219/ /usr/local/adt
Then go back to the bashrc file and add this code at the end once again, DO NOT OVERWRITE ANYTHING:
Code:
PATH=/usr/local/adt/sdk/platform-tools:/usr/local/adt/sdk/tools:/usr/lib/jvm/jdk1.7.0_15/bin:/usr/local/gradle-1.4/bin:$PATH
ANDROID_HOME=/usr/local/adt/sdk
Save and close the file, and run the command “. ~/.profile” in terminal.
Run the code and answer with y:
Code:
sudo apt-get install ubuntu-standard
sudo apt-get install ubuntu-desktop
sudo apt-get install synaptic
sudo apt-get install ia32-libs
sudo apt-get update
This might take some time and when that finishes type in
android
If you get permission denied run the command:
Code:
chmod u+x android
This should launch the Android SDK Manager. Check the tools section and install. When this is done, you should have ADB up and running.
Check using the command:
Code:
adb version
or just by typing adb
if you get list of commands you can run, congratulations ADB has been installed successfully!
Now check fastboot by typing fastboot. Once again if you get a list of commands for fastboot, congratulations you're done!
You now have ADB and fastboot on your Chromebook!
You can PM me and I will try to help if you have questions, or reply to this post.
Enjoy! :good:
Excellent post. One quick question however. When I attempt to install ia32-libs I get this:
Code:
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0
E: Package 'ia32-libs' has no installation candidate
My question is: Should I install all 3 replacement packages (lib32z1 lib32ncurses5 lib32bz2-1.0)? One of them?
This dude here says I can repackage it manually. Should I do that?
You rock for taking the time to post this!
Tanks so much!
I would install everything as it is replacement
This guide is a bit long and tedious so if you want here is an installer made by HeadFox that worked for me on Trusty Unity.
http://forum.xda-developers.com/showthread.php?t=2431956
cheers!
when i get to entering ~/.profile, I get a permission denied message. the only thing different that I know I did was use the android SDk from the Android studio currently available and not the zip you provided a link to and obviouslyh change the file paths accordingly. any thoughts
08BajaBoy said:
when i get to entering ~/.profile, I get a permission denied message. the only thing different that I know I did was use the android SDk from the Android studio currently available and not the zip you provided a link to and obviouslyh change the file paths accordingly. any thoughts
Click to expand...
Click to collapse
You basically want to run .profile again, which is run once you spawn your linux chroot/crouton. I think the easiest way is to just logout of your linux session and then run crouton again.
Yeah, that's sorta like a "just reboot it" fix but not actually a full reboot.
vanillaflavor said:
**I TAKE NO RESPONSIBILITY FOR WHATEVER HAPPENS TO YOUR CHROMEBOOK.**
Follow this guide at your own risk
First, I would like to say that I have no built anything myself. All the work shown here has been compiled from the internet.
Second, I am no expert at this kind of thing but I have tried out everything myself and this is what has worked for me with Acer C7. ADB and fastboot work without any problems on my computer.
Third, this can actually go beyond just ADB and fastboot. You can develop with minimal restraints, but I will only be covering how to install ADB and fastboot.
Finally, I would appreciate if someone familiar with all of this would tell me what I can cut out/add as this was done by a trial and error process so I’m not entirely too sure what is necessary and what is not, or if there is an easier way of going about things.
This is a guide for anyone who wants to be able to run ADB and fastboot on their chromebook. Just note that it may take a lot of memory (it took around 4-5 GB for me), so you may want to install it on an SD card.
WARNING!
In order to run crouton and install Ubuntu you will have to go into developer mode which will wipe your device.
Instructions can be found here: http://www.chromium.org/chromium-os/poking-around-your-chrome-os-device
You can work with virtual terminal 2 or crosh shell. I recommend using a crosh shell because it’d be easier to look back here for info.
Files you’ll need (Choose according to 32 or 64 bit)
Crouton- http://goo.gl/fd3zc (Official site: https://github.com/dnschneid/crouton)
Android SDK- http://dl.google.com/android/adt/adt-bundle-linux-x86-20131030.zip OR http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20131030.zip (Official Site: https://developer.android.com/sdk/index.html?hl=sk )
JDK- http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.tar.gz or http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz
I will not go over the actual installation of crouton as that can be found here: https://github.com/dnschneid/crouton
I used precise and xfce:
Code:
-e ~/Downloads/crouton -t xfce
Okay now that you have crouton installed and running, let’s get to work. First comes the installation of JDK. Download the version of JDK for your bit version and extract it. Go over to Ubuntu (using the command:
Code:
sudo startxfce4
) and using terminal emulator move it over to /usr/lib/jvm with the code
Code:
sudo mv jdk1.7.0_51 /usr/lib/jvm/
Using the file manager go to /home/<USERNAME> and open the .bashrc file using gedit text editor and add this code at the end, DO NOT OVERWRITE ANYTHING
Code:
PATH=${PATH}:/usr/lib/jvm/jdk1.7.0_51/bin
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_51
Wit that, you are done with installing JDK.
Moving onto the actual Android SDK, first download it.
Extract it and move the SDK into /local/usr
Assuming that the file is in your Downloads directory, use the commands:
Code:
sudo mv adt-bundle-linux-x86-20130219 /usr/local/
Next you’ll make a symlink to make typing commands easier:
Code:
sudo ln -s /usr/local/adt-bundle-linux-x86-20130219/ /usr/local/adt
Then go back to the bashrc file and add this code at the end once again, DO NOT OVERWRITE ANYTHING:
Code:
PATH=/usr/local/adt/sdk/platform-tools:/usr/local/adt/sdk/tools:/usr/lib/jvm/jdk1.7.0_15/bin:/usr/local/gradle-1.4/bin:$PATH
ANDROID_HOME=/usr/local/adt/sdk
Save and close the file, and run the command “. ~/.profile” in terminal.
Run the code and answer with y:
Code:
sudo apt-get install ubuntu-standard
sudo apt-get install ubuntu-desktop
sudo apt-get install synaptic
sudo apt-get install ia32-libs
sudo apt-get update
This might take some time and when that finishes type in
android
If you get permission denied run the command:
Code:
chmod u+x android
This should launch the Android SDK Manager. Check the tools section and install. When this is done, you should have ADB up and running.
Check using the command:
Code:
adb version
or just by typing adb
if you get list of commands you can run, congratulations ADB has been installed successfully!
Now check fastboot by typing fastboot. Once again if you get a list of commands for fastboot, congratulations you're done!
You now have ADB and fastboot on your Chromebook!
You can PM me and I will try to help if you have questions, or reply to this post.
Enjoy! :good:
Click to expand...
Click to collapse
Welldone mate!!

[GUIDE]Cross Compiling C/C++ for ARM on Linux

I wrote this guide to make it easy for everyone to be able to cross compile c/c++ for android, the easy way that I know. I admit, I am a total n00b to c/c++. I started learning to cross compile when I got my new nexus 9 for christmas. I, for some reason, couldnt get busybox installed on it. So, I had to manually compile and load it on there. After reading a hundred tutorials and none of them working, I got frustrated. Finally, I compiled a working version. And it was SO EASY. Anyway, Im specifically giving instructions for Ubuntu 14.04/14.10. First thing you need to do is download a package called binutils-arm-linux-gnueabi.
- sudo apt-get install binutils-arm-linux-gnueabi
- sudo apt-get install binutils-aarch64-linux-gnu (for aarch64, or arm 64bit, or armv8)
- sudo apt-get install binutils-arm-linux-gnueabihf (for armhf)
To compile busybox for your platform, you must download the source package you want to compile from http://busybox.net/downloads/. Then extract it
- tar xvf busybox.tar.gz
Then, cd into your root busybox folder.
- export ARCH=arm
- export CROSS_COMPILE=arm-linux-gnueabi- (dont forget the trailing dash(-))
This will setup your variables for compilation. Then
- make menuconfig (if you dont get a config menu, you need to "sudo apt-get install libncurses5-dev")
Now, go into the busybox settings -> Build options. Select the option "build busybox as static executable". You can select/deselect options by hitting the space bar. [ESC] key will take you back. Make sure to save your new configuration. Its almost time to compile! One last thing. If you want to add your name to it, go into the Makefile in the root busybox folder. At the top of the file, where it says EXTRAVERSION = .git, you can add something like -bynarie or whatever you want. That way when you run busybox on the terminal emulator on android, it will print out something like "BusyBox v1.24.0-bynarie". OK! Time to compile. Really simple:
- make install
This will compile every applet, and put everything in a folder called _Install. You will have busybox and busybox_unstripped in the root directory. Please, be aware that this busybox puts an applet named "su" in the bin folder in the _install folder. So, DO NOT COPY THE SU APPLET INTO YOUR ANDROID BIN FOLDER, OR YOU WILL LOSE ROOT!!! Now, to verify it compiled to the right architecture, do "file busybox" at the term and it should spit out something like "ELF 32bit ARM executable". If this is the case, congrats. We have successfully compiled busybox for android arm!! Copy the needed files over to your device and set permissions and you are done. The suggested way to move the busybox binary to your device is as follows:
- adb push busybox /data/local/tmp/busybox
- open adb shell and do "chmod 755 /data/local/tmp/busybox" or chmod it on your linux box before pushing.
- open file manager on device and move busybox to /system/xbin
- If properly done, should work.
For other nix programs like tar, the procedure is as follows:
- Open term, cd into root source folder
- ./configure CC="arm-linux-gnueabi-gcc" CPP="arm-linux-gnueabi-cpp" --host=arm-linux-gnueabi
- make
The CC variable is your C compiler command and the CPP variable is the C preprocessor, if you need to add a C++ compiler just add CXX="arm-linux-gnueabi-g++" but TAR is specifically C only. You can add all three variables I would assume to be safe. Most of the time, the readme or install documents will give you some guidance on cross compiling. But, this is how I successfully compiled TAR for arm and aarch64.
If you want to compile small/single source file c/c++, you will be using the same tools, but in a different way. Cd into your source file directory, and depending on which type of source it is (c or cpp), you will do the following:
- arm-linux-gnueabi-gcc helloWorld.c -static -o helloworld.out (for C)
- arm-linux-gnueabi-g++ helloWorld.cpp -static -o helloworld.out (C++)
Yep, its that easy. I cant guarantee 100% this will work on everything, but its a good starting point. And you dont even have to fool with the Android NDK. I find that the android ndk would mostly benefit "Apps" that need to integrate c/c++ code into them, not little console apps run from the terminal emulator. I hope someone finds this guide useful and if anyone has any problems trying to get somethin to work, you can respond and I will do my best to help.
thanks

Categories

Resources