0

My emulator can't do adb root. Anyway, I can do adb shell and then do su and get root to do my things. But how to copy some file from my PC to connected device using adb shell? Where can I access my disk? cp Mypc/somefile /Myandroid/comewhere ?

EDIT: I can't also do adb pull :(

0

Lol, I just set everything to 777 with su:


x86_64:/ $ su
x86_64:/ # chmod 777 /data/mi 
misc/     misc_ce/  misc_de/
x86_64:/ # chmod 777 /data/misc                                                             
x86_64:/ # chmod 777 /data/misc/                                                            
adb/              cameraserver/     media/            shared_relro/     vold/
audioserver/      dhcp/             net/              sms/              vpn/
bluedroid/        ethernet/         perfprofd/        systemkeys/       wifi/
bluetooth/        gatekeeper/       profiles/         trace/            zoneinfo/
bootstat/         keychain/         profman/          update_engine/
boottrace/        keystore/         radio/            user/
x86_64:/ # chmod 777 /data/misc/key                                                         
keychain/  keystore/
x86_64:/ # chmod 777 /data/misc/keystore/                                                   
x86_64:/ # chmod 777 /data/misc/keystore/user_0/                                            
x86_64:/ # chmod 777 /data/misc/keystore/user_0/*                                           
chmod: /data/misc/keystore/user_0/*: No such file or directory
1|x86_64:/ # chmod 777 /data/misc/keystore/user_0/*                                         
chmod: /data/misc/keystore/user_0/*: No such file or directory
1|x86_64:/ # 

And it worked :)))

marat@marat-desktop ~/Desktop> adb push charles-ssl-proxying-certificate.cer /data/misc/keystore/user_0/charles-ssl-proxying-certificate.cer
charles-ssl-proxying-certificate.cer: 1 file pushed. 5.4 MB/s (1348 bytes in 0.000s)
marat@marat-desktop ~/Desktop> 
  • 1
    Fix the permissions afterwards or else you just opened up a vulnerability on your devices data partition. – Zillinium Apr 8 at 9:13
  • @Cookie you are in a sense making fun of Discretionary Access Control, like Windows did with UNIX and now they are fighting with malware. If everything is to be chmodded to 777, why there other permission modes exist! Instead of changing permissions of directories, do adb push to some writeable directory like /data/local/tmp and then use cp or mv from su shell. – Irfan Latif Apr 9 at 21:09
  • Yeah, cp is more elegant way to do this. But i was using anbox and it cant even set pin code for ssl by android'd os requrement :( – Cookie Apr 12 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.