简体   繁体   English

Android ADB Shell命令:挂载主机PC文件夹?

[英]Android ADB shell commands: Mount host PC folder?

Hope this isn't too much of an amateur/moron question: I'm trying to replace most ringtones and alarms (Dell Streak 5 (2.2.2 rooted)) with a few of my own pet sounds. 希望这不是一个业余/白痴问题:我试图用我自己的一些宠物声音代替大多数铃声和警报(Dell Streak 5(2.2.2扎根))。 For reasons I won't bother you with, I can't use an SD card, so my .ogg replacements need be transferred straight from my PC to their respective default folders under /system/media/audio/ . 由于某些原因,我不会打扰您,因此无法使用SD卡,因此,我需要将.ogg替换项直接从PC转移到/ system / media / audio /下各自的默认文件夹中。

ADB push and pull commands don't seem to accept widlcards (which is a pain) but anyway, despite setting the system folder to rw, I get 'permission denied' when I tediously attempt to pull or push files one by one. ADB的推和拉命令似乎不接受widlcard(这很痛苦),但是无论如何,尽管将系统文件夹设置为rw,但当我进行繁琐的尝试逐个拉或推文件时,我仍会“权限被拒绝”。

But I should be able to rm and cp interactively from ADB's shell # prompt, with simple Unix commands to transfer groups of files between the /system/media/audio folders and my Windows PC. 但是我应该能够使用简单的Unix命令从ADB的shell#提示符以交互方式进行rm和cp,以在/ system / media / audio文件夹和Windows PC之间传输文件组。 But to do this I presumably need to mount my PC source folder, and I have no idea how to do this. 但是要做到这一点,我大概需要挂载我的PC源文件夹,而我不知道该怎么做。

I'd be grateful for any info or ideas... 如果有任何信息或想法,我将不胜感激。

You need to have root access on the phone. 您需要在手机上具有root用户访问权限。 My advice as a programmer would be to 作为程序员,我的建议是

1) Write a program to do this... 1)编写一个程序来执行此操作...

or just do it the easy way haha. 或者只是做简单的方法哈哈。 Try this (your device must be rooted): 尝试以下操作(您的设备必须已植根):

  1. adb shell into your device using $> adb shell 使用$> adb shell adb shell插入设备
  2. move to the local folder using $> cd /data/local 使用$> cd /data/local移到本地文件夹
  3. Now create a directory for your tones with $> mkdir my_tones - this shouldn't require su 现在使用$> mkdir my_tones为您的音调创建目录-这不需要su
  4. Next you must push your .ogg files from your computer to the /data/local/my_tones folder 接下来,您必须将.ogg文件从计算机推送到/ data / local / my_tones文件夹
  5. Now you can become su user with $> su 现在,您可以通过$> su成为su用户。
  6. Now you should be able to copy the files from the /data/local/my_tones directory to where ever it is you would like them. 现在,您应该能够将文件从/ data / local / my_tones目录复制到所需的位置。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM