Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adb shell command: mkdir (for creating a directory)

Tags:

android

mkdir

adb

I am trying to create a directory through adb shell

I have to create a directory in etc folder which was unsuccessful. I managed to figure out that it is linked to /system/etc and tried to create in /system/etc, but in both cases I was getting "Read only File System".

How to make it Read write?

I tried switching to super user using "su".

I tried modifying udev/rules.d in the host machine:

created a file 51-android.rules with " SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"  "

I'm still getting the same "Read only File system".

How do I fix this?

like image 920
Chanakya.sun Avatar asked Nov 14 '12 05:11

Chanakya.sun


People also ask

How do I create a folder in adb shell?

adb shell command: mkdir (for creating a directory)

How do you create a directory?

Creating a new directory (or folder) is done using the "mkdir" command (which stands for make directory.) I'll create a new directory named "OtherStuff". When I type "ls", we'll see the new folder in our list. That's really all there is to it!

How do you create a new directory in Linux?

With the help of mkdir command, you can create a new directory wherever you want in your system. Just type "mkdir <dir name> , in place of <dir name> type the name of new directory, you want to create and then press enter. Example: mkdir created.


1 Answers

[Trick] Make a dir (or various) in a non-rooted phone using adb push:

if you use the command

adb push myfolder /storage/sdcard0/Download

and "myfolder" contains another folders inside, these folders will be created inside the "Download" folder of the phone

So, the hack i use to install assets inside my apps:

adb push assetfolder /storage/sdcard0/Android/data/com.myapp.name/

then "assetfolder" contains

assetfolder/
   assetfolder/db/mysqlite.db
   assetfolder/img/myimage.png
   assetfolder/json/initial-data.json

etc

Then my app has its

com.myapp.name/db/mysqlite.db
com.myapp.name/img/myimage.png
com.myapp.name/json/initial-data.json

Hope it helps!

like image 70
voghDev Avatar answered Sep 21 '22 14:09

voghDev