Common problems with the android ADB debug command
Source: Internet
Author: User
<span id="Label3"></p><p><p>First I use the Ubuntu system, the development of the eclipse under the use of wireless debugging, the terminal directly input adb connect 114.114.114.114 no problem, to the mobile phone installation software with adb install ***.apk also no problem, This may be the reason I installed the adb-tools on the terminal before, but for other commands such as the push pull command, the Error:device not found always Appears. Later queried the information, said that the SDK directory should be used in the Platform-tools folder within the adb, the relevant use of the command as Follows:</p></p><p><p></p></p><p><p>Commands like push and pull do not need to be done in the shell environment, such as I copy the/system/build.prop file to the Pc:</p></p><p><p></p></p><p><p>This will successfully copy the Build.prop file into my download folder, and when you use the push command to copy the files on your PC to your Android device, you may need to:</p></p><p><p><strong>1. Hint read-only file system</strong></p></p><p><p>When using the ADB shell, it is often prompted to "read-only file system" when writing files to The/system directory and its subdirectories. The reason for this hint is simple:/system is mounted in ro mode, so all we have to do is re-mount the directory that needs to be modified (in this case,/system) in Read-write mode (rw), as Follows:</p></p><p><p>1). Enter the ADB shell and see what is currently hanging in the case</p></p><pre><pre><span style="color: #000000;">Command number under input: adb shell#mount</span></pre></pre><p><p>At this point you can see the current Mount Situation:</p></p><pre>Rootfs on/<span style="color: #000000;"><span style="color: #000000;">type Rootfs (rw,relatime) tmpfs</span> on</span>/dev type Tmpfs (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;">755</span></span><span style="color: #000000;"><span style="color: #000000;">) devpts</span> on</span>/dev/pts type devpts (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;"></span> -</span><span style="color: #000000;"><span style="color: #000000;">) proc</span> on</span>/<span style="color: #000000;"><span style="color: #000000;">proc type proc (rw,relatime) Sysfs</span> on</span>/<span style="color: #000000;"><span style="color: #000000;">sys type SYSFS (rw,relatime) none</span> on</span>/<span style="color: #000000;"><span style="color: #000000;">Acct Type Cgroup (rw,relatime,cpuacct) TMPFS</span> on</span>/mnt/asec type Tmpfs (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;">755</span></span>, gid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span><span style="color: #000000;"><span style="color: #000000;">) Tmpfs</span> on</span>/mnt/obb type Tmpfs (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;">755</span></span>, gid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span><span style="color: #000000;"><span style="color: #000000;">) None</span> on</span>/dev/<span style="color: #000000;"><span style="color: #000000;">cpuctl type Cgroup (rw,relatime,cpu)</span></span><span style="text-decoration: underline;"><span style="text-decoration: underline;">/dev/block/mmcblk0p25 on/system type EXT4 (<span style="background-color: #ffff00;">ro</span>, relatime,barrier=<span style="color: #800080; text-decoration: underline;">1</span>, data=<span style="color: #000000; text-decoration: underline;">ordered)</span> </span></span>/dev/block/mmcblk0p26 on/data Type Ext4 (rw,nosuid,nodev,noatime,barrier=<span style="color: #800080;"><span style="color: #800080;">1</span></span>, Data=<span style="color: #000000;"><span style="color: #000000;">Ordered,noauto_da_alloc)</span></span>/dev/block/mmcblk0p27 On/cache Type Ext4 (rw,nosuid,nodev,noatime,barrier=<span style="color: #800080;"><span style="color: #800080;">1</span></span>, Data=<span style="color: #000000;"><span style="color: #000000;">Ordered)</span></span>/DEV/BLOCK/MMCBLK0P28 on/devlog Type Ext4 (rw,nosuid,nodev,noatime,barrier=<span style="color: #800080;"><span style="color: #800080;">1</span></span>, Data=<span style="color: #000000;"><span style="color: #000000;">Ordered)</span></span>/DATA/D on/data/<span style="color: #000000;"><span style="color: #000000;">d type Debugfs (rw,relatime)</span></span>/sys/kernel/debug on/sys/kernel/<span style="color: #000000;"><span style="color: #000000;">Debug Type Debugfs (rw,relatime)</span></span>/dev/block/vold/<span style="color: #800080;"><span style="color: #800080;">179</span></span>:<span style="color: #800080;"><span style="color: #800080;"></span> $</span>On/mnt/sdcard type VFAT (rw,dirsync,nosuid,nodev,noexec,relatime,uid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span>, gid=<span style="color: #800080;"><span style="color: #800080;">1015</span></span>, fmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, dmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, allow_utime=<span style="color: #800080;"><span style="color: #800080;">0020</span></span>, codepage=cp437,iocharset=iso8859-<span style="color: #800080;"><span style="color: #800080;">1</span></span>, shortname=mixed,utf8,errors=remount-<span style="color: #000000;"><span style="color: #000000;">Ro)</span></span>/dev/block/vold/<span style="color: #800080;"><span style="color: #800080;">179</span></span>:<span style="color: #800080;"><span style="color: #800080;"></span> $</span>On/mnt/secure/asec type VFAT (rw,dirsync,nosuid,nodev,noexec,relatime,uid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span>, gid=<span style="color: #800080;"><span style="color: #800080;">1015</span></span>, fmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, dmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, allow_utime=<span style="color: #800080;"><span style="color: #800080;">0020</span></span>, codepage=cp437,iocharset=iso8859-<span style="color: #800080;"><span style="color: #800080;">1</span></span>, shortname=mixed,utf8,errors=remount-<span style="color: #000000;"><span style="color: #000000;">Ro) Tmpfs</span> on</span>/mnt/sdcard/.android_secure type Tmpfs (ro,relatime,size=0k,mode=<span style="color: #800080;"><span style="color: #800080;"></span> the</span>)</pre><p><p>What we're interested in is the underlined part of the code, and you can see that the system is mounted as read-only</p></p><p><p>2) re-mount The directory where you want to modify Permissions:</p></p><pre><pre>#mount-o Remount-o Rw/system</pre></pre><p><p>After the modification is finished, it will be changed to read-only permission, just change the above RW to Ro.</p></p><p><p>3) View the modified results</p></p><pre><span style="color: #000000;"><span style="color: #000000;"># Mountrootfs</span> on</span>/<span style="color: #000000;"><span style="color: #000000;">type Rootfs (rw,relatime) tmpfs</span> on</span>/dev type Tmpfs (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;">755</span></span><span style="color: #000000;"><span style="color: #000000;">) devpts</span> on</span>/dev/pts type devpts (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;"></span> -</span><span style="color: #000000;"><span style="color: #000000;">) proc</span> on</span>/<span style="color: #000000;"><span style="color: #000000;">proc type proc (rw,relatime) Sysfs</span> on</span>/<span style="color: #000000;"><span style="color: #000000;">sys type SYSFS (rw,relatime) none</span> on</span>/<span style="color: #000000;"><span style="color: #000000;">Acct Type Cgroup (rw,relatime,cpuacct) TMPFS</span> on</span>/mnt/asec type Tmpfs (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;">755</span></span>, gid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span><span style="color: #000000;"><span style="color: #000000;">) Tmpfs</span> on</span>/mnt/obb type Tmpfs (rw,relatime,mode=<span style="color: #800080;"><span style="color: #800080;">755</span></span>, gid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span><span style="color: #000000;"><span style="color: #000000;">) None</span> on</span>/dev/<span style="color: #000000;"><span style="color: #000000;">cpuctl type Cgroup (rw,relatime,cpu)</span></span><span style="text-decoration: underline;"><span style="text-decoration: underline;">/dev/block/mmcblk0p25 on/system type EXT4 (<span style="background-color: #ffff00;">rw</span>, relatime,barrier=<span style="color: #800080; text-decoration: underline;">1</span>, data=<span style="color: #000000; text-decoration: underline;">ordered)</span> </span></span>/dev/block/mmcblk0p26 on/data Type Ext4 (rw,nosuid,nodev,noatime,barrier=<span style="color: #800080;"><span style="color: #800080;">1</span></span>, Data=<span style="color: #000000;"><span style="color: #000000;">Ordered,noauto_da_alloc)</span></span>/dev/block/mmcblk0p27 On/cache Type Ext4 (rw,nosuid,nodev,noatime,barrier=<span style="color: #800080;"><span style="color: #800080;">1</span></span>, Data=<span style="color: #000000;"><span style="color: #000000;">Ordered)</span></span>/DEV/BLOCK/MMCBLK0P28 on/devlog Type Ext4 (rw,nosuid,nodev,noatime,barrier=<span style="color: #800080;"><span style="color: #800080;">1</span></span>, Data=<span style="color: #000000;"><span style="color: #000000;">Ordered)</span></span>/DATA/D on/data/<span style="color: #000000;"><span style="color: #000000;">d type Debugfs (rw,relatime)</span></span>/sys/kernel/debug on/sys/kernel/<span style="color: #000000;"><span style="color: #000000;">Debug Type Debugfs (rw,relatime)</span></span>/dev/block/vold/<span style="color: #800080;"><span style="color: #800080;">179</span></span>:<span style="color: #800080;"><span style="color: #800080;"></span> $</span>On/mnt/sdcard type VFAT (rw,dirsync,nosuid,nodev,noexec,relatime,uid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span>, gid=<span style="color: #800080;"><span style="color: #800080;">1015</span></span>, fmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, dmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, allow_utime=<span style="color: #800080;"><span style="color: #800080;">0020</span></span>, codepage=cp437,iocharset=iso8859-<span style="color: #800080;"><span style="color: #800080;">1</span></span>, shortname=mixed,utf8,errors=remount-<span style="color: #000000;"><span style="color: #000000;">Ro)</span></span>/dev/block/vold/<span style="color: #800080;"><span style="color: #800080;">179</span></span>:<span style="color: #800080;"><span style="color: #800080;"></span> $</span>On/mnt/secure/asec type VFAT (rw,dirsync,nosuid,nodev,noexec,relatime,uid=<span style="color: #800080;"><span style="color: #800080;"></span> +</span>, gid=<span style="color: #800080;"><span style="color: #800080;">1015</span></span>, fmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, dmask=<span style="color: #800080;"><span style="color: #800080;">0602</span></span>, allow_utime=<span style="color: #800080;"><span style="color: #800080;">0020</span></span>, codepage=cp437,iocharset=iso8859-<span style="color: #800080;"><span style="color: #800080;">1</span></span>, shortname=mixed,utf8,errors=remount-<span style="color: #000000;"><span style="color: #000000;">Ro) Tmpfs</span> on</span>/mnt/sdcard/.android_secure type Tmpfs (ro,relatime,size=0k,mode=<span style="color: #800080;"><span style="color: #800080;"></span> the</span><span style="color: #000000;"><span style="color: #000000;">)#</span></span></pre><p><p>This allows you to use the push and pull commands to your Fullest.</p></p><p><p>But in practice I still hint failed to copy *****,operation Denied. Specific reasons I do not clear, but I did a compromise solution, first push the file to the SD card, and then into the shell environment to use root permissions to move to the directory you need, the operation commands and Linux under the same command command.</p></p><p><p><strong>2. Use chmod to modify permissions to prompt bad mode, The workaround is to use the digital form of permissions:</strong></p></p><pre><pre><span style="color: #800080;">755</span> Build.prop</pre></pre><p><p><strong>3. Prompt "-cross-device link" when executing MV command</strong></p></p><p><p>In this case, you can use cat to redirect the file to the specified location, and then modify the permissions as Needed.</p></p><pre><pre>cat/mnt/sdcard/test.apk >/system/app/test.apk</pre></pre><p><p></p></p><p><p>Common problems with the android ADB debug command</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service