- 12-13-2010, 09:33 PM
Thread Author #1
[Official] Beginners Introduction to the SDK(ADK)
Alright Beginners and new-comers. In an attempt to take something overwhelming, and underwhelm it... I'm going to take what I know and have learned about the SDK over the past few months and try to compile it into a very basic and easy to understand thread. This is going to be the simplest explanation, with the detail it will need.
Credits go out to
#1 JerzyIroc
Vaelek
igotsanevo4g
iamlilysdad
d3x
xhausx
regawd_linaed
liquid_jesus
(Thanks for all your help and taking the time to answer my questions and educate me.)
So lets get started. o_O
Ready... Breathe... it's not that intimidating. Remember, I don't know A-N-Y-T-H-I-N-G! lol
So, What is an SDK/ADK?
The DK stands for Development Kit. S-Standard / A-Android.
What is the primary reason for/benefit of having an SDK installed on my computer?
If at any point you would like to start developing applications, this is your starting point. In addition to Eclipse, which I'll discuss later, the Android SDK provides you with the "framworks" of Android 1.6, 2.1, 2.2, 2.3, and so on as they're released.
What is the "framework"?
The framework is the construction of android. Think about a build, if you were to strip away all the windows and lighting and all that stuff, you'd have the infrastructure, all the frames... essentially the "framework". It's the same with Android. In the world of the developers, this is what they see and work with.
Why is the SDK/ADK important to me if I want to learn about the ADB?
The reason the SDK is important to you as a typical user is because in order to access your ADB, you'll need to download, install, and open your SDK.
What does ADB stand for?
Android Debug Bridge. I will explain the ADB in more detail later in the second post.
What is Eclipse
Eclipse is the Virtual (Development) Envrionment where applications are actually built. This is where their framework is constructed and then you, as a developer, can begin to add on and build up the framework. Eclipse uses the ADK/SDK to keep current with ALL of the current Android OS's. So in Eclipse, you'll now find the Gingerbread setup and you can now start developing apps for gingerbread. This is all it is. If you know Java code, then you already know about Eclipse. The Eclipse environment also offers a nice feature known as the AVD Manager.
What is the AVD Manager?
The AVD is the Android Virtual Device. This is an emulator. You can simulate your apps on a basic android platform. The AVD will run in Eclipse and allow you to test your app.
Can I actually interact with the SDK and ADB?
You can interact with the SDK. I encourage you to download and explore the SDK. Don't be afraid to look in files and see where everything is. You can preview things in most OS's like MAC and Windows. I'll encourage you to look yourself, but if you do explore it on your own, look for the folder that includes the images on your phone. The images I'm talking about are things like the notification bar, the unlock screen button, and things like that. This is where you can theme your phone. You have to be careful what you do though. You can't just go editing images, renaming them, and do as you please. Do research first.Last edited by truslide; 12-14-2010 at 07:48 PM.
Thanked by 25:+ Show/Hide list of the thanked
- 12-13-2010, 09:33 PM
Thread Author #2
I'm ready to interact with the ADB. What do I need to know?
The Android Debug Bridge is very similar to your command prompt (DOS prompt) or your terminal in mac. When you're in the ADB, you're accessing the phone itself as long as your phone is connected. Your phone does not need to be connected as a disk drive, but your phone does need to have "Debugging Mode" enabled. The way you interact with the ADB is by navigating through the files on your computer or phone and issuing commands.
What do you mean by "navigating through the phone"?
If you locate an executable in the SDK titled "adb", usually located in the "tools or platform-tools folder, and you double click it, you'll see your terminal or command prompt open and execute a whole list of commands. Don't worry, these are just basic commands you can issue in the ADB. Go ahead and read some of the lines, it's actual information you should know. An example of navigating through the phone would be as follows.
Let's say you want to find a picture on your computer in the ADB. If you double clicked on that adb executable, you'll need to open another window with a prompt ready to receive commands, you'll have to do this with terminal. Usually you'll start out at your default or home folder. For me on my MAC, i'll get the prompt -
new-host:~ TruSlide$
Here i'll be able to enter commands. To make things simple, lets say that picture is on your desktop. If you simple type ls (Lower case L and S), you'll receive a list of where you can navigate to. ls is the list command. Try it out. Now you can navigate to your desktop once you see it listed.
I typed desktop and it rejected my command and didn't navigate there. What happened>
Don't worry, the next thing you need to know is the "cd" command. cd stands for change directory. This tells the terminal to change the directory to ~. Try it out, type cd location. (Location is the name of your desktop or whatever folder you see when you type ls.)
[color="red"]The cd command is very important because in order to perform many of these functions, you're going to need to navigate to the folder that adb executable we talked about earlier is located. Mine is on my desktop, in my SDK folder, in my tools folder. So to give you an idea of how I would navigate there, I would type
cd desktop/SDK/tools
Now i'll be in the tools folder and I can start issuing some of the below commands.
Ok cool, tell me about some more commands and the ADB.
pwd - will show you your current location on your computer
cd .. - this will take you back a folder, kind of like backing up or moving back
adb shell - this will access a shell within the phone and let you enter commands directly
adb shell reboot recovery - this will do what it says. It commands the phone to reboot into recovery
adb remount rw - mounts for read/write (r.w.)
adb remount ro - mounts for read only (r.o.)
adb push <localfile> <location> - will push a file from localfile(on computer) to location
adb pull <location> <localfile>- will copy a file from location(on your phone) to localfile
adb root - restarts the adbd daemon with root permissions (doing this wont give you ROOT) nice try
adb usb - restarts the adbd daemon listening on USB
adb devices - will list your device information
adb start-server - starts the connection to the phone
adb kill-server - kills the connection to the phone
su - SuperUser. typing this may prompt a password. Then you'll see s-h3.2$ or #. $means no root, # means root.
exit - leaves the su
logout - logs out of the server
adb logcat - will start logging EVERY event that occurs on your phone. Try it, then wake you phone up, open an app, and watch the adb. To exit you'll need to do ctrl+c. or you'll need to close the window.
adb shell cat /proc/meminfo - will display how much RAM is on your device. Useful for debugging or verifying your phone info
Here's an example of working in the adb
Lets say you have the exploit rageagainstthecage-arm5.bin and it is on your sdcard. The location is /sdcard/exploit/rageagainstthecage-arm5.bin, now you want to work with this file. Here is your interactive example...
adb shell cat /sdcard/exploit/rageagainstthecage-arm5.bin > /data/local/tmp/rageagainstthecage-arm5.bin (This line means that you are moving the rage exploit from the /sdcard/exploit/ to /data/local/tmp)
Once this is done, you'll now have rage in /data/local/tmp
Next you would type : adb shell chmod 0755 /data/local/tmp/rage... (this tells the device that youre going to make a change)
chmod is change mode
adb shell ./data/local/tmp/rage.... (This runs the rage exploit)
So what you can take away with this information is inside an ADB SHELL, you are issuing a command WITHIN the device.
I want to root my phone How do I do it in the ADB.
You'll have to understand the root process first and foremost. The most recent, easy, Root process works be running an exploit on your phone followed by a downgrade to an easier version of android that can be rooted when you run a program like unrevoked or simple root. I don't know how they write their exploits so I cant tell you about that information. What I can tell you is that the step by step process is very specific. Please refer to the link below about "Common misconceptions" to learn more about root. The main thing you'll be running is a .bin file. This is the exploit. What you'll end up doing is either MOVING or PUSHING this to another part of your SD card. I'm not speaking for ALL root methods, just in this instance. Then you will identify that file as executable by typing chmod - which is Change Mode. Finally, you'll execute the change.
Remember take note of the Spaces between words and upper and lower casing. Everything must be exact when doing this.
Lets talk about BASH. You'll see it, so I'll explain it
Bash is an environment that can store larger amounts of data unlike DOS. Without overwhelming the reader, see the link below about the BASH information. This is just a brief explanation of BASH.Last edited by truslide; 12-14-2010 at 08:27 PM.
Thanked by 7: - 12-13-2010, 09:34 PM
Thread Author #3
- 12-14-2010, 12:12 PM #4
Awesome! I haven't had time to read it yet but thanks for putting all this info in one place. Great resource for Android Noobs like me.
- 12-14-2010, 01:33 PM #5
Nice!
- 12-14-2010, 05:02 PM #6
Good write up man! This is sure to help alot of folks.
Some say the glass is half empty. Some say its half full. I say, "Are you going to drink that?" - 12-14-2010, 06:14 PM
Thread Author #7
- 12-14-2010, 07:49 PM #8
You know what's funny is I D/L'd the SDK today after the update and adb isn't in tools anymore!
Fred
@thefredelement - 12-14-2010, 08:31 PM
Thread Author #9
- 12-14-2010, 08:38 PM #10
Thanks for the hard fork truslide this will come in handy when trying to answer questions in the forums not to mention it helping me learn.
Thanks,
Dave - 12-14-2010, 09:07 PM #11
hey! here's that sticky... nice job, man! and thanks.
- 12-14-2010, 09:10 PM
Thread Author #12
- 12-14-2010, 09:39 PM #13
Nope. I ended up spending most of my day trying to finish a book a friend lent me before he moves out of country. But when I do, you can do another write up for stubborn people who insist on doing it the hard way on their Mac.
Sent from my PC36100 using Tapatalk - 12-14-2010, 09:39 PM #14Fred
@thefredelement - 12-14-2010, 11:33 PM #15
This is a great write-up. I think it goes beyond beginner level, now, though.
Forum Rules & Guidelines -- CLICK HERE
I'm an NVIDIA Tegra Champ. Here's what that means. It means that from time to time I might receive products and/or services from NVIDIA to evaluate them and provide feedback to NVIDIA and you, our valuable members. What this does NOT mean is that my opinion will be biased. Any opinion that I express here and elsewhere are solely based on my personal preference and any relevant expertise that I may/may not have on the subject matter. - 12-15-2010, 05:11 AM
Thread Author #16
- 12-18-2010, 08:19 PM #17
Wow nice write up. Thanks.
- 12-19-2010, 12:29 AM #18
I was playing around with the sdk and adb.
every time I used cmd 'adb devices' it comes out a empty space.
if I used adb shell, it returns with 'error: device not found'
I not shore what I did wrong, should I reinstall the sdk again?
thanksLast edited by Calma10; 12-19-2010 at 12:34 AM.
- 12-20-2010, 06:16 PM
Thread Author #19
no it's the command you're entering. try
./adb devices
and make sure you're in your tools folder so there is a connection to the phone. you could also try adb start-server or ./adb start-server
if that doesn't work try
adb root, once the daemon is started you should be good to go working within a shell - 12-20-2010, 09:24 PM #20
- 12-21-2010, 07:19 AM #21
Good job bro...
Arrogant Linux Elitist - 01-21-2011, 12:37 AM #22
- 02-05-2011, 10:15 AM #23
- 02-05-2011, 10:36 AM #24
- 02-11-2011, 01:24 PM #25
Nice.
I might of missed it, but I did not see anything about case sensitivity. Filenames and such are case sensitive and so are some commands in some environments. So it is best to enter commands exactly as written.



Reply



































