blob: 226183cbb1451554dfa4c85a143a0f27ca68dbae [file] [log] [blame]
smain@google.com0a03f312016-03-07 16:38:37 -08001page.title=Run Your App on the N Preview
2meta.keywords="preview", "android"
3page.tags="preview", "developer preview"
4page.image=images/cards/card-n-sdk_2x.png
5
6@jd:body
7
8<div id="qv-wrapper">
9 <div id="qv">
10 <ol>
11 <li><a href="#setupAVD">Set up a Virtual Device</a></li>
12 <li><a href="#setup-device">Set Up a Hardware Device</a></li>
13</ol>
14 </div>
15</div>
16
17<p>If you have an existing Android app and you simply want to run it on the N
18Preview system image, then you need either a virtual device or a supported
19hardware device configured with N Preview system image.</p>
20
21<p>Simply installing your app onto the N Preview this way does not require
22any changes to your app source code. If, however, you want to update your
23app to use new APIs in the N Preview and new language features of Java 8,
24then you need to download Android Studio 2.1 (preview) as described in
25<a href="{@docRoot}preview/setup-sdk.html">Set Up to Develop for the
26N Preview</a>.
27
28<p>So, although Android Studio 2.1 is required for development with N Preview
29APIs, you can use Android Studio 1.5 or higher if you simply want to run your
30app in the emulator or a connected device.</p>
31
32
33<h2 id="setupAVD">Set up a Virtual Device</h2>
34
35<p>To use the Android Emulator to run the N Preview you need to download
36the Android N Preview SDK and create a virtual device for the emulator.
37</p>
38
39<p>First, downloaded the Android N Preview SDK as follows (if you
40already got it while <a href="{@docRoot}preview/setup-sdk.html">setting up
41Android Studio 2.1</a>, you can skip this part):
42
43<ol>
44 <li>In Android Studio, open the Settings dialog
45 (<strong>File &gt; Settings</strong> on Windows/Linux, or
46 <strong>Android Studio &gt; Preferences</strong> on Mac). In the left
47 panel, select <strong>Appearance &amp; Behavior &gt;
48 System Settings &gt; Android SDK</strong>.
49
50 <li>Click the <strong>SDK Platforms</strong> tab, then select the
51 <strong>Android N Preview</strong> check box.</li>
52
53 <li>Click the <strong>SDK Tools</strong> tab, then select the
54 <strong>Android SDK Build Tools</strong>, <strong>Android SDK
55 Platform-Tools</strong>, and <strong>Android SDK Tools</strong> check
56 boxes.
57 </li>
58
59 <li>Click <strong>OK</strong> and accept the license
60 agreements for any packages to be installed.
61 </li>
62</ol>
63
64
65<p>Now create a virtual device with the N Preview system image:</p>
66
67<ol>
68 <li>Open the AVD Manager by selecting <strong>Tools > Android >
69 AVD Manager</strong>.</li>
70 <li>Click <strong>Create Virtual Device</strong>.</li>
71 <li>Select a device such as Nexus 5X, Nexus 6P, Nexus 9, or Android TV,
72 then click <strong>Next</strong>.</li>
73 <li>Select the <strong>N</strong> system image (with the
74 <strong>x86</strong> ABI), then click <strong>Next</strong>.
75 <li>Complete the rest of the AVD configuration and click
76 <strong>Finish</strong>.</li>
77</ol>
78
79<p>You can now launch the Android Emulator with the Android N Preview AVD.</p>
80
81<p>For more information about creating virtual devices, see <a href=
82 "{@docRoot}tools/devices/index.html">Managing Virtual Devices</a>.
83</p>
84
85
86
87<h2 id="setup-device">Set Up a Hardware Device</h2>
88
89<p>If you have a Nexus 5X, Nexus 6P, Nexus 9, Pixel C, or Nexus Player, you can
90install the N Preview for testing your app.</p>
91
92<p class="caution">
93 <strong>Important:</strong> Installing a preview image on a device
94 <em>removes all data from it</em>, so you should backup any data before
95 installing a preview image.
96</p>
97
98<p><strong>TODO(smain/joefernandez): Merge as appropriate with <a href=
99"{@docRoot}preview/download.html">Image Downloads and OTA
100Updates</a>.</strong></p>