how mount userdata.img or userdata-qemu.img in osx - android

Disk Utility in OSX easily mounts an SD Card image as a device, but not so the other img files.
I want to get the database I just created in the Android Emulator off the drive and into my osx file system.
I updated my system with qemu using macports but no combination I try succeeds. Anyone figured out how to do this?
Obviously one way I can do this is run the app on my phone than mount the phone as a USB drive. But I don't wanna. I wanna get it off the drive the emulator uses :-)
Thanks in advance, folks.
Michael

Can't you just use adb to pull the database off of the emulator? I actually just answered a similar question... here it was:
The database for a specific app lives in /data/data/[packagename]/databases
The packagename is the package you define in your manifest, for instance /data/data/org.vimtips.supacount/databases/counts.db.
You can view it with adb shell and type sqlite3 /data/data/org.vimtips.supacount/databases/counts.db
Or you can pull it from the device to look at it with a third party utility, with a command like adb pull /data/data/org.vimtips.supacount/databases/counts.db ..

Use the File Explorer in DDMS (from Eclipse SDK), you can see the whole file system there and download/upload files to the desired place. That way you don't have to mount and deal with images, and no adb commands either

Related

Install GApps zip on Android device without recovery

I need help figuring out how to install a Google Apps .zip (or gapps package) on an Android device without using recovery. I have not seen this process documented anywhere, and before I go manually copying files from the zip onto a device, I'd like to see if anyone can give me some guidance. The device in question is rooted, but installing a custom recovery (such as Clockwork) is not an option. It seems straightforward enough (as the zip's internal file structure is recognizably an android fsh), but before I go and happily copy a bunch of files to a critical test device I'd like some input as to whether or not there is a preferred method.
It's a little late but i have done this yesterday because i have the same probleme.
The option i use is open a root shell with adb.
Then use the linux mount command
I don't remember the exact command but it's look like this:
"mount -o remount,rw ext4 /system"
And then i copy the file of the system folder of the gapps zip to /system then i reboot my phone and all gapps were installed
Hope it help you or someone who found this like me in the futur.

Android Cannot see anything inside data folder

i am trying to see SQLite database in anyway possible (I have a rooted device). I tried File explorer in eclipse but i cannot see anything under data folder. Can anybody please help me with this
I tried to search everywhere but couldnt find a clear solution.
I also tried adb shell but i cannot see list of things inside data folder using "ls" command.
error
Opendir failed. Permission denied
I am guessing this has something to do with rights but how can i fix it
Please help
You need root premission to explore DATA directory...
From phone
I use terminal emulator to do the job..... Simply open terminal then type in su after that it will ask for premision. then you need to type cd data/data/WhereEverYouNeedToGo/databases and "WhereEverYouNeedToGo" should be package name. After that you could do whatever you want with your database.
from PC
open terminal or cmd goto your adb directory then run adb shell then su and then
cd data/data/WhereEverYouNeedToGo/databases
Hope it helped.
Run adb in root mode using "adb root"
adb shell
su
ls /data/
Try this
You have been given a number of answers for how to leverage the root capability, however as android is designed without the assumption of root there are other methods as well which you can use while developing apps.
1) Include functionality on an expert menu to copy the database to the sdcard; there is no file copy method in android java (and in most stock cases no 'cp' shell command), but you can find numerous answers here with a copy routine.
2) Make your apk debuggable and use the run-as command to obtain a shell running as the application userid and starting in the app's data directory. You can then copy the database to the sdcard if the app has that permission.
3) Have your app set the permissions on the database file during development to world readable. Although you cannot browse the directory tree to down to it, you can then adb pull the database file by giving it's full path name.
You need to have either routed device or your device should be a "Android Dev Phone" to explore that directory. Trying checking the same using emulator, you will be able to see the data folder contents.

Root Android phone

I have created a database for my app and I want to check .db folders to check the data inserted while developing. But my Android mobile will not allow to access data folder. To achieve this I have rooted my mobile with GingerBreak.apk. Device rebooted but nothing happened. How can I check my data base from my phone.
Note: I can't check the data using emulator, because app cant run on emulator, it uses, Bluetooth, WiFi,etc.
Regards,
Krishna
You need to install some file broswer(such as R.E file manager) to access to these .db files. They are located in /data/data/{package name} dir.
Meanwhile, you can access these file via command line.
For emulator:
Type adb shell in the command line, and you can see a "#" prompt.
Type 'cd /data/data/{package name}` to go to the very dir where the
.db file is located.
Now type sqlite3 <db file name, no extension> so that you can execute SQL command to read and control the .db file. Now you can see a "sqlite>" prompt.
For real device(phone must be rooted):
Step 2 and 3 are the same. In Step 1, you have to type "adb shell", and then "su" to see the "#" prompt.
Hope it helps.
To root your phone. You can use lucky patcher app.Although there are plenty of apps available around internet but i found it worth using
By using this app you can not only root your device as well as remove annoying ads and much more.

How to browse android emulator SD on Windows without Eclipse?

Can't understand how to browse android emulator sd card. I am using IDEA, not Eclipse and can't use Eclipse tool for this purpose.
Use DDMS. It is available as a standalone tool, in addition to the Eclipse perspective.
Or you can also use adb located in android-sdk-directory/tools.
To do this open up a command line and type adb shell when developing on Linux or adb.exe shell when developing on Windows then you will be logged in into your Android emulator where you can simply use basic UNIX commands to navigate to the SDcard. You'd do that like this cd /sdcard and to list whats in there you us ls.
Hope it helped.
I'm using ImDisk. Very easy to mount the iso file, just right click on it and choose mount from the menu. Add/Remove files as there will appear a new mounted unit and once done, right click and unmount. I also assumed you are running windows, as a nix user wouldn't ask such question :)

Can't access data folder in the File Explorer of DDMS using a Nexus One!

I have my Nexus One connected with the USB.
When I visit the File Explorer of the DDMS, if I click on the "data" folder the little plus near the name "data" disappear for 2-6 seconds and then reappear but the contenct of the folder "data" is not showed!
Here some other information:
the folder data has permissions drwxrwx--x
the OS of my PC is Windows XP
Eclipse v. 3.5.2
Android SDK 1.6
If the adbd daemon is running as root, you can browse /data using adb-based tools such as the DDMS file explorer or the adb shell.
If it's not, you can access a few files under /data and its children directly by their full path names, but you cannot browse (or 'cd' to) most of the folders, including /data itself.
"rooting" as an unofficial process means varying things and produces varying results - ie, adbd may or may not run as root.
If ro.secure is set to 0 in the startup scripts such as /init.rc, adbd will run as root, but that may not be a good idea on a user device. It is set to 0 on the emulator, and that's why you can browse /data there.
Finally, note that /init.rc is usually contained in a ramdisk image packed onto the kernel - you can't really edit it on the phone but would have to modify the image offline, re-attach it to the kernel, and re-flash them. Though if you have some sort of working 'su' hack you may be able to change the property temporarily and restart adbd.
In this link (http://denniskubes.com/2012/09/25/read-android-data-folder-without-rooting/) Dennis Kubes shows a method for accessing your application's data folder without root access.
Turns out there is a simple solution, the run-as command.
run-as com.your.package ls -l /data/data/com.your.package
run-as com.your.package rm /data/data/com.your.package/databases/mydatabase.db
That will allow you to run commands as your app. You can also use run-as in interactive mode.
run-as com.your.package
shell#android:/data/data/com.your.package $ ls
cache
databases
lib
shared_prefs
rm databases/mydatabase.db
Interactive mode will drop you into the data folder for your app. You can navigate from there.
I don't think anyone really understands this question. Giorgio can use the DDMS File Explorer to browse the ./data folder on his phone. Pentium10 talks about needing root access on the phone.
Well I a retail Nexus One and a developer Nexus. I have always been able to use DDMS File Explorer to browse the ./data folder on my developer phone but not my retail phone. So I rooting my retail phone would help. I didn't.
So the bottom line is there is something different about the retail and developer phones. Until more research is done you won't be able to browse the data folder on your phone.
Hope this helps.

Categories

Resources