forked from maiz-an/AVD-Setup-without-Andriod-Studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
360 lines (320 loc) · 16.7 KB
/
index.html
File metadata and controls
360 lines (320 loc) · 16.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
content="Guide to setting up an Android Virtual Device (AVD) without Android Studio, using SDK command line tools only.">
<meta name="keywords" content="AVD Setup without Andriod Studio">
<link rel="canonical" href="https://maiz-an.github.io/AVD-Setup-without-Andriod-Studio/">
<meta property="og:title" content="Android SDK & AVD Setup Guide">
<meta property="og:description"
content="Learn how to set up an Android Virtual Device (AVD) without Android Studio using the SDK command line tools.">
<meta property="og:url" content="https://maiz-an.github.io/AVD-Setup-without-Andriod-Studio/">
<meta property="og:image" content="https://maiz-an.github.io/AVD-Setup-without-Andriod-Studio/android.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Android SDK & AVD Setup Guide">
<meta name="twitter:description" content="How to set up an Android Virtual Device (AVD) without Android Studio.">
<meta name="twitter:image" content="https://maiz-an.github.io/AVD-Setup-without-Andriod-Studio/android.png">
<meta name="robots" content="index, follow">
<meta name="google-site-verification" content="wPnhOBsg-56LRbtQO0DarnbxncyDkmF3zmkUvTSt_GY" />
<title>Android SDK & AVD Setup Guide</title>
<link rel="icon" type="image/png" href="fav.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header class="hero">
<h1>Android SDK & AVD Setup Guide</h1>
<span class="s1">A comprehensive step-by-step guide to setting up Android SDK and AVD for seamless development.
<br> Follow each step meticulously, for more detailed check <a
href="https://github.com/maiz-an/Android-Virtual-Device-AVD-Setup-without-Andriod-Studio"
target="_blank" style="font-size: 1rem;">README.MD</a> and refer to the contact details in the footer
for assistance.</span>
</header>
<div class="container">
<h2>1. Download SDK tools package and Set Environment Variables</h2>
<h3>Step 1: Download Command line tools and Unzip the Android SDK</h3>
<ol>
<li>Go to the <a href="https://developer.android.com/studio#downloads" target="_blank">Android SDK Download
Page</a>.</li>
<li>Download the Command Line Tools (CLI) for your operating system.</li>
<li>Extract the ZIP file to a directory (e.g., <code>C:\AndroidSDK</code> or <code>~/Android/sdk</code>).
</li>
<li>Set the path (e.g., <code>C:\AndroidSDK\cmdline-tools\bin</code> or <code>~/Android/sdk/cmdline-tools/bin</code>).
</li>
</ol>
<h3>Step 2: Set the SDK Path as a System Variable</h3>
<h4>For Windows:</h4>
<ol>
<li>Open "Control Panel" > "System" > "Advanced System Settings."</li>
<li>Click "Environment Variables" and add a new variable:</li>
<ul>
<li>Variable Name: <code>ANDROID_HOME</code></li>
<li>Variable Value: Path to the SDK (e.g., <code>C:\AndroidSDK</code>).</li>
<li>Variable Name: <code>ANDROID_SDK_ROOT</code></li>
<li>Variable Value: Path to the SDK (e.g., <code>C:\AndroidSDK</code>).</li>
</ul>
</ol>
<h4>For macOS:</h4>
<ol>
<li>Open the <code>.bash_profile</code> or <code>.zshrc</code> file:</li>
<div class="code-container">
<pre><code>nano ~/.zshrc</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<li>Add these lines:</li>
<div class="code-container">
<pre><code>export ANDROID_HOME=~/Android/sdk</code>
<code>export ANDROID_SDK_ROOT=~/Android/sdk</code>
<code>export PATH=$PATH:$ANDROID_HOME/platform-tools</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<li>Apply changes with:</li>
<div class="code-container">
<pre><code>source ~/.zshrc</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
</ol>
<h2>2. Install Platform-tools, Platforms and Build Tools for Android 34</h2>
<div class="code-container">
<pre><code>sdkmanager "platform-tools"</code>
<code>sdkmanager "platforms;android-34"</code>
<code>sdkmanager "build-tools;34.0.0"</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<li>Add System variable <code>C:\AndroidSDK\platform-tools</code> & <code>C:\AndroidSDK\platforms</code></li>
<h2>3. Install System Images and Create an AVD</h2>
<h3>Install System Images:</h3>
<div class="code-container">
<pre><code>sdkmanager "system-images;android-34;google_apis;x86_64"</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<div class="code-container">
<pre><code>sdkmanager --licenses</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<li>Add System variable to the Emulator (e.g., <code>C:\AndroidSDK\emulator</code>).</li>
<h3>Create a New AVD:</h3>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>Note: You can replace <span style="color: #76FF03;">MyAVD</span> with the name you want to give your
AVD.</li>
</ul>
<div class="code-container">
<pre><code>avdmanager create avd --name "MyAVD" --package "system-images;android-34;google_apis;x86_64"</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<h2>4. List Emulators</h2>
<div class="code-container">
<pre><code>emulator -list-avds</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<h5>List Emulators Output</h5>
<pre>
C:\Users\username>emulator -list-avds
MyAvd</pre>
<h2>5. Run Emulator</h2>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>note: replace <span style="color: #76FF03;">MyAVD</span> with your AVD's name.
</li>
</ul>
<div class="code-container">
<pre><code>emulator -avd MyAVD </code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<h4>Run Emulator by full Strength:</h4>
<div class="code-container">
<pre><code>emulator -avd MyAVD -netdelay none -netspeed full -gpu on -memory 4096 -cores 4 -no-snapshot-load -feature KeyboardSupport</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<p>
<strong>Command Explanation:</strong>
<ul>
<li><code>-avd MyAVD</code>: Specifies the AVD (Android Virtual Device) name.</li>
<li><code>-netdelay none</code>: No network delay.</li>
<li><code>-netspeed full</code>: Sets full network speed.</li>
<li><code>-gpu on</code>: Enables GPU support.</li>
<li><code>-memory 4096</code>: Allocates 4096 MB of RAM to the emulator.</li>
<li><code>-cores 4</code>: Allocates 4 CPU cores.</li>
<li><code>-no-snapshot-load</code>: Disables loading from a snapshot.</li>
<li><code>-feature KeyboardSupport</code>: Enables keyboard input support.</li>
</ul>
</p>
<p>
<strong>Common AVD Commands:</strong>
<ul>
<li><code>-avd <name></code>: Start the emulator with the specified AVD name.</li>
<li><code>-netdelay <delay></code>: Set network latency (e.g., <code>none</code>, <code>gsm</code>,
<code>edge</code>).
</li>
<li><code>-netspeed <speed></code>: Set network speed (e.g., <code>full</code>, <code>gsm</code>,
<code>hspa</code>).
</li>
<li><code>-no-boot-anim</code>: Disable the boot animation for faster startup.</li>
<li><code>-no-snapshot</code>: Prevent saving a snapshot on exit.</li>
<li><code>-no-window</code>: Run the emulator in headless mode (no UI window).</li>
<li><code>-gpu off</code>: Disable GPU emulation.</li>
<li><code>-writable-system</code>: Enable writable system partition.</li>
<li><code>-camera-back <mode></code>: Set the back camera (e.g., <code>emulated</code> or
<code>none</code>).
</li>
<li><code>-scale <scale></code>: Set the display scale (e.g., <code>0.5</code> for 50% size).</li>
<li><code>-memory <size></code>: Allocate RAM to the emulator (e.g., <code>2048</code> MB).</li>
<li><code>-skin <size></code>: Specify the screen size (e.g., <code>480x800</code>).</li>
<li><code>-logcat *:I</code>: Display log messages in the emulator console.</li>
</ul>
</p>
<strong>to configure the harder of AVD, your can do that from your avd's <code>config.ini</code> file</strong>
<pre>C:\Users\username\.android\avd\yourAdvname.avd\</pre>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>note: replace <span style="color: #76FF03;">username</span> with your PC's username and replace
<span style="color: #76FF03;">yourAdvname</span> with your AVD's name
</li>
</ul>
<br><br>
<hr style="height: 3px; background-color: brown;">
<h2 style="text-align: center;">Other AVD Commands</h2>
<hr style="height: 3px; background-color: brown;">
<h2>Force Kill an Emulator</h2>
<h4>to get the Emulator devices</h4>
<div class="code-container">
<pre><code>adb devices</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<h5>ADB Devices Output</h5>
<pre>
C:\Users\"username">adb devices
List of devices attached
emulator-5554 device
</pre>
<h4>Kill Emulator</h4>
<div class="code-container">
<pre><code>adb -s emulator-5554 emu kill</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>note: replace <span style="color: #76FF03;">emulator-5554</span> with your device name</li>
</ul>
<h2>Update SDK and AVD</h2>
<h3>Update All SDK Components:</h3>
<div class="code-container">
<pre><code>sdkmanager --update</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<h3>Update the Emulator:</h3>
<div class="code-container">
<pre><code>sdkmanager "emulator"</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<h2>Start and Stop the ADB Server</h2>
<div class="code-container">
<pre><code>adb kill-server</code>
<code>adb start-server</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<h2>Pull and Push Files to/from AVD</h2>
<h3>Check File Existence on AVD:</h3>
<div class="code-container">
<pre><code>adb shell mkdir /sdcard/Download</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>note: replace <span style="color: #76FF03;">sdcard/Download</span> with the location you wanted to check
</li>
</ul>
<h5>Output</h5>
<pre>C:\Users\username>adb shell mkdir /sdcard/Download
mkdir: '/sdcard/Download': File exists</pre>
<h3>Pull Files:</h3>
<div class="code-container">
<pre><code>adb pull /sdcard/Download/ C:\AVDFiles</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>Note: Replace <span style="color: #76FF03;">sdcard/Download</span> with your AVD location, and
<br>replace <span style="color: #76FF03;">C:\AVDFiles</span> with the location on your host device where
you want to pull the files.
</li>
</ul>
<h3>Push Files:</h3>
<div class="code-container">
<pre><code>adb push C:\AVDFiles\myfile.txt /sdcard/Download/</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>Note: Replace <span style="color: #76FF03;">sdcard/Download</span> with your AVD location, and
<br>replace <span style="color: #76FF03;">C:\AVDFiles</span> with the location on your host device where
you want to pull the files.
</li>
</ul>
<h2>Uninstall AVD & SDK Components</h2>
<h4>Uninstall AVD</h4>
<ul style="font-size: 0.9rem; list-style-type: disc;">
<li>Note: Replace <span style="color: #76FF03;">MyAVD</span> with your AVD name.</li>
</ul>
<div class="code-container">
<pre><code>avdmanager delete avd -n MyAVD</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
<div class="code-container">
<pre><code>sdkmanager --uninstall "build-tools;34.0.0" "platforms;android-34" "system-images;android-34;google_play;x86_64"</code></pre>
<button class="copy-btn" onclick="copyToClipboard(this)">Copy</button>
</div>
</div>
<footer>
<!-- Contact Information -->
<div class="contact">
<ul>
<!-- Email Icon -->
<li><a href="mailto:mohamedmaizanmunas@outlook.com"><i class="fas fa-envelope"></i> Email</a></li>
<!-- GitHub Icon -->
<li><a href="https://github.com/maiz-an" target="_blank"><i class="fab fa-github"></i> GitHub</a></li>
<!-- Portfolio Icon -->
<li><a href="http://maizan.infinityfreeapp.com/" target="_blank"><i class="fas fa-briefcase"></i>
Portfolio</a></li> <!-- New portfolio link -->
</ul>
</div>
<p>Good luck with your Android development journey! You've got this! 🚀<br>
for more detailed check <a
href="https://github.com/maiz-an/Android-Virtual-Device-AVD-Setup-without-Andriod-Studio"
target="_blank" style="font-size: 1rem;">README.MD</a></p>
</footer>
<!-- Scroll Buttons -->
<div id="scroll-buttons">
<button id="scroll-up" class="scroll-btn">↑ Top</button>
<button id="scroll-down" class="scroll-btn">↓ Bottom</button>
</div>
<script>
document.getElementById('scroll-up').addEventListener('click', function () {
window.scrollTo({
top: 0,
behavior: 'smooth' // Smooth scrolling
});
});
document.getElementById('scroll-down').addEventListener('click', function () {
window.scrollTo({
top: document.body.scrollHeight,
behavior: 'smooth' // Smooth scrolling
});
});
</script>
<script>
function copyToClipboard(button) {
const codeElement = button.previousElementSibling; // Selects the previous <code> element
if (!codeElement) return;
const textArea = document.createElement("textarea");
textArea.value = codeElement.innerText;
document.body.appendChild(textArea);
textArea.select();
document.execCommand("copy");
document.body.removeChild(textArea);
// Change button text to "Copied!" temporarily
const originalText = button.innerText;
button.innerText = "Copied!";
setTimeout(() => {
button.innerText = originalText;
}, 1500); // Reset after 1.5 seconds
}
</script>
</body>
</html>