02-22-2018 10:20 PM
38 12
  1. truslide's Avatar
    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
    (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.
    12-13-2010 09:33 PM
  2. truslide's Avatar
    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.
    12-13-2010 09:33 PM
  3. truslide's Avatar
    The Last thing i'm going to include in this thread are some important, very VERY useful and IMPORTANT links. Did I mention that these are VERY useful links? These links are easy reads and I learned off them and have used them as resources. I have them bookmarked. I suggest you bookmark the ones you like.

    Terminology READ THIS ONE FIRST- A Dummies Guide To Android Terminoligy & Lingo - Droid Forum - Verizon Droid & the Motorola Droid Forum

    Everything OFFICIALLY Android - Android SDK | Android Developers

    Simpleroot - Simpleroot provided by JerzyIroc

    Everything about the BASH you need to know - An introduction to the Bash Shell

    Useful info for people thinking of Rooting - Common misconceptions and other useful information (Updated 10/12/2010) - xda-developers

    MAC USERS!!!!!! An alternative to struggling with MAC ROOT - Running Windows on Your Mac With VirtualBox | Mac.AppStorm

    I will be adding to this and updating this with more detailed information and more explanations as they are either requested, needed, or discovered. Remember, we are ALL learning, continuously.
    12-13-2010 09:34 PM
  4. Pre-dawn raid's Avatar
    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 12:12 PM
  5. SmokeCrawler's Avatar
    12-14-2010 01:33 PM
  6. igotsanevo4g's Avatar
    Good write up man! This is sure to help alot of folks.
    12-14-2010 05:02 PM
  7. truslide's Avatar
    ^Thanks man, hopefully it will mitigate a lot of the questions we get, or questions people are afraid to ask. It's still a lot, but at least I've compiled it, it's a work in progress too.
    12-14-2010 06:14 PM
  8. 2CupsWithString's Avatar
    You know what's funny is I D/L'd the SDK today after the update and adb isn't in tools anymore!
    12-14-2010 07:49 PM
  9. truslide's Avatar
    yea i know a few people who said that. check the platform-tools folder? it's in there somewhere... lol
    12-14-2010 08:31 PM
  10. Dave Blake's Avatar
    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.

    12-14-2010 08:38 PM
  11. igobytony's Avatar
    hey! here's that sticky... nice job, man! and thanks.
    12-14-2010 09:07 PM
  12. truslide's Avatar
    ^did you get root?
    12-14-2010 09:10 PM
  13. igobytony's Avatar
    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
  14. 2CupsWithString's Avatar
    yea i know a few people who said that. check the platform-tools folder? it's in there somewhere... lol
    It's in platform tools only after you run the exe and start downloading software versions.

    I wonder if there were adb changes in gingerbread or why they re-did this.
    12-14-2010 09:39 PM
  15. Kevin OQuinn's Avatar
    This is a great write-up. I think it goes beyond beginner level, now, though.
    12-14-2010 11:33 PM
  16. truslide's Avatar
    I tried to keep it simple in the first post... Then go a bit more knowledged. I'll review it again and make it easier to read and a bit more simple. That's the start, I have to get in the SDK and mess around some more to explain some more things.
    12-15-2010 05:11 AM
  17. imiller913's Avatar
    Wow nice write up. Thanks.
    12-18-2010 08:19 PM
  18. Calma10's Avatar
    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?

    12-19-2010 12:29 AM
  19. truslide's Avatar
    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?

    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 06:16 PM
  20. enzofall's Avatar
    Wow this is a very helpful and extensive guide. I haven't been able to dive into all of it yet but i can already tell this is going to help me tons. Thanks everyone for the good work.
    12-20-2010 09:24 PM
  21. d3xn2o's Avatar
    Good job bro...
    12-21-2010 07:19 AM
  22. Calma10's Avatar
    Hi, I was able to installed the sdk on ubuntu, but I'm not sure how to used adb. could anyone recommend goods instructions on adb using ubuntu? Thanks
    01-21-2011 12:37 AM
  23. skeeber's Avatar
    Thanks from a newb to the Android experiance
    02-05-2011 10:15 AM
  24. skeeber's Avatar
    Great read TruSlide. It's a lot of info a newb like myself needs
    02-05-2011 10:36 AM
  25. jerrykur's Avatar

    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.
    02-11-2011 01:24 PM
38 12