In Need of a translator CMD code to Terminal code for board sticky of Side loading ap - Captivate Android Development

Been talking to Lekky and we have all these great things grouped into one thread. One important thread is side mounting the captivate.
Things it gives you are SDK which can be downloaded for PC or Mac.
Drivers again PC or Mac.
Then Root access no biggie
Busy box no biggie.
Then it goes into the CMD language for PC on how to edit the database file using CMD prompts to enable the sideloading of APKs directly on the phone.
What we are looking for is someone to translate this into mac terminal command lines. Here is how it reads now:
Connect USB to phone with USB Debugging ON
Command prompt
cd to SDK install directory
cd tools
adb shell
su
cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db.backup
exit
exit
(This should bring you back to your windows command prompt.)
adb pull /sdcard/settings.db %userprofile%\desktop
(This should copy the settings.db to your desktop in Windows. Keep your cmd window open, you'll need it again.)
Install SQLite Manager Plugin for Firefox
Open SQLite Manager Plugin within Firefox (Tools->SQLite Manager)
Click Database
Click Connect Database
Find settings.db
Expand Tables
Click secure
Scroll down to ID 6, "install_non_market_apps". Double-click.
Change value ( TEXT ) from 0 to 1
Close SQLite Manager
(Back to that cmd window)
adb push %userprofile%\desktop\settings.db /sdcard
adb shell
su
cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings
busybox chown 1000 /dbdata/databases/com.android.providers.settings/settings.db
busybox chgrp 1000 /dbdata/databases/com.android.providers.settings/settings.db
reboot
Disconnect USB from phone. Your phone should be rebooting.
Done! I tested this and was able to install siriusxm.apk from siriusxm.com/android.
Who knows Mac Terminal commands well enough to translate this so that it can be posted in this sticky thread along with the windows version for us?

put ./ before each command
./adb pull /sdcard/settings.db %userprofile%\desktop
./adb shell
then carry on like normal
su
cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings
busybox chown 1000 /dbdata/databases/com.android.providers.settings/settings.db
busybox chgrp 1000 /dbdata/databases/com.android.providers.settings/settings.db
reboot
then do the ./ again
./adb push %userprofile%\desktop\settings.db /sdcard

Also, if you *read* the sticky, it provides these notes, in blue, to make it more pronounced.

yea was on androidforums not here they didnt have the mac side, found it here after u guys mentioned it, awesome ty.

Related

How to root the Hero using a MAC

I didn't find any mentions of this in the other threads or a thread dedicated to this, but just wanted to point out that it is very easy to do this on a Mac.
You will need to follow the same instructions in the other guides, but you can do it all from the Mac OS Terminal easily and no need to install drivers, just like you would with Linux.
In case someone wants step by step instructions, here they are modified for Mac OS:
Original instructions by chuckhriczko http://forum.xda-developers.com/showthread.php?t=581577
Step 1:
First you need to download the Android SDK. You can get it from http://developer.android.com/sdk/index.html. Download the Mac OS version and remember where the android-sdk-mac folder is (most likely in your Downloads folder)
The next thing we download is asroot2. This is a script that was developed that runs an exploit in Android's linux that allows us to run root. The link for that is here: http://forum.xda-developers.com/attachment.php?attachmentid=244212&d=1257621154. Unzip that file and place it in a directory of your choice (I used android-sdk-mac/tools). Also download http://www.androidspin.com/downloads.php?dir=amon_ra/RECOVERY/&file=recovery-RA-heroc-v1.2.3.img and place that into the same directory you extracted asroot2.
Step 2:
Connect the phone to the USB port.
Open a terminal and cd into the directory that you extracted the sdk into. Then cd into the tools directory. Then run the following commands:
sudo ./adb push /directory_you_placed_asroot2/asroot2 /data/local/
sudo ./adb shell chmod 0755 /data/local/asroot2
sudo ./adb shell /data/local/asroot2 /system/bin/sh
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
cat sh > su
chmod 4755 su
type exit until you are back to your Mac's prompt.
Now your phone is officially rooted! We arent done yet though. Now you need to flash the recovery image. If you are still in adb shell type in exit until you are out. You should be in the directory where you extracted the recovery image. If not go there. Type in the following:
sudo /.adb push recovery-RA-heroc-v1.2.3.img /sdcard/
Once that is done, type in sudo ./adb shell. If your command prompt is a dollar sign then type in su and press enter. If it is a pound sign you are good. Then type in the following:
flash_image recovery /sdcard/recovery-RA-heroc-v1.2.3.img
Once that is finished you are done. To reboot into recovery type in
sudo ./adb shell reboot recovery
If you are already in the shell, just type
reboot recovery
You should reboot into recovery mode and you can go from here. You can do a nandroid backup and then follow the other guides to install a different ROM or any other things you want to do.
If there are no instructions for Mac, just follow the Linux/Ubuntu instructions as they will be very similar if not the same.
Actually...
http://forum.xda-developers.com/showthread.php?t=581686
This is the thread I used to root my Hero CDMA from my Macbook, worked just fine...Thanks anyways for giving some love to macusers, guides are usually windows only.
I thought it was weird that there wasn't a Mac dedicated thread. I guess the search doesn't like 3 letter words.

I can´t install apk to my X10i via CMD adb??

Can not find a usbdriver for ADB that works for sony ericsson x10i?
http://code.google.com/p/adb-file-explorer/
//dong 2007
dong2007 said:
Can not find a usbdriver for ADB that works for sony ericsson x10i?
Click to expand...
Click to collapse
Not looked hard enough ADB, Fastboot, and Nandroid for Noobs
It is not for X10i, but G1 and droid?
Shall i first install Android SDK?
dong2007 said:
It is not for X10i, but G1 and droid?
Click to expand...
Click to collapse
Worked for me.
dong2007 said:
Shall i first install Android SDK?
Click to expand...
Click to collapse
nephron said:
This Guide is for windows only. If you are using Mac OS X please go here: ADB For Dummies
If you are using Linux please go here: [HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux
--------------------------------------------------------------------------
Things you need:
Android SDK - Download
Winrar - Download (32bit) Download (64bit)
Windows PC
USB Cable
--------------------------------------------------------------------------
Setting up the Android SDK
Download the file from above
Unzip to your desktop
Take the "android-sdk-windows" folder and move it to the root of your hard drive (C:\)
Right click on My Computer and click properties
Select the Advanced Tab or Advanced System Setting (Vista/Windows 7)
Select Environment Variables...
Press New
For Variable Name type: adb
For Variable Value type: C:\android-sdk-windows\tools
Now, [Get new sdk (1.5r3) to work]
1. Run SDK Setup.exe
2. If it gives you an error go to settings and click on "Force http//....."
3. Select all options and let it download and install
If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)
--------------------------------------------------------------------------
Preparing your phone for ADB
Go to Settings on your phone
Select Applications
Select Development
Make sure 'USB Debugging' is checked
--------------------------------------------------------------------------
Installing Drivers
Plug in your phone through USB and DO NOT MOUNT IT!!!!!
Your computer should see a new device and try to install Android 1.0 driver (If it doesnt, scroll down to the "Im not getting a notification of Android ADB when i plug in my USB" section)
Let it load
Once it cant find them select "Install drivers from my pc"
The drivers you need are in the Android SDK 1.5r2 folder (C:\android-sdk-windows\usb_driver)
Depending on your OS pick x86 or amd64
You ADB Android Device should now be installed! Good Job
For Android SDK 1.5r3+
1. Run SDK Setup.exe
2. If it gives you an error go to settings and click on "Force http//....."
3. Select all options and let it download and install
If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)
--------------------------------------------------------------------------
Check if your phone is detected by ADB
Open up Command Prompt (Go to run, type in cmd, press enter)
Type in
Code:
cd C:\android-sdk-windows\tools === Press Enter
adb devices === You should see your device listed
adb shell === you should see # in the next line
Now you are all set to run adb commands
Note: for a list of commands type in 'adb' in cmd
CONGRATS YOU NOW HAVE ADB FULLY RUNNING!
--------------------------------------------------------------------------
"Im not getting a notification of Android ADB when i plug in my USB"
Why: Your computer has detected your phone but as a protable device and as a storage device.
Fix: This took me a lot of research and time to figure out so this is what your are going to do.
First download USBDeview - Here
Unzip it
Run USBDeview.exe as Administrator
You will see all drivers being used on your computer
Highlight and Uninstall all drivers with the description have HTC Android (Should be 3 of them)
Right Click on the driver and press uninstall
Once done, Unplug your phone and plug it back in
You should now get the notification of the ADB device
Follow the steps above to install the drivers
--------------------------------------------------------------------------
When Typing just adb in cmd you will get whats called a "usage doc" which gives you a lits of commands that you can use:
Code:
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb root - restarts adb with root permissions
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PDP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
--------------------------------------------------------------------------
Commands that you should know
adb push - Insert file to phone such as Stock.apk to /data/app_s
Code:
adb push <pathtofile.apk> <file system location> - Example: adb push c:\app.apk /data/app
adb pull - Remove file from phone such as Stock.apk from /data/app_s
Code:
adb pull <pathtofile.apk> - Example: adb pull /data/app_s/Stock.apk
adb install - Install app to phone
Code:
adb install <path to file> - Example: adb install c:/apps/apps2sd.apk
adb uninstall - Uninstall app from phone
Code:
adb uninstall <name of application> - Example: adb uninstall linda.apk
For more ADB Commands go - Here
--------------------------------------------------------------------------
Thats it for ADB! Congrats and if you have any questions please ask me or if anything is missing or not correct please tell me. I got all of this from research and personal experience.
Click to expand...
Click to collapse
XperiaX10iUser said:
Worked for me.
Click to expand...
Click to collapse
Okej I will try it out..
I can´t install Calculator.apk or the modified youtube.apk (High quality set as default) on my X10i????
for the calculator(is it a system apk) ? if yes then you have to push it to /system/app, if not try installing after signing it.
For youtube.apk i am sure it is a system apk and you need to push it to system/app
realunited123 said:
for the calculator(is it a system apk) ? if yes then you have to push it to /system/app, if not try installing after signing it.
For youtube.apk i am sure it is a system apk and you need to push it to system/app
Click to expand...
Click to collapse
I tried this method:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2/system
adb push YouTube.apk /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb shell rm /sdcard/YouTube.apk
adb shell reboot
but still falied ?
I have obviously put youtube.apk into SDcard folder
dong2007 said:
I tried this method:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2/system
adb push YouTube.apk /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb shell rm /sdcard/YouTube.apk
adb shell reboot
but still falied ?
I have obviously put youtube.apk into SDcard folder
Click to expand...
Click to collapse
looking at the screen shot you gave i am sure you haven't pushed it to sdcard .
it should be
Code:
adb push "the path where you have the apk" /sdcard/YouTube.apk
unless you have copied it to android-sdk folder.
And it seems it didn't mount the system to r/w .
Try these:
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push "the path where you have the apk" /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb reboot
realunited123 said:
looking at the screen shot you gave i am sure you haven't pushed it to sdcard .
it should be
Code:
adb push "the path where you have the apk" /sdcard/YouTube.apk
unless you have copied it to android-sdk folder.
And it seems it didn't mount the system to r/w .
Try these:
Code:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push "the path where you have the apk" /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb reboot
Click to expand...
Click to collapse
now I get this message
Try This....
dong2007 said:
now I get this message
Click to expand...
Click to collapse
First step push the .apk file to your sdcard. then unmount your sdcard.
Then...
Code:
adb shell [B]{press enter}[/B]
$ su
su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
note the space between the /mtdblock2 and /system...[you typed it without the space the first time]...
now check with the mount command...
Code:
# mount
there should be a few lines of output check for this one...
Code:
/dev/block/mtdblock2 /system yaffs2 rw 0 0
Note the "rw".... it indicates your fs is mounted now as read-write if it is "ro" [read only] then you made a mistake somewhere along the line...
if it is mounted succesfully as rw... then try this...
Code:
#dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
then
Code:
#reboot
hope it helps...
dong2007 said:
now I get this message
Click to expand...
Click to collapse
well have you rooted your phone ? which method did you use ?
realunited123 said:
well have you rooted your phone ? which method did you use ?
Click to expand...
Click to collapse
I use Universal Androot (One Click Root), and my phone are rooted. I can use Marketacces, TB, root explorer and Quickbot...
dong2007 said:
I use Universal Androot (One Click Root), and my phone are rooted. I can use Marketacces, TB, root explorer and Quickbot...
Click to expand...
Click to collapse
OK. Maybe reboot you phone and try again ?
sam_a200 said:
First step push the .apk file to your sdcard. then unmount your sdcard.
Then...
Code:
adb shell
$ su
su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
note the space between the /mtdblock2 and /system...[you typed it without the space the first time]...
now check with the mount command...
Code:
# mount
there should be a few lines of output check for this one...
Code:
/dev/block/mtdblock2 /system yaffs2 rw 0 0
Note the "rw".... it indicates your fs is mounted now as read-write if it is "ro" [read only] then you made a mistake somewhere along the line...
if it is mounted succesfully as rw... then try this...
Code:
#dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
then
Code:
#reboot
hope it helps...
Click to expand...
Click to collapse
Still not working, i get this message.
Shall i mount or unmount my sdcard, when I start cmd??
I have the unmount...
realunited123 said:
OK. Maybe reboot you phone and try again ?
Click to expand...
Click to collapse
do it automatically via cmd when I use the formula which
(it is actually the only Ossetians it makes the mobile..)
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push YouTube.apk /sdcard/YouTube.apk
adb shell dd if=/sdcard/YouTube.apk of=/system/app/YouTube.apk
adb shell rm /sdcard/YouTube.apk
adb shell reboot
dong2007 said:
Still not working, i get this message.
Shall i mount or unmount my sdcard, when I start cmd??
I have the unmount...
Click to expand...
Click to collapse
you don't need to mount the sdcard... Maybe try ADB magic ? search the forums for it.
dong2007 said:
Still not working, i get this message.
Shall i mount or unmount my sdcard, when I start cmd??
I have the unmount...
Click to expand...
Click to collapse
Please do read my post again...edited it with further explanations... after typing "adb shell" press enter you will get a new line with "$" symbol... now type "su"... and go on...
sam_a200 said:
Please do read my post again...edited it with further explanations... after typing "adb shell" press enter you will get a new line with "$" symbol... now type "su"... and go on...
Click to expand...
Click to collapse
Now i get message "permission denied" :S
Now can i install the modifed Youtube apk via astro :S
so something must be right
I´ve the modified youtube installed now on my X10i, and it starting with high quality now

[Q] Using a DROID X and MAC together is tough -- can someone help?

Too many threads... too many sites and PC options.
Here's my situation:
Droid X
Used the leak update... running 2.2 now.
Use a MAC. And have Terminal app on DX.
Have SBF file for 2.1 stock, have ZIP files of rooted 2.2's
Dont have custom recovery.
Dont care much about warranty or OTA... just want to be able to apply ZIPs.
I need to somehow either root my DX with Mac or Terminal app. Or flash the SBF to bring things back to 2.1.
Not sure what to do??? Please please help.
I am not familiar with terminal commands...so if you leave instructions that would be great.
-Roman
You follow the same ADB commands, more or less. Why not try something like Universal AndRoot though? Then you could just skip over it.
But, if you need to sbf, I would *think* you follow the Linux instructions.
1) download sbf_flash & sbf file
Code:
cd directory/where/these/are/located
./sbf_flash SBFfileLOCATION
The only way to SBF is to run windows through bootcamp or this http://www.droidforums.net/forum/droid-hacks/38671-flashing-sbf-mac.html . I am in the same boat as you luckily my girlfriend has a dell running Windows. You should also be able to root 2.2 using the Droid 2 method posted in this section http://forum.xda-developers.com/showthread.php?t=766767. I assume you have the SDK downloaded already? The Linux directions does not work for Mac.
x.v_ said:
You follow the same ADB commands, more or less. Why not try something like Universal AndRoot though? Then you could just skip over it.
I TRIED THAT, BUT THERE IS SOME ERROR THAT POPS UP... CAN'T DO IT. 2.2 ISN'T SUPPORTED... I THINK IT'S JUST FOR 2.1..
But, if you need to sbf, I would *think* you follow the Linux instructions.
1) download sbf_flash & sbf file
Code:
cd directory/where/these/are/located
./sbf_flash SBFfileLOCATION
Click to expand...
Click to collapse
SO THAT EASY? JUST TWO COMMAND LINES?
So, if I put the SBF on my desktop it would be:
cd desktop (enter)
./sbf_flash fullSBFfilename.sbf (enter)
???????
romanvail said:
SO THAT EASY? JUST TWO COMMAND LINES?
So, if I put the SBF on my desktop it would be:
cd desktop (enter)
./sbf_flash fullSBFfilename.sbf (enter)
???????
Click to expand...
Click to collapse
Running ADB with Mac OSX and therefore rooting with the mac is EASY. Just make sure you have the Android SDK installed on your Mac. Make sure in your .bash_profile you have the path set to the tools directory of your SDK folder.
Since I can't tell if you have all this down, I'll give you the instructions on setting up adb on the mac (using terminal), then give you the directions I followed on rooting my Droid X from OSX (I am running 2.2 leaked).
Essentially follow these instructions (taken from tjrocks91 on droidforum... I'd link, but I am not yet allowed to post outside links on this forum):
1. Download the Android SDK for Mac OSX. (google it)
2. Extract the zip file to any destination on your Mac. *Remember its path!*
In the AndroidSDK folder, there will be a folder named “tools”. We will be adding this folder to the path on Mac OSX. For this example, extract to your home folder (the folder that contains the desktop, documents, etc. folders)
3. To do this click on Finder > Go > Utilities > Terminal.
4. Type in without quotations “cd ~/”
5. Next, type "touch .bash_profile" to create your new bash or otherwise known path file.
6. Next, type "open -e .bash_profile" to open it in TextEdit. A TextEdit window will open, copy and past this into that window, substituting <username> for your username on OSX:
export PATH=${PATH}:/Users/<username>/AndroidSDK/tools
7. Save the file and close the window.
8. Repeat steps 5 through 7, but replace .bash_profile with ".bashrc" (without the quotes)
9. ADB should be ready to go. Make sure that your Droid X is set to "charge only" when connected via USB, and that you have debug mode set to on in your Android settings (settings>applications>development> USB Debugging)
10. In terminal, type (without the quotes): "adb devices". You should see a return that gives a list of devices attached. If the daemon wasn't started yet, this will do it. After that, type "adb shell" to enter adb.
11. After that, the adb commands are ALL the same on any platform, just make adjustments for different file systems when moving things TO your phone when using the command prompt (and not in the adb shell itself, but using adb commands). OSX follows unix/linux file structure, but not always the linux/unix file arrangement (but pretty darn close, since it is a Unix BSD GUI).
Now onto rooting your DX running 2.2. I've attached the file I used. It is a .rar files, so you will need a .rar extractor. I found a nice free one on the net called UnrarX. Google it, get it. Its free, it works. I will give instructions assuming you have them. These instructions come from karnovaran here on XDA. THey are for the droid 2, but work for the Droid X as well. i will translate them into instructions that can be followed verbatim on Mac (as the instructions he gave are meant for those doing this through the command prompt in windows).
1. Extract the contents of the attached file to your sdk tools folder
2. Open a terminal window and navigate to your sdk tools folder. if you put the sdk folder in your home folder, then the command and path you should enter from the terminal should be something like this:
cd AndroidSDK/tools
3. Now the process is as follows (follow EXACTLY, making sure you are faithful to YOUR file paths). I'm copying almost verbatim from karnovaran:
- adb devices (to verify the connection)
- adb push Superuser.apk /sdcard/Superuser.apk
- adb push su /sdcard/su
- adb push busybox /sdcard/busybox
- adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin
- adb shell
- cd data/local/tmp
- chmod 0755 rageagainstthecage-arm5.bin
- ./rageagainstthecage-arm5.bin
- let the process run until it 'kicks' you out (this WILL take a while, so don't TOUCH ANYTHING on your phone. Just go grab a beer and relax until the proces kicks you back out to the tools folder in terminal)
- adb kill-server
- cd <wherever-your-sdk-tools-folder-is>
- adb devices (to verify the connection)
- adb shell (you should now have a # prompt, if not return to ./rage step above)
- mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
- cp /sdcard/Superuser.apk /system/app/Superuser.apk
- cp /sdcard/su /system/bin/su
- cp /sdcard/busybox /system/bin/busybox
- chmod 4755 /system/bin/su
- chmod 4755 /system/bin/busybox
- mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
- exit
- exit
This got me root on my DX and I did this on OSX no problem. The only PC I have that is functional is my laptop for work and because of the content on it and security procedures, though I could do android hacking with it, I will not, so I'm stuck with using my Mac. Thing is that it really is NOT hard. Commands are almost exactly as in Linux/Unix, and OSX terminal runs bash, which is quite versatile (more commands than busybox, iirc) in and of itself. And getting mac root access is bloody easy using sudo if you need it (otherwise, don't use it).
I hope this helps. Have fun.
many steps.... but will go slowly.
Thank you!!!!
Many steps, but they work!
SirBrass said:
Running ADB with Mac OSX and therefore rooting with the mac is EASY. Just make sure you have the Android SDK installed on your Mac. Make sure in your .bash_profile you have the path set to the tools directory of your SDK folder.
Since I can't tell if you have all this down, I'll give you the instructions on setting up adb on the mac (using terminal), then give you the directions I followed on rooting my Droid X from OSX (I am running 2.2 leaked).
Essentially follow these instructions (taken from tjrocks91 on droidforum... I'd link, but I am not yet allowed to post outside links on this forum):
1. Download the Android SDK for Mac OSX. (google it)
2. Extract the zip file to any destination on your Mac. *Remember its path!*
In the AndroidSDK folder, there will be a folder named “tools”. We will be adding this folder to the path on Mac OSX. For this example, extract to your home folder (the folder that contains the desktop, documents, etc. folders)
3. To do this click on Finder > Go > Utilities > Terminal.
4. Type in without quotations “cd ~/”
5. Next, type "touch .bash_profile" to create your new bash or otherwise known path file.
6. Next, type "open -e .bash_profile" to open it in TextEdit. A TextEdit window will open, copy and past this into that window, substituting <username> for your username on OSX:
export PATH=${PATH}:/Users/<username>/AndroidSDK/tools
7. Save the file and close the window.
8. Repeat steps 5 through 7, but replace .bash_profile with ".bashrc" (without the quotes)
9. ADB should be ready to go. Make sure that your Droid X is set to "charge only" when connected via USB, and that you have debug mode set to on in your Android settings (settings>applications>development> USB Debugging)
10. In terminal, type (without the quotes): "adb devices". You should see a return that gives a list of devices attached. If the daemon wasn't started yet, this will do it. After that, type "adb shell" to enter adb.
Last login: Tue Sep 14 09:12:34 on console
Roman-Vails-Computer:~ romanvail$ cd ~/
Roman-Vails-Computer:~ romanvail$ touch .bash_profile
Roman-Vails-Computer:~ romanvail$ open -e .bash_profile
Roman-Vails-Computer:~ romanvail$ touch .bashrc
Roman-Vails-Computer:~ romanvail$ open -e .bashrc
Roman-Vails-Computer:~ romanvail$ adb devices
-bash: adb: command not found
Roman-Vails-Computer:~ romanvail$
*****DOESNT WORK FOR ME*****
Click to expand...
Click to collapse
Do you have the path to adb set properly?
Sent from my DROIDX using XDA App
SirBrass said:
Do you have the path to adb set properly?
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
Yeah this would be your problem.
@OP,
yes, it would be just that easy IF AND ONLY IF the linux commands apply to macs as well. Which I have NO IDEA on. so proceed at your own risk :z
i finally figured it out... saw another post....
here's what worked:
./
Here's my log in case anyone else needs is:
Roman-Vails-Computer:~ romanvail$ adb
-bash: adb: command not found
Roman-Vails-Computer:~ romanvail$ cd/Users/romanvail/android-sdk-mac_x86/tools -bash: cd/Users/romanvail/android-sdk-mac_x86/tools: No such file or directory
Roman-Vails-Computer:~ romanvail$ cd /Users/romanvail/android-sdk-mac_x86/tools Roman-Vails-Computer:tools romanvail$ ./adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list of the following values
1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes priority over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these debug tags are printed.
Roman-Vails-Computer:tools romanvail$ adb devices
-bash: adb: command not found
Roman-Vails-Computer:tools romanvail$ ./adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
015D61C60A003017 device
Roman-Vails-Computer:tools romanvail$ ./adb push Superuser.apk /sdcard/Superuser.apk
1059 KB/s (27688 bytes in 0.025s)
Roman-Vails-Computer:tools romanvail$ ./adb push su /sdcard/su
1802 KB/s (26248 bytes in 0.014s)
Roman-Vails-Computer:tools romanvail$ ./adb push busybox /sdcard/busybox
1918 KB/s (1926944 bytes in 0.980s)
Roman-Vails-Computer:tools romanvail$ ./adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin
726 KB/s (5392 bytes in 0.007s)
Roman-Vails-Computer:tools romanvail$ ./adb shell
$ cd data/local/tmp
$ chmod 0755 rageagainstthecage-arm5.bin
$ ./rageagainstthecage-arm5.bin
[*] CVE-2010-EASY Android local root exploit (C) 2010 by 743C
[*] checking NPROC limit ...
[+] RLIMIT_NPROC={3815, 3815}
[*] Searching for adb ...
[+] Found adb as PID 2846
[*] Spawning children. Dont type anything and wait for reset!
[*]
[*] If you like what we are doing you can send us PayPal money to
[*] [email protected] so we can compensate time, effort and HW costs.
[*] If you are a company and feel like you profit from our work,
[*] we also accept donations > 1000 USD!
[*]
[*] adb connection will be reset. restart adb server on desktop and re-login.
$ Roman-Vails-Computer:tools romanvail$ ./adb kill-server
Roman-Vails-Computer:tools romanvail$ ./adb kill-server
* server not running *
Roman-Vails-Computer:tools romanvail$ cd /Users/romanvail/android-sdk-mac_x86/tools
Roman-Vails-Computer:tools romanvail$ ./adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
XXXXXXXXXXXXXXXX device
Roman-Vails-Computer:tools romanvail$ ./adb shell
# mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
# cp /sdcard/Superuser.apk /system/app/Superuser.apk
# cp /sdcard/su /system/bin/su
# cp /sdcard/busybox /system/bin/busybox
# chmod 4755 /system/bin/su
# chmod 4755 /system/bin/busybox
# mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system
# exit
Roman-Vails-Computer:tools romanvail$ exit
logout
[Process completed]
Now that's odd. I only get problems when I try and use ./ just regular "adb" works on my machine.
SirBrass said:
Now that's odd. I only get problems when I try and use ./ just regular "adb" works on my machine.
Click to expand...
Click to collapse
Yea pretty weird... I use OSX 10.5.8
Intel machine... so, it's weird, but IT DID WORK.
romanvail said:
Yea pretty weird... I use OSX 10.5.8
Intel machine... so, it's weird, but IT DID WORK.
Click to expand...
Click to collapse
There's your problem.... you're using leopard . I'm using 10.6.3. Love it. They did well with this new OS version (for those who don't know... the difference to users between Leopard and Snow Leopard for OSX folks is like the diff between Eclair and FroYo... the former is good, but the later far exceeds it under the hood though still remaining almost the same on the front end).
And obviously that means I'm running an intel machine as well. 2008 iMac 20".... 2.66 Ghz Core 2 Duo. Just your regular, nothing-special iMac.
I thought Macs were supposed to be user friendly?
*snicker*
Sent from my DROIDX using XDA App
Will this method work for a Droid X on Android 2.3.4 Gingerbread and with build # 4.5.1_57_DX8-51 Also is there a new one click type solution by now on a Mac?

[Q] SuperUser Commands

What for SuperUser command does exists?
Is there a List?
How can i get the file from
/data/data/com.android.providers.settings/databases/settings.db ?
i used:
adb pull /data/data/com.android.providers.settings/databases/settings.db C:
but it says:
failed to copy '/data/data/com.android.providers.settings/databases/settings.db' to 'C:': Permission denied
any solution?
try typing
Code:
su
or if not try
Code:
adb remount
I dont know much about this stuff yet, but that could help
ilendemli said:
How can i get the file from
/data/data/com.android.providers.settings/databases/settings.db ?
i used:
adb pull /data/data/com.android.providers.settings/databases/settings.db C:
but it says:
failed to copy '/data/data/com.android.providers.settings/databases/settings.db' to 'C:': Permission denied
any solution?
Click to expand...
Click to collapse
are you rooted?
try:
Code:
adb shell "su -c 'cp /data/data/com.android.providers.settings/databases/settings.db /sdcard/'"
this will use su to copy it to the sdcard, then you should be able to pull it from there. Phone may pop up a "Superuser request". Be prepared to allow it.
when i type:
adb shell "su -c '/data/data/com.android.providers.settings/databases/settings.db /sdcard/'"
It says:
/data/data/com.android.providers.settings/databases/settings.db: permission denied
My Device is rooted, and i gave su permission
You forgot the "cp" between "su -c" and "/data/data/..."
C:\Users\ilendemli>adb shell "su -c '/data/data/com.android.providers.settings/databases/settings.db /sdcard/'"
/data/data/com.android.providers.settings/databases/settings.db: permission denied
C:\Users\Muhammet ilendemli>adb shell "su -c 'cp /data/data/com.android.provider
s.settings/databases/settings.db /sdcard/'"
cp: not found
My CMD Window, whats wrong?
Hum, that's strange.
Try this : (<Enter> means pressing the Enter key on your keyboard)
adb shell <Enter>
su <Enter> (here you may have to look at your phone to give him the autorisation it needs)
cp /data/data/com.android.providers.settings/databases/settings.db /sdcard/ <Enter>
If it says "cp: not found", try this line :
busybox cp /data/data/com.android.providers.settings/databases/settings.db /sdcard/ <Enter>
busybox: not found
Try to replace busybox by bb in the command I gave you.
If it doesn't work, well, I'll doubt you did your root well ^^ Cause it should have install BB
Can you explain us what you did to root your phone ?
I used SuperOneClick Root, to root my Phone. it installed the su files and superuser.apk nothing else
EdIT:
I installed busybox manually and rebootet my phone, now when i type:
>adb shell "busybox -c cp '/data/data/com.android.providers.settings/databases/settings.db /sdcard/'"
it says:
-c: applet not found
EDIT2:
>adb shell
$ busybox cp /data/data/com.android.providers.settings/databases/settings.db /sdcard/
busybox cp /data/data/com.android.providers.settings/databases/settings.db /sdcard/
cp: can't open '/data/data/com.android.providers.settings/databases/settings.db': Permission denied
$
That's normal, you missed the "su" command in your Edit 2.
So, 2 ways to do it.
Edit 1 version :
adb shell "su -c busybox cp '/data/data/com.android.providers.settings/databases/settings.db /sdcard/'"
Edit 2 version :
adb shell
su
busybox cp /data/data/com.android.providers.settings/databases/settings.db /sdcard/
And I thought SuperOneClick did install BB... Well, I thought wrong ^^
Edit 1 version: Didnt worked..
Edit 2 version: WORKED!? i have the database,
now, how can i give these command in java?
anything with exec("..
From adb, you can't execute Java methods (because you're not in a JVM).
And I don't think you can access the DB like that in fact.
You have to make an app that read/write/do what you want on the DB (and it seems you're doing so, refering to the other topic you made )
it's not allowed, to edit databases directly, so my app will copy the database somewhere else, edit it, and copy it back, then it should work.
€: and i don't want to edit databses from the adb, i cant do it, the program cant do it, but java can do it:
Code:
myDB.execSQL("DELETE FROM system WHERE name = 'name1';");
myDB.execSQL("DELETE FROM system WHERE name = 'name2';");
myDB.execSQL("INSERT INTO system (name, value) VALUES ('name1', '"+arr[0]+"');");
myDB.execSQL("INSERT INTO system (name, value) VALUES ('name2', '"+arr[1]+"');");
Yes it should.
Make sure you don't mess with the DB though. It's an easy thing to break
Edit : From adb, apparently you can do something like
sqlite3 settings.db
Then you'll have a DB prompt where you can write SQL commands like SELECT, INSERT, etc.
can busybox delete and replace files?
BB lets you use any Unix command.
So you can use (in your example) the mv command, which will move a file from a directory to another one.
Runtime.getRuntime().exec("busybox mv /sdcard/ /data/data/com.android.providers.settings/databases/settings.db");
this should work
E: Hmm, doesn't work..
E2: should look like this: Runtime.getRuntime().exec("busybox mv /sdcard/settings.db /data/data/com.android.providers.settings/databases/");
will try it.
Yes. But remember you have to be root to do that

Ad Blocking on ZTE Open

Until there are ad blocking apps for FFOS it needs a DIY method.
I'll assume you know how to use adb and have it set up on your machine. I'll also assume you have rooted your phone following the instructions here.
I use Linux so my commands may be a bit off in places.
1. Collect a suitable hosts file. I used the one on my Android phone but this one seems to update regularly http://winhelp2002.mvps.org/hosts.txt
2. Save the file as 'hosts' to a known location on your PC.
3. Open a shell window (command window) on your PC and check adb works.
Code:
adb devices
should return roamer2. If not, on your phone, go to settings > More Information > Developer - and check Remote Debugging.
4. In the shell window - change directory to where you have saved the hosts file. then type:-
Code:
adb push hosts /sdcard/
5. When that completes type:-
Code:
adb shell
you'll see $ prompt
Code:
su
If you are rooted correctly you'll see # prompt
Code:
mount -o remount,rw /system
Mounts the system folder for read / write permissions.
Code:
cat /system/etc/hosts
Should show just '127.0.0.1 localhost'
Save this if you want as hosts.old
Code:
busybox mv /system/etc/hosts /system/etc/hosts.old
Now replace the hosts file with the new one:-
Code:
busybox mv /sdcard/hosts /system/etc/hosts
To check your hosts file has been replaced type
Code:
cat /system/etc/hosts
And lots of domain names will whiz past.
All done.

Categories

Resources