{"id":517,"date":"2017-02-24T22:07:26","date_gmt":"2017-02-24T22:07:26","guid":{"rendered":"http:\/\/notnull.ro\/log\/?p=517"},"modified":"2017-02-24T22:07:26","modified_gmt":"2017-02-24T22:07:26","slug":"transfer-files-from-android-device-with-adb-command","status":"publish","type":"post","link":"https:\/\/notnull.ro\/log\/transfer-files-from-android-device-with-adb-command\/","title":{"rendered":"Transfer Files from Android Device with &#8220;adb&#8221; Command"},"content":{"rendered":"<p><a href=\"https:\/\/notnull.ro\/log\/wp-content\/uploads\/2017\/02\/IMG_20170224_223413308.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-518 alignleft\" src=\"https:\/\/notnull.ro\/log\/wp-content\/uploads\/2017\/02\/IMG_20170224_223413308-169x300.jpg\" alt=\"Allview broken touchscreen\" width=\"169\" height=\"300\" srcset=\"https:\/\/notnull.ro\/log\/wp-content\/uploads\/2017\/02\/IMG_20170224_223413308-169x300.jpg 169w, https:\/\/notnull.ro\/log\/wp-content\/uploads\/2017\/02\/IMG_20170224_223413308-768x1365.jpg 768w, https:\/\/notnull.ro\/log\/wp-content\/uploads\/2017\/02\/IMG_20170224_223413308-576x1024.jpg 576w, https:\/\/notnull.ro\/log\/wp-content\/uploads\/2017\/02\/IMG_20170224_223413308.jpg 1836w\" sizes=\"auto, (max-width: 169px) 100vw, 169px\" \/><\/a>Few days one friend just broke his phone touch screen, and the half bottom of the screen \u00a0didn&#8217;t respond anymore. So, no chance to interact anymore with it.<\/p>\n<p>He wanted to transfer all the files from the phone to the PC, but when the USB data cable is inserted the phone is asking what to do with USB connection:<\/p>\n<ul>\n<li>Charge only<\/li>\n<li>View photos<\/li>\n<li>File copy<\/li>\n<\/ul>\n<p>He wanted the last option &#8220;Files copy&#8221; to access the internal storage, but the phone does not respond and starts with default option &#8220;Charge Only&#8221;. Looks like there is no chance to copy any file.<\/p>\n<p>Fortunately on my PC I have Android Studio installed, and it comes with the &#8220;adb&#8221; tool (Android Debug Bridge). \u00a0It lets you to communicate with the Android devices connected on the PC. Here is what I&#8217;ve done to copy the content of entire internal storage to PC.<\/p>\n<p>With\u00a0<strong>bold<\/strong> are the command that I&#8217;ve run , and in <span style=\"color: #0000ff;\"><strong>blue bold<\/strong><\/span>\u00a0are the comments\/hints.<br \/>\n<code><span style=\"color: #0000ff;\"><strong>First step is to identify the path of the phone storage,<\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong>it is different from vendor to vendor and one Android version to other.<\/strong><\/span><br \/>\nC:\\Users\\mark&gt;<strong>adb shell ls -l \/<\/strong><br \/>\n-rw-r--r-- root root 663 1970-01-01 02:00 seapp_contexts<br \/>\n-rw-r--r-- root root 231669 1970-01-01 02:00 sepolicy<br \/>\ndrwxrwx--- radio system 1970-01-01 02:00 spdata<br \/>\ndrwxr-x--x root sdcard_r 2017-02-24 18:36 storage<br \/>\ndr-xr-xr-x root root 2017-02-24 18:36 sys<br \/>\ndrwxr-xr-x root root 1970-01-01 02:00 system<br \/>\n-rw-r--r-- root root 6729 1970-01-01 02:00 ueventd.rc<br \/>\nlrwxrwxrwx root root 2017-02-24 18:36 vendor -&gt; \/system\/vendor<\/p>\n<p>C:\\Users\\mark&gt;<strong>adb shell ls -l \/storage<\/strong><br \/>\ndrwxrwx--x root sdcard_r 1970-01-01 02:00 sdcard0<br \/>\ndrwx------ root root 2017-02-24 18:36 sdcard1<\/p>\n<p>C:\\Users\\mark&gt;<strong>adb shell df \/storage\/*<\/strong><br \/>\nFilesystem Size Used Free Blksize<br \/>\n\/storage\/sdcard0 7.2G 4.5G 2.7G 4096<br \/>\n\/storage\/sdcard1 0.0K 0.0K 0.0K 4096<br \/>\n<span style=\"color: #0000ff;\"><strong>Based on whet we see above, looks like the storage path is \/storage\/sdcard0 .<br \/>\n<\/strong><strong>Let's copy it using \"adb pull\" command.<br \/>\n<\/strong><strong>First the command will build the list of files to be transferred, <\/strong><\/span><br \/>\n<span style=\"color: #0000ff;\"><strong>then will start transfer and will notify us about the progress status.<\/strong><\/span><\/p>\n<p>C:\\Users\\mark&gt;<strong>adb pull \/storage\/sdcard0 D:\\tmp\\bkp_from_allview_internal<\/strong><br \/>\n[ 24%] \/storage\/sdcard0\/DCIM\/Camera\/IMG_20141227_141226.jpg: 16%<br \/>\n...<br \/>\n...<br \/>\n\/storage\/sdcard0\/: 1218 files pulled. 0 files skipped. 3.2 MB\/s (4717973504 bytes in 1406.642s)<br \/>\n<\/code><br \/>\nThat&#8217;s all folk!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few days one friend just broke his phone touch screen, and the half bottom of the screen \u00a0didn&#8217;t respond anymore. So, no chance to interact anymore with it. He wanted to transfer all the files from the phone to the PC, but when the USB data cable is inserted the phone is asking what to <a href='https:\/\/notnull.ro\/log\/transfer-files-from-android-device-with-adb-command\/' class='excerpt-more'>&#8230; Read Full Article<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,83,5],"tags":[],"class_list":["post-517","post","type-post","status-publish","format-standard","hentry","category-android","category-diy","category-programming","category-19-id","category-83-id","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/comments?post=517"}],"version-history":[{"count":3,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/517\/revisions"}],"predecessor-version":[{"id":521,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/posts\/517\/revisions\/521"}],"wp:attachment":[{"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/media?parent=517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/categories?post=517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/notnull.ro\/log\/wp-json\/wp\/v2\/tags?post=517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}