want to create folder in sdcard on AVD

前端 未结 4 1130
刺人心
刺人心 2021-01-05 01:23

I want to create folder in sdcard. i am using following command in android terminal

cd sdcard mkdir music

mkdir failed for music, Permission denied.

相关标签:
4条回答
  • 2021-01-05 02:05

    Try below code.It working fine.

    you need to run emulator before run the below commands.
    use the adb shell command from the android tools folder.
    eg (this was on windows):
    cd android-sdk-windows\tools
    adb shell
    cd /sdcard/
    mkdir myfolder
    

    enter image description here enter image description here

    0 讨论(0)
  • 2021-01-05 02:07

    Try below links for creating folder in sdcard

    Create folder terminal window below link :

    http://android-er.blogspot.in/2010/10/how-to-create-sub-folder-in-sd-card-of.html

    Create folder in programmatically :

    http://android-er.blogspot.in/2010/10/how-to-create-sub-folder-in-sd-card.html

    Thanks..!

    0 讨论(0)
  • 2021-01-05 02:11

    While creating a directory, it is better to provide complete path instead of using cd

    Use Environment.getExternalStorageDirectory() to get the storage root directory.

    Use the following command to create directory:

    String filepath=Environment.getExternalStorageDirectory()+"/Music"
    File fc=new File(filepath)
    if(!fc.exists())       
            fc.mkdir();
    
    0 讨论(0)
  • 2021-01-05 02:24

    Make sure you have added SDCard support to your AVD.

    Go to eclipse - windows - avd manager - select avd and edit - hardware - new - SDCard Support

    And then Try the Command.

    0 讨论(0)
提交回复
热议问题