1 page.title= 2 @jd:body 3 4 <div id="qv-wrapper"> 5 <div id="qv"> 6 7 <h2></h2> 8 9 <ul> 10 <li>Android <em></em></a></li> 11 <li></li> 12 <li></li> 13 <li></li> 14 </ul> 15 16 <h2></h2> 17 18 <ol> 19 <li><a href="#overview"></a></li> 20 <li><a href="#strategies"></a></li> 21 <li><a href="#setup"></a></li> 22 <li><a href="#debugmode"> </a></li> 23 <li><a href="#releasemode"></a> 24 <ol> 25 <li><a href="#releasecompile"></a></li> 26 <li><a href="#cert"></a></li> 27 <li><a href="#signapp"></a></li> 28 <li><a href="#ExportWizard">Eclipse ADT </a></li> 29 </ol> 30 </li> 31 <li><a href="#secure-key"></a></li> 32 33 </ol> 34 35 <h2></h2> 36 37 <ol> 38 <li><a href="{@docRoot}tools/publishing/versioning.html"></a></li> 39 <li><a href="{@docRoot}tools/publishing/preparing.html"></a></li> 40 </ol> 41 42 </div> 43 </div> 44 45 <p>Android </p> 46 47 <h2 id="overview"></h2> 48 49 <p>Android Android Android </p> 50 51 <p>Android :</p> 52 53 <ul> 54 <li><em></em></li> 55 <li></li> 56 <li> SDK 57 </li> 58 <li></li> 59 <li> Keytool Jarsigner .apk </li> 60 </ul> 61 62 <p>Android Android </p> 63 64 <p>Android SDK ADT Plugin for EclipseAnt <em> </em><em> </em> 2 65 66 <ul> 67 <li> JDK Keytool .apk / </li> 68 69 <li> .apk <span style="color:red"></span> 2 : 70 <ul> 71 <li>Keytool Jarsigner <em></em> .apk Jarsigner .apk Keytool /Jarsigner </li> 72 <li>ADT Export Wizard ADT Eclipse Export Wizard .apk Export Wizard 1 73 </li> 74 </ul> 75 </li> 76 </ul> 77 78 <h2 id="strategies"></h2> 79 80 <p> </p> 81 82 <p>: </p> 83 84 <ul> 85 <li> - </li> 86 87 <li> - Android </li> 88 89 <li>/ - Android </li> 90 91 </ul> 92 93 <p> 1 </p> 94 95 <ul> 96 <li></li> 97 98 <li> <em></em> </li> 99 100 <li> Android 2033 10 22 </li> 101 </ul> 102 103 <p><a href="#cert"></a> </p> 104 105 <h2 id="setup"></h2> 106 107 <p> SDK Keytool JAVA_HOME JDK SDK Keytool JDK Keytool PATH </p> 108 109 <p>Linux GNU Java gcj JDK Keytool Keytool PATH <code>/usr/bin/keytool</code> symlink symlink JDK Keytool </p> 110 111 <p>Jarsigner Jarsigner Keytool JDK </p> 112 113 <h2 id="debugmode"> </h2> 114 115 <p>Android .apk Android SDK Keytool </p> 116 117 <p>SDK /</p> 118 <ul> 119 <li> debug.keystore</li> 120 <li> android</li> 121 <li> androiddebugkey</li> 122 <li> android</li> 123 <li>CN CN=Android Debug,O=Android,C=US</li> 124 </ul></p> 125 126 <p> / /Eclipse/ADT [[]<strong>Windows</strong>] > [[]<strong>Prefs</strong>] > [[]<strong>Android</strong>] > [[]<strong>Build</strong>] / /</p> 127 128 <p class="note"><strong>:</strong> <em></em></p> 129 130 <h3>Eclipse </h3> 131 132 <p>Eclipse/ADT Keytool ADT .apk ADT Keytool </p> 133 134 <h3>Ant </h3> 135 136 <p>Ant .apk <code>debug</code> <code>android</code> <code>build.xml</code> <code>ant debug</code> /.apk <a href="{@docRoot}guide/developing/other-ide.html#DebugMode">: </a> </p> 137 138 139 <h3 id="debugexpiry"></h3> 140 141 <p> Eclipse/ADT Ant 365 </p> 142 143 <p> Ant :</p> 144 145 <pre>debug: 146 [echo] Packaging bin/samples-debug.apk, and signing it with a debug key... 147 [exec] Debug Certificate expired on 8/4/08 3:43 PM</pre> 148 149 <p>Eclipse/ADT Android </p> 150 151 <p><code>debug.keystore</code> AVD OS X Linux <code>~/.android/avd</code>Windows XP <code>C:\Documents and Settings\<user>\.android\</code>Windows Vista <code>C:\Users\<user>\.android\</code> </p> 152 153 154 <p> </p> 155 156 <p> <a href="{@docRoot}resources/faq/troubleshooting.html#signingcalendar"> </a> </p> 157 158 159 <h2 id="releasemode"></h2> 160 161 <p>:</p> 162 <ol> 163 <li> </li> 164 <li></li> 165 <li></li> 166 </ol> 167 168 <p></p> 169 170 <p>ADT Eclipse Export Wizard .apk Export Wizard <a href="#ExportWizard">Eclipse ADT </a></p> 171 172 173 <h3 id="releasecompile"></h3> 174 175 <p> Android </p> 176 177 <p class="warning"><strong>:</strong> </p> 178 179 <h4>Eclipse </h4> 180 181 <p><em></em> .apk Eclipse Package Explorer[[]<strong>Android Android Tools</strong>] > [[]<strong> Export Unsigned Application Package</strong>] .apk <code>AndroidManifest.xml</code> Eclipse [[]<em>Overview</em>] [[]<strong> .apk Export an unsigned .apk</strong>] </p> 182 183 <p>Export Wizard <a href="#ExportWizard">Eclipse ADT </a></p> 184 185 <h4>Ant </h4> 186 187 <p>Ant Ant releaseAnt build.xml :</p> 188 189 <pre>$ ant release</pre> 190 191 <p> .apk </p> 192 193 194 <h3 id="cert"></h3> 195 196 <p>:</p> 197 198 <ul> 199 <li></li> 200 <li></li> 201 <li> 25 202 <p> Android 2033 10 22 203 </p></li> 204 <li>Android SDK </li> 205 </ul> 206 207 <p>Keytool <a href="#setup"></a>Keytool </p> 208 209 <p>Keytool <code>keytool</code> </p> 210 211 <p class="warning"><strong>:</strong> Keytool <a href="#secure-key"></a></p> 212 213 <table> 214 <tr> 215 <th>Keytool </th> 216 <th></th> 217 </tr> 218 <tr> 219 <td><code>-genkey</code></td><td> </td> 220 </tr> 221 <tr> 222 <td><code>-v</code></td><td></td> 223 </tr> 224 <tr> 225 <td><code>-keystore <keystore-name>.keystore</code></td><td></td> 226 </tr> 227 <tr> 228 <td><code>-storepass <password></code></td><td><p></p><p> Keytool </p></td> 229 </tr> 230 <tr> 231 <td><code>-alias <alias_name></code></td><td></td> 232 </tr> 233 <tr> 234 <td><code>-keyalg <alg></code></td><td>DSA RSA 2 </td> 235 </tr> 236 <tr> 237 <td><code>-dname <name></code></td><td><p> </p><p> Jarsigner CNOU </p></td> 238 </tr> 239 <tr> 240 <td><code>-validity <valdays></code></td><td><p> </p><p><strong>:</strong> 10000 </p></td> 241 </tr> 242 <tr> 243 <td><code>-keypass <password></code></td><td><p></p> 244 <p> Keytool </p></td> 245 </tr> 246 </table> 247 248 249 <p> Keytool </p> 250 251 <pre>$ keytool -genkey -v -keystore my-release-key.keystore 252 -alias alias_name -keyalg RSA -validity 10000</pre> 253 254 <p>Keytool <code>my-release-key.keystore</code> 1 10000 </p> 255 256 <p>Keytool <a 257 href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security">http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security</a> </p> 258 259 260 <h3 id="signapp"></h3> 261 262 <p> .apk Jarsigner <a href="#setup"></a>Jarsigner </p> 263 264 <p>Jarsigner .apk .apk <p> 265 266 <table> 267 <tr> 268 <th>Jarsigner </th> 269 <th></th> 270 </tr> 271 <tr> 272 <td><code>-keystore <keystore-name>.keystore</code></td><td></td> 273 </tr> 274 <tr> 275 <td><code>-verbose</code></td><td></td> 276 </tr> 277 <tr> 278 <td><code>-storepass <password></code></td><td><p> </p><p> Jarsigner </p></td> 279 </tr> 280 <tr> 281 <td><code>-keypass <password></code></td><td><p> </p><p> Jarsigner </p></td> 282 </tr> 283 </table> 284 285 <p>Jarsigner <code>my_application.apk</code> 286 </p> 287 288 <pre>$ jarsigner -verbose -keystore my-release-key.keystore 289 my_application.apk alias_name</pre> 290 291 <p>Jarsigner .apk .apk .apk </p> 292 293 <p>.apk :</p> 294 295 <pre>$ jarsigner -verify my_signed.apk</pre> 296 297 <p>.apk Jarsigner jar verified</p> 298 299 <pre>$ jarsigner -verify -verbose my_application.apk</pre> 300 301 <p></p> 302 303 <pre>$ jarsigner -verify -verbose -certs my_application.apk</pre> 304 305 <p> <code>-certs</code> CN=</p> 306 307 <p class="note"><strong>:</strong> CN=Android Debug.apk Android SDK </p> 308 309 <p>Jarsigner <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security">http://java.sun.com/j2se/1.5.0/docs/tooldocs/#security</a> </p> 310 311 312 <h3 id="ExportWizard">Eclipse ADT </h3> 313 314 <p>ADT Eclipse Export Wizard <em></em> .apk Export Wizard Keytool Jarsigner Export Wizard Keytool Jarsigner <a href=#setup"></a></p> 315 316 <p> .apk Package Explorer<strong>[[]Android Android Tools] > [[] Export Signed Application Package]</strong> <code>AndroidManifest.xml</code> Eclipse [[]<em>Overview</em>] [[]<strong>Export Wizard Use the Export Wizard</strong>] Export Wizard .apk </p> 317 318 <p>Export Wizard .apk </p> 319 320 321 <h2 id="secure-key"></h2> 322 323 <p> </p> 324 325 <p> </p> 326 327 <p> </p> 328 329 <ul> 330 <li></li> 331 <li>Keytool <em></em> <code>-storepass</code> <code>-keypass</code> </li> 332 <li>Jarsigner <em></em> <code>-storepass</code> <code>-keypass</code> </li> 333 <li></li> 334 </ul> 335 336 <p> </p>