-
-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,491 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,10 @@ | |
<!-- Book generated using mdBook --> | ||
<meta charset="UTF-8"> | ||
<title>Get used to ADB Shell - Android Tips & Tricks</title> | ||
|
||
|
||
<!-- Custom HTML head --> | ||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> | ||
|
||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta name="theme-color" content="#ffffff" /> | ||
|
@@ -16,25 +18,29 @@ | |
<link rel="stylesheet" href="css/general.css"> | ||
<link rel="stylesheet" href="css/chrome.css"> | ||
<link rel="stylesheet" href="css/print.css" media="print"> | ||
|
||
<!-- Fonts --> | ||
<link rel="stylesheet" href="FontAwesome/css/font-awesome.css"> | ||
<link rel="stylesheet" href="fonts/fonts.css"> | ||
|
||
<!-- Highlight.js Stylesheets --> | ||
<link rel="stylesheet" href="highlight.css"> | ||
<link rel="stylesheet" href="tomorrow-night.css"> | ||
<link rel="stylesheet" href="ayu-highlight.css"> | ||
|
||
<!-- Custom theme stylesheets --> | ||
|
||
</head> | ||
<body> | ||
<div id="body-container"> | ||
<!-- Provide site root to javascript --> | ||
<script type="text/javascript"> | ||
<script> | ||
var path_to_root = ""; | ||
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light"; | ||
</script> | ||
|
||
<!-- Work around some values being stored in localStorage wrapped in quotes --> | ||
<script type="text/javascript"> | ||
<script> | ||
try { | ||
var theme = localStorage.getItem('mdbook-theme'); | ||
var sidebar = localStorage.getItem('mdbook-sidebar'); | ||
|
@@ -50,7 +56,7 @@ | |
</script> | ||
|
||
<!-- Set the theme before any content is loaded, prevents flash --> | ||
<script type="text/javascript"> | ||
<script> | ||
var theme; | ||
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { } | ||
if (theme === null || theme === undefined) { theme = default_theme; } | ||
|
@@ -62,12 +68,14 @@ | |
</script> | ||
|
||
<!-- Hide / unhide sidebar before it is displayed --> | ||
<script type="text/javascript"> | ||
<script> | ||
var html = document.querySelector('html'); | ||
var sidebar = 'hidden'; | ||
var sidebar = null; | ||
if (document.body.clientWidth >= 1080) { | ||
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { } | ||
sidebar = sidebar || 'visible'; | ||
} else { | ||
sidebar = 'hidden'; | ||
} | ||
html.classList.remove('sidebar-visible'); | ||
html.classList.add("sidebar-" + sidebar); | ||
|
@@ -80,11 +88,33 @@ | |
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> | ||
</nav> | ||
|
||
<!-- Track and set sidebar scroll position --> | ||
<script> | ||
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); | ||
sidebarScrollbox.addEventListener('click', function(e) { | ||
if (e.target.tagName === 'A') { | ||
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); | ||
} | ||
}, { passive: true }); | ||
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); | ||
sessionStorage.removeItem('sidebar-scroll'); | ||
if (sidebarScrollTop) { | ||
// preserve sidebar scroll position when navigating via links within sidebar | ||
sidebarScrollbox.scrollTop = sidebarScrollTop; | ||
} else { | ||
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons | ||
var activeSection = document.querySelector('#sidebar .active'); | ||
if (activeSection) { | ||
activeSection.scrollIntoView({ block: 'center' }); | ||
} | ||
} | ||
</script> | ||
|
||
<div id="page-wrapper" class="page-wrapper"> | ||
|
||
<div class="page"> | ||
<div id="menu-bar-hover-placeholder"></div> | ||
<div id="menu-bar" class="menu-bar sticky bordered"> | ||
<div id="menu-bar-hover-placeholder"></div> | ||
<div id="menu-bar" class="menu-bar sticky"> | ||
<div class="left-buttons"> | ||
<button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> | ||
<i class="fa fa-bars"></i> | ||
|
@@ -93,7 +123,7 @@ | |
<i class="fa fa-paint-brush"></i> | ||
</button> | ||
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu"> | ||
<li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li> | ||
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> | ||
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li> | ||
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li> | ||
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li> | ||
|
@@ -110,6 +140,7 @@ <h1 class="menu-title">Android Tips & Tricks</h1> | |
<a href="print.html" title="Print this book" aria-label="Print this book"> | ||
<i id="print-button" class="fa fa-print"></i> | ||
</a> | ||
|
||
</div> | ||
</div> | ||
|
||
|
@@ -123,8 +154,9 @@ <h1 class="menu-title">Android Tips & Tricks</h1> | |
</ul> | ||
</div> | ||
</div> | ||
|
||
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM --> | ||
<script type="text/javascript"> | ||
<script> | ||
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible'); | ||
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible'); | ||
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) { | ||
|
@@ -136,7 +168,7 @@ <h1 class="menu-title">Android Tips & Tricks</h1> | |
<main> | ||
<h1 id="adb-shell"><a class="header" href="#adb-shell">ADB Shell</a></h1> | ||
<p>Few handy commands you can use to interact with emulator/device, through terminal.</p> | ||
<table><thead><tr><th>Description</th><th>Command</th></tr></thead><tbody> | ||
<div class="table-wrapper"><table><thead><tr><th>Description</th><th>Command</th></tr></thead><tbody> | ||
<tr><td>List all connected devices</td><td><code>adb devices</code></td></tr> | ||
<tr><td>Install an application on device<br>-s to install on the SD Card<br>-g to grant all permissions listed in the manifest <a href="https://developer.android.com/studio/command-line/adb.html">[More Info]</a></td><td><code>adb install -r ~/application.apk</code></td></tr> | ||
<tr><td>Uninstall an application</td><td><code>adb uninstall your.app.package</code></td></tr> | ||
|
@@ -154,7 +186,11 @@ <h1 id="adb-shell"><a class="header" href="#adb-shell">ADB Shell</a></h1> | |
<tr><td>Take a Screenshot</td><td><code>adb shell screencap -p \| perl -pe 's/\x0D\x0A/\x0A/g' > screenshot.png</code></td></tr> | ||
<tr><td>Launch an installed app using its package name</td><td><code>adb shell monkey -p com.yourapp.packagename 1</code></td></tr> | ||
<tr><td><a href="https://developer.android.com/studio/test/monkey">Stress test</a> your app using its package name by sending a pseudo-random stream of user events into the system</td><td><code>adb shell monkey -p com.yourapp.packagename -v 500</code></td></tr> | ||
<tr><td>Send input text to a connected device instead of typing manually.</td><td><code>adb shell input text "[email protected]"</code></td></tr> | ||
<tr><td>Check device logs</td><td><code>adb logcat</code></td></tr> | ||
<tr><td>To save Android device logs locally on your computer using ADB</td><td><code>adb logcat > device_logs.txt</code></td></tr> | ||
</tbody></table> | ||
</div> | ||
<ul> | ||
<li><strong><a href="https://crushingcode.nisrulz.com/posts/do-you-like-to-adb/">Learn about various techniques involved when using ADB</a></strong></li> | ||
</ul> | ||
|
@@ -166,9 +202,11 @@ <h1 id="adb-shell"><a class="header" href="#adb-shell">ADB Shell</a></h1> | |
<a rel="prev" href="configure-as.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> | ||
<i class="fa fa-angle-left"></i> | ||
</a> | ||
|
||
<a rel="next" href="android-aliases.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<i class="fa fa-angle-right"></i> | ||
</a> | ||
|
||
<div style="clear: both"></div> | ||
</nav> | ||
</div> | ||
|
@@ -178,23 +216,33 @@ <h1 id="adb-shell"><a class="header" href="#adb-shell">ADB Shell</a></h1> | |
<a rel="prev" href="configure-as.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> | ||
<i class="fa fa-angle-left"></i> | ||
</a> | ||
|
||
<a rel="next" href="android-aliases.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> | ||
<i class="fa fa-angle-right"></i> | ||
</a> | ||
</nav> | ||
|
||
</div> | ||
|
||
<script type="text/javascript"> | ||
|
||
|
||
|
||
<script> | ||
window.playground_copyable = true; | ||
</script> | ||
<script src="elasticlunr.min.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="mark.min.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="searcher.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="clipboard.min.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="highlight.js" type="text/javascript" charset="utf-8"></script> | ||
<script src="book.js" type="text/javascript" charset="utf-8"></script> | ||
|
||
|
||
<script src="elasticlunr.min.js"></script> | ||
<script src="mark.min.js"></script> | ||
<script src="searcher.js"></script> | ||
|
||
<script src="clipboard.min.js"></script> | ||
<script src="highlight.js"></script> | ||
<script src="book.js"></script> | ||
|
||
<!-- Custom JS scripts --> | ||
|
||
|
||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.