How to copy file using adb to android directory accessible from PC
<p>If you attach android device to PC you can browse files and dirs. It is possible to get this directory using <code>Environment.getExternalStorage()</code>. You can use it from your application and create accessible files and dirs. It works fine. </p>

<p>On my devices this path looks like <code>/storage/emulated/0</code> and if i try <code>adb push</code> to this directory i will get access denied error. Is it possible to copy files using <code>adb</code> to the same folder as Windows Explorer does?</p>

<pre><code>D:\...\tools&gt;adb push ACCOUNTS.DB /storage/emulated/0
failed to copy 'ACCOUNTS.DB' to '/storage/emulated/0': Permission denied
58969 KB/s (606505 bytes in 0.010s)
</code></pre>

<p>I'm implementing automated import/export and i want files to be accessible without <code>adb shell</code> in case anything will go wrong.</p>

<p>Currently using variable<code>$EXTERNAL_STORAGE</code> as workaround, it works for both <code>adb</code> and application.</p>

<p>Device: Asus Fonepad 7, Android 5.0, tried Genymotion Custom Tablet 6.0 - works.</p>