How to create sub folder in sdcard

Hi all,

Anyone can share with me how to create sub folder in sdcard.

My scenarios is : i have to upload a file on mobile app. My flow will be :

  • create a folder “Temp” in sdcard.
  • copy the file upload to the “Temp” folder.
  • upload the file in the “Temp” folder.

I try to add dependency for android in pom.xml

And in my code, i try:

public void TestSCript(){
File sdcard = Environment.getDataDirectory();
//File f=new File(sdcard+"/dor");

But it get except : java.lang.RuntimeException: Stub!

can u try with adb commands? I do not think appium is require to do this.

Oh, we can use adb command in Java code? i didnot know before.
let me try and update. Thanks Priyank_Shah

Hi Priyank_Shah,
it works with your suggestion.
adb command with “Push” option.
Thanks so much Priyank_Shah