Android: Difference between revisions
From charlesreid1
| Line 250: | Line 250: | ||
Now we can restart into the boot loader menu again. | Now we can restart into the boot loader menu again. | ||
===Step 2: Restart into Boot Loader== | ===Step 2: Restart into Boot Loader=== | ||
Power down, then power on while holding the volume down button. | Power down, then power on while holding the volume down button. | ||
Revision as of 08:15, 18 July 2015
This page has got some info on how I use my Android phone.
Installing Android SDK
Mac OS X
Download android-sdk_r10-mac_x86.zip from here: http://developer.android.com/sdk/index.html
Extract to wherever you want, I put it with the rest of my 3rd-party packages in ~/pkg. It's a binary, so you can just extract the .zip file and put it anywhere.
You'll want to add the location of a couple of utilities to your $PATH, by adding this to your .profile or whichever dot file you put your $PATH stuff into (or just by running these from your command line, if this is a one-time thing for you):
export PATH="${HOME}/pkg/android-sdk-mac_x86/platform-tools:${PATH}"
export PATH="${HOME}/pkg/android-sdk-mac_x86/tools:${PATH}"
You can test it worked right by running:
$ which adb
/path/to/android-sdk-mac_x86/platform-tools/adb
$ which android
/path/to/android-sdk-mac_x86/tools/androidThis doesn't come with all the things you'll need, so before doing anything else, run the "android" program, which will run the Android SDK Manager.
I recommend installing the following:
- SDK Platform Android (whatever the latest API is)
- Android SDK Platform-tools
- Android SDK Tools
Pick "Available packages" from the side bar and then collapse the various lists there. You'll find the above packages in the list.
If you try and collapse the list and you see a "Failed to fetch URL (blah blah blah)", then pick "Settings" from the side bar and check "Force https://... sources to be fetched using http://...".
Windows
1. Extract the HTC_Droid_Incredible_Root.zip file to a folder with the same name
2. Open the folder and launch HTCSync2.0.25.exe and complete the installation
3. Copy the sdk directory into the root of the C drive, in C:\sdk
4. Open C:\sdk and run SDK Setup.exe
a) you may get an error about https, if you do then close the window with the error message and click "Settings" on the left-hand side, then check the box that says Force https:// sources to be fetched using http://)
b) you may also need to update the version of the Tools. Click on "Available Packages" on the left-hand side of the "Android SDK and AVD Manager" window, and then check the "Android SDK Tools" box, and then click "Install Selected".
5. Go back to the unzipped HTC Droid Incredible Root folder and open command.txt
6. Open a Windows command prompt (Start > Run > "cmd")
7. Change directory to C:\sdk\tools by running
> cd\ > cd sdk > cd tools
Internet Tethering
You can get internet tethering for free using a program called Proxoid (http://code.google.com/p/proxoid). It creates a proxy service, so that all internet requests from the computer are forwarded (via USB) to the phone, and the phone then forwards the request to The Interwebs.
This literally took me 30 seconds to set up. It's very, very simple if you've got the right tools.
1. First, you'll want the Android SDK kit, because you'll use it to send instructions to the phone. See #Installing Android SDK above.
2. Enable USB debugging on your phone: Settings > Application > Development > Enable USB Debugging
3. Open the Proxoid application on your phone. I'll assume you're using port 8080, but change it to any port you want.
4. Run this command to tell your phone to handle tcp traffic from your local computer to the Android phone:
$ adb forward tcp:8080 tcp:8080
Now, when your computer sends requests via port 8080, your phone knows how to handle it correctly.
You will need to run this command every time you want to use Proxoid!
5. Set proxy settings on your local machine so that IT knows to send requests via port 8080. See next section.
Setting Proxy Settings
You can do this a couple of different ways:
Proxy Option 1: Browser Only
Most modern browsers allow you to set proxy settings that are specific to the browser. I use (and recommend) Firefox, but other browsers will work too. First, pick Firefox > Settings > Advanced, and pick the "Network" tab:
Click "Settings", and Firefox will allow you to configure proxy settings. You want to configure the proxy to be localhost and the port to be 8080:
In normal-people speak, this tells your computer to route all internet requests through port 8080 of the local machine. Then, any requests to port 8080 are handled by the phone (well, by Proxoid) becuase of the "adb forward tcp:8080 tcp:8080" command you ran above.
Proxy Option 2: System-Wide
Still working this one out.
Proxy Option 3: SSH Tunnels
You can use a utility called Corkscrew available here: http://www.agroman.net/corkscrew/
Alternatively, you can use the ProxyTunnel utility available here: http://proxytunnel.sourceforge.net/
You can combine this tool with SSH tunnels to redirect traffic from any port through an SSH tunnel.
Following the Proxoid Linux users guide (http://code.google.com/p/proxoid/wiki/installationLinux), you can point SSH to the Corkscrew command by adding the following to ~/.ssh/config:
ProxyCommand /usr/local/bin/corkscrew localhost 8080 %h %p ServerAliveInterval 10
Note that this will work even when SSHing to non-standard ports. If you run "ssh -p 12345 user@host", then it will pass "host" to "%h", and "12345" to "%p".
The ServerAliveInterval is required, because otherwise SSH connections will be closed after around 30 seconds. This sends a "keepalive" packet to the server every 10 seconds.
Rooting
I picked up an Android HTC Evo 4G for about $15, couldn't pass that up, so I wanted to figure out how to root it.
The summary of steps is as follows:
- Unlock bootloader on phone
- Download script to root phone
Yup, so here's the breakdown of those steps:
Unlock Bootloader
You can start by getting an account and instructions at http://www.htcdev.com/bootloader/unlock-instructions. They'll provide some binaries that you'll need too.
Step 1: Turn off Fast Rebooting
Step 1 is to turn off fast rebooting. This was in Settings > Applications > Fast Rebooting (uncheck it).
Step 2: Download Fastboot Binary
Step 2 is to download the fastboot binary. See the HTC developers website for the binary - they provide it.
Step 3: Run Fastboot
Step 3 is to run fastboot on your Mac. You'll tell it to listen for a device and get an identification token, basically a fingerprint for your device:
./fastboot-mac oem get_identifier_token
This will sit and wait for a device until it finds one, then it'll print the ID token to the screen.
Step 4: Reboot into Boot Loader
Step 4 is to reboot into the boot loader menu by turning off the phone, and then turning it on while holding down the "Volume Down" button.
Sequence: (Turn off phone.) (Hold down the Volume Down button.) (Power on the phone.)
You should now see a white android boot loader screen:
If you use the power button to select "Fastboot USB", you should see a dump of information on the screen where you ran the fastboot command.
<<<< Identifier Token Start >>>> ED5D284CF59A7747615E7487CA511419 FDBAE245F8910567A34142D436E00153 ED5D284CF59A7747615E7487CA511419 FDBAE245F8910567A34142D436E00153 ED5D284CF59A7747615E7487CA511419 FDBAE245F8910567A34142D436E00153 ED5D284CF59A7747615E7487CA511419 FDBAE245F8910567A34142D436E00153 ED5D284CF59A7747615E7487CA511419 FDBAE245F8910567A34142D436E00153 <<<<< Identifier Token End >>>>>
you'll copy and paste that whole block into the HTC developers website, and they'll email you a key that you use to unlock the phone and put firmware onto it.
Step 5: Using the Emailed Key
When I checked my email after submitting my device token, I found a .bin file attached to the email. Download it. Now run the following to get an unlock token using this key:
fastboot flash unlocktoken Unlock_code.bin
You'll see a screen like this, confirming you want to unlock the bootloader and void your warranty:
Use the Volume Up to pick yes, and Power to select it. The Android phone will restart, and go through a new account setup. This is a brand-new install, everything is wiped clean.
Oh yeah, did I mention you should back up your stuff?
Ready to Root
Once you do all this, you'll finally be done... and ready to actually root the phone.
Rooting It
Following the instructions here
Step 1: Settings
Since unlocking the bootloader reset the system, we lost all our settings. Sooo.....
First, disable fast boot again. Settings > Applications > Fast boot (uncheck it).
Second, enable USB debugging again. Settings > Applications > Development > USB debugging (check it).
Now we can restart into the boot loader menu again.
Step 2: Restart into Boot Loader
Power down, then power on while holding the volume down button.
Use volume down to pick bootloader and the power button to pick it.
Get the phone to be in fastboot mode, and waiting for the computer to do something.