0

I am using pushFile() to copy a file in to the folder "/sdcard", which gets copied to "/internal storage/" folder inside the device, but with a different name and extension like "Appium.tmp". For our threat detection app to work it has to be having a name like "<my_malicious_app.apk>" file.

How do I rename the file after being copied from "Appium.tmp"
to "<my_malicious_app.apk>" ??

PraNuta
  • 629
  • 3
  • 12
  • 33
  • Is your Apium version above 1.15.0? Also Are you using the approach mentioned here to push your apk file? Are you saying that, apk file is getting renamed to tmp file? – HemChe Sep 07 '22 at 15:58
  • If your answer is YES to all the questions above, i would ask you to try zipping the file and then push to the device using appium command and then use `adb shell unzip /sdcard/your_zip_file_name.zip` to unzip the file on device. – HemChe Sep 07 '22 at 16:01
  • @HemChe Yes, I am using 1.22.1 Appium. Yes, I am using pushFile() approach from the documentation. Sure, I will try doing the process advised by you, and post the result. It may take few days though, as I was doing some thing else right now. Thanks though. Having one doubt, when I am running Appium Java code in a project, how do I run the "adb shell" command ? How does adb class is available ? – PraNuta Sep 07 '22 at 18:37
  • 1
    It's possible. Please follow this guide. https://appiumpro.com/editions/3-running-arbitrary-adb-commands-via-appium – HemChe Sep 09 '22 at 09:31

0 Answers0