I'm compiling a program using gcc on the android through the shell, but want to edit the code on a windows XP machine.
In particular, I'm looking to a method to mount the root level of the android file system, not just the sdcard partitions.
ADB push and pull is too slow. Eclipse DDMS does not mount as su (superuser) and is a bit buggy. The android did not have NFS support.
Samba is a free software re-implementation of the SMB/CIFS networking protocol. Samba Filesharing for android by funkyfresh is a Samba server available on the android to share sdcard data and is available at the play store. Samba requires a rooted android and superuser.
In order to share the root level of the android and not just the sdcard mounts, there is a developer version of funkyfresh Samba. By installing the developers version, the there is an option don't rewrite smb.conf, which does not exist in the public release.
To share the root, setup samba to include password, username, workgroup, netbios. This will by default share the sdcard and has an option to share a second sdcard under Other fileshare options. In the other options, I also disabled no local master browser. This will setup a share or two which can be mounted on windows just as if it were a Microsoft windows network as a member of a workgroup.
Once everything is working. Check the don't rewrite smb.conf. Then pull the adb pull /data/data/com.funkyfresh.samba/files/smb.conf smb.conf and change path = /mnt/sdcard to path = / save the file and adb push smb.conf /data/data/com.funkyfresh.samba/files/smb.conf
Once the file is replaced, disable and enable the sever. Now mount the share on the windows and view, edit, copy files from the android filesystem as a local share on the PC.
Related
Below is the image of how the android device automatically mounts on windows 10 (named: remdiz)
Actual Device: Redmi Note 5 Pro
1: https://i.stack.imgur.com/uOnI4.png
I am not able to get the list of files inside any given folder inside it because I see the path of it as This PC\redmiz\disk\Music which is not accessible in powershell, command prompt or even python.
All I need is to list the files inside Music as I have a same copy on my local and I want to find the difference
Accepted answer can be a batch file, windows command, powershell command, python script, command using git bash etc or any process that will give me a real path of the device named redmiz
MTP doesnt allow this on Windows. Found a tool named MTPDrive. It was a little buggy, but helped by mounting the internal storage and external storage of Android as mapped drive leading to now limitless possibilites for my use case
We have an development board that has been run Yocto system. and we want it to run android system, we already has compiled android image with Yocto kernel that has android's some patch.
We don't know how to flash the android image (such as system.img boot.img and recovery.img and so on) to the development board because of the Yocto system partition different with android system.
we can use fastboot tool to flash Yocto system to EVB.and we want to know:
How to partition eMMC that we can use fastboot tool to flash android system. Do we need to modify Little Kernel code ? and how to modify it in Yocto system.
How to we boot the android system up?
It would be appreciated if you offer any useful information.
Thanks
How to partition eMMC that we can use fastboot tool to flash android system.
You'll need a tool that can partition the eMMC. Considering you are using yocto your best bet is gptfdisk package. gptfdisk recipe is at path poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.0.bb. gptfdisk provides following text-mode partitioning tools
gdisk,
cgdisk,
sgdisk,
fixparts
You can use one of these tools to recreate the partitions in the partition table.
and how to modify it in Yocto system.
Do IMAGE_INSTALL_append = " gptfdisk " in conf file to make the tools of this package part of your image.
How to we boot the android system up?
You'll need 3 partitions
system.img - goes in partition named system
boot.img - goes in system named boot
and recovery.img - goes in system named recovery
Each tool has a man page on Linux. You can read the manuals using man sgdisk, man gdisk, man cgdisk and man fixparts. Some example usages of sgdisk
sgdisk -p </dev/sda> - To print all partitions on the disk
sgdisk --delete=partnum </dev/sda> - Delete a partition. This action deletes the entry from the partition table
There is a lot of way to partition the eMMC, it depends on your system: via USB, sdcard, nfs, uboot...
I think you can have a look at the meta-variscite, especially in the scripts folder. They have flash scripts for Yocto poky images, and android image (on the same boards). They flash from the SDcard to the eMMC.
I ported these scripts for a use with uboot: I run the command ums mmc 0 to start mass storage mode via USB OTG, and on my PC I run an install script which use dd for erasing partitions, fdisk for creating partitions, mkfs to format my device connected by USB.
You can also use mmc part in uboot, but I never tested this option.
I am using a cross compiled binary for android.
I used a command
ntfs-3g /dev/block/mmcblk1 /storage/sdcard0/mysdcard
However when i exit the superuser and become a normal user. I am not able to view the device mounted on sdcard 3. I am only able to browse the filesystem as a root user. How do i mount the drive for all users publicly?
my experience with ntfs-3g in linux is with Suse,
and I recently downloaded the source for ntfs-3g_ntfsprogs-2017.3.23.
Going from memory I built it from source I think by simply
./configure --prefix=/opt/ntfs-3g_ntfsprogs-2017.3.23
make
make install
in any case if that is not correct there is either a README or INSTALL file explaining what to do.
After that I added /opt/ntfs-3g_ntfsprogs-2017.3.23 to /etc/ld.so.conf and also to LD_LIBRARY_PATH and uninstalled the system installed version of ntfs-3g so I know I was using the new version.
I could then successfully mount by hitachi 3tb hard disk I had formatted as ntfs from Windows 10 Home edition.
In linux in /etc/fstab my default mount line for mounting by device_id was this
/dev/disk/by-id/ata-Hitachi_HDS723030ALA640_MK0311YHGWTYNA-part2 /data ntfs-3g users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
this resulted in my disk mounting under a /data folder but because of fmask and dmask only root could get into the /data folder.
set fmask=111 and dmask=000 to make all files -rw-rw-rw and all directories drwxrwxrwx.
again, this was with the latest ntfs-3g_ntfsprogs-2017.3.23 that was available as of 2018-02-24. I do not know if dmask and fmask are new features in ntfs-3g, i don't remember noticing them in earlier versions where it just worked. I mention all this because in SLES 11.4 the native version of ntfs-3g from the SDK works and it mounts my win10 ntfs data drive no problem, but in SLES 12.3 whatever that native ntfs-3g from the SDK was did not work, gave error -1003 or -3003, thus the manual update to latest ntfs-3g and noticing the extra security preventing default read/write access to the mounted drive... requiring the modification of fmask and dmask
In Android OS, how can I restrict the "adb pull" command so that users of my customized Android kitkat version cannot pull anything like files, apks, etc? Please note that the requirement is that a user cannot even pull files on a rooted device. I am open to an SeAndroid policy solution provided it is not just for /sdcard but for /data and /system folders also.
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