{"id":278304,"date":"2016-04-14T17:35:06","date_gmt":"2016-04-14T13:35:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278304"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278304","title":{"rendered":"\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 Google Play"},"content":{"rendered":"<p>       \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u043d\u0434\u0440\u043e\u0438\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0432 Google Play \u0438\u043b\u0438 \u043e\u043d\u043e \u0443\u0436\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435, \u0438 \u043e\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u043c \u0431\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0430 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443\\\u0442\u0435\u0441\u0442\u0435\u0440\u0430\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0440\u0443\u043a\u0430\u043c\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 <a href=\"https:\/\/developers.google.com\/android-publisher\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/a> \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h4>\n<p>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <a href=\"https:\/\/play.google.com\/apps\/publish\">Google Play Developer Console<\/a> \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043c\u0435\u043d\u044e <i>Settings<\/i> \u2192 <i>API access<\/i><br \/>  \u041a\u043e\u043d\u0441\u043e\u043b\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c c Google API \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u043e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043d\u043e\u043f\u043a\u0430 Create new project<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/333\/fbc\/395\/333fbc3959d449a3afba1170b0c1e47e.jpg\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u0435\u0441\u0442\u044c, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041a\u043d\u043e\u043f\u043a\u0430 link \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0435 \u0434\u0435\u043b\u043e \u0438\u0445 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e14\/cbf\/2fd\/e14cbf2fd25b4a058094d2d8c4094a01.jpg\"\/><\/p>\n<p>  \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437 <a href=\"https:\/\/console.developers.google.com\">Google API Console<\/a> \u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 Google Play Developer Console, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u0442, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 <i>Create new project<\/i><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 Google API \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f popup-\u043e\u043a\u043e\u0448\u043a\u043e, \u0442\u0443\u0442 <i>Accept All<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/927\/38f\/304\/92738f30489a44ea8e82d26b270a7153.jpg\"\/><\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 service account, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/345\/8ce\/e80\/3458cee80bcd47bbb022c836737b120f.jpg\"\/><\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Google Play \u0438 \u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u0440\u043e\u043b\u044c. \u042d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043e\u0442\u0441\u044e\u0434\u0430, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <i>Grant access<\/i>. \u0412\u0430\u0441 \u043f\u0435\u0440\u0435\u043a\u0438\u043d\u0435\u0442 \u0432 \u043c\u0435\u043d\u044e User accounts &#038; right(\u0432\u0438\u0434\u043d\u043e \u043d\u0430 \u0437\u0430\u0434\u043d\u0435\u043c \u043f\u043b\u0430\u043d\u0435) \u0438 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f popup-\u043e\u043a\u043e\u0448\u043a\u043e, \u0433\u0434\u0435 email \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0443\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u044b. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 <i>Add user<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/66b\/895\/ec8\/66b895ec8af34c9d88c6f23d71be69bf.jpg\"\/><\/p>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u0448 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/640\/575\/5ff\/6405755ffa084992a196719efe2645a7.jpg\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447\u0438, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <a href=\"https:\/\/console.developers.google.com\/project\">\u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432<\/a> \u0432 Google API Console \u0438 \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043f\u043e \u043d\u0443\u0436\u043d\u043e\u043c\u0443, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f<i> Google Play Android Developer<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c72\/a34\/cf3\/c72a34cf3f8f42259dd0ebb869852b72.jpg\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043f\u0443\u043d\u043a\u0442 \u043c\u0435\u043d\u044e <i>Credentials<\/i> \u2192 <i> Create credentials<\/i>, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 <i>Service account key<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c89\/977\/5c9\/c899775c945e4f2ea37fa924c35315d0.jpg\"\/><\/p>\n<p>  \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 <i>Compute Engine default service account<\/i> \u0438 \u043f\u0435\u0440\u0435\u043a\u0438\u043d\u044c\u0442\u0435 radio button \u043d\u0430 <i>P12<\/i>. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 <i>Create<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/443\/904\/821\/44390482187443429b3dbc4722eeb770.jpg\"\/><\/p>\n<p>  \u0421 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0432\u0441\u0435, \u043f\u0430\u0440\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0438 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447\u0438 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <i>Google Play Android Developer-%\u043a\u0443\u0441\u043e\u0447\u0435\u043a id%.p12<\/i> \u0431\u044b\u043b\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0430 \u043d\u0430 \u043a\u043e\u043c\u043f\u0435<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/166\/b54\/0dc\/166b540dc6864115b47660aeff46887e.jpg\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/996\/f28\/da7\/996f28da7dd940cfa78e20d823abb049.jpg\"\/><\/p>\n<h4>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e<\/h4>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 Google \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 java \u0438 python \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Google Play Developer API. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430 java, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/developers.google.com\/android-publisher\/androidpublisher_v2_public.zip\">\u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 zip-\u0430\u0440\u0445\u0438\u0432<\/a> \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438<br \/>  \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432\u0430\u0448\u0443 IDE \u0438 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u0432\u043e\u0439 \u044f \u043d\u0430\u0437\u0432\u0430\u043b ProductionManager, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:  <\/p>\n<ul>\n<li>google-api-client-1.19.0.jar<\/li>\n<li>google-api-services-androidpublisher-v2-rev20141111-1.19.0.jar<\/li>\n<li>google-http-client-1.19.0.jar<\/li>\n<li>google-http-client-jackson2-1.19.0.jar<\/li>\n<li>google-oauth-client-1.19.0.jar<\/li>\n<li>jackson-core-2.1.3.jar<\/li>\n<\/ul>\n<p>  \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <i>Google Play Android Developer-%\u043a\u0443\u0441\u043e\u0447\u0435\u043a id%.p12<\/i> \u0432 resource \u043f\u0430\u043f\u043a\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u044f \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043b \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432, \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0435\u0433\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 VCS \u043a\u0443\u0434\u0430 \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u044e\u0434\u0435\u0439, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043b\u0443\u0447\u0448\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0435\u043f\u0440\u0435\u0440\u044b\u0432\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438, \u0442\u0443\u0442 \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044f \u0434\u0435\u043b\u0430\u044e \u0437\u0430\u043f\u0440\u043e\u0441, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043a\u043e\u0434\u0430(versionCode) \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0448\u043b\u0438 \u0432 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0441 \u0448\u0430\u0433\u043e\u043c 1(\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e 1, 2, 3&#8230;), \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c buildNumber \u0438\u0437 CI \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u043b\u0438 revesionNumber \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 VCS, \u0442\u043e\u0436\u0435 \u043d\u0430 \u0432\u0430\u0448\u0435 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">private Edits getApplicationEdits() throws Exception { \tString applicationName = &quot;ApplicationName&quot;; \tString serviceAccountId = &quot;\u0438-\u0433\u043e-\u0433\u043e@developer.gserviceaccount.com&quot; \t \tHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); \tJsonFactory jsonFactory = JacksonFactory.getDefaultInstance(); \t \tKeyStore keyStore = SecurityUtils.getPkcs12KeyStore(); \tInputStream inputStream = ProductionManager.class.getResourceAsStream(&quot;\/resources\/key.p12&quot;); \tPrivateKey privateKey = SecurityUtils.loadPrivateKeyFromKeyStore(keyStore, inputStream, &quot;notasecret&quot;, &quot;privatekey&quot;, &quot;notasecret&quot;); \tinputStream.close(); \t \tGoogleCredential credential = new GoogleCredential \t\t\t.Builder() \t\t\t.setTransport(httpTransport) \t\t\t.setJsonFactory(jsonFactory) \t\t\t.setServiceAccountId(serviceAccountId) \t\t\t.setServiceAccountScopes(Collections.singleton(AndroidPublisherScopes.ANDROIDPUBLISHER)) \t\t\t.setServiceAccountPrivateKey(privateKey) \t\t\t.build(); \t \tAndroidPublisher androidPublisher = new AndroidPublisher \t\t\t.Builder(httpTransport, jsonFactory, credential) \t\t\t.setApplicationName(applicationName) \t\t\t.build(); \t \treturn androidPublisher.edits(); }  private void updateVersionCode() throws Exception { \tString packageName = &quot;com.package.name&quot;; \t \tEdits edits = getApplicationEdits();  \tString editId = edits \t\t\t.insert(packageName, null) \t\t\t.execute() \t\t\t.getId(); \t \tApksListResponse apksResponse = edits \t\t\t.apks() \t\t\t.list(packageName, editId) \t\t\t.execute(); \t \tList&lt;Integer&gt; versions = new ArrayList&lt;Integer&gt;(); \tList&lt;Apk&gt; apks = apksResponse.getApks(); \tif (apks == null) { \t\tthrow new Exception(&quot;responsed list of apks is null&quot;); \t} \t \tfor (Apk apk : apks) { \t\tversions.add(apk.getVersionCode()); \t} \t \tif (versions.isEmpty()) { \t\tthrow new Exception(&quot;previous versions are not detected&quot;); \t} \t \tint lastVersionCode = Collections.max(versions); \tif (lastVersionCode == 0) { \t\tthrow new Exception(&quot;version is 0&quot;); \t} \t \t\/\/TODO update version code \t\/\/++lastVersionCode } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">private void publishApplication() throws Exception { \tString packageName = &quot;com.package.name&quot;; \tString track = &quot;beta&quot;;\/\/release \tString setupFilePath = &quot;\/path\/to\/setup\/file\/app.apk&quot;; \t \tEdits edits = getApplicationEdits();  \tString editId = edits \t\t\t.insert(packageName, null) \t\t\t.execute() \t\t\t.getId(); \t \tFileContent mediaContent = new FileContent(&quot;application\/vnd.android.package-archive&quot;, new File(setupFilePath)); \tUpload uploadRequest = edits \t\t\t.apks() \t\t\t.upload(packageName, editId, mediaContent); \t \tApk apk = uploadRequest.execute();  \tList&lt;Integer&gt; versions = new ArrayList&lt;&gt;(); \tversions.add(apk.getVersionCode()); \t \tedits \t\t.tracks() \t\t.update(packageName, editId, track, new Track().setVersionCodes(versions)) \t\t.execute(); \t \tedits \t\t.commit(packageName, editId) \t\t.execute(); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 executable jar. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0438 \u0435\u0433\u043e \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043d\u0430 \u0432\u0430\u0448\u0435\u043c CI \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e TeamCity. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 4 build steps:  <\/p>\n<ol>\n<li>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 version\u0421ode. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 jar-\u0444\u0430\u0439\u043b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0438 \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 updateVersionCode(). \u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 TeamCity<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0b5\/c5f\/085\/0b5c5f0855874724a2ca1a024323c6dd.jpg\"\/>  <\/li>\n<li>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 versionName<\/li>\n<li>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f apk. \u041c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 step, \u0435\u0441\u0442\u044c gradle \u0438 IntelliJ IDEA, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u044f artifact-\u0430<\/li>\n<li>\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0422\u0430\u043a \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 jar-\u0444\u0430\u0439\u043b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 publishApplication()<\/li>\n<\/ol>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/281557\/\"> https:\/\/habrahabr.ru\/post\/281557\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u043d\u0434\u0440\u043e\u0438\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0432 Google Play \u0438\u043b\u0438 \u043e\u043d\u043e \u0443\u0436\u0435 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435, \u0438 \u043e\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0437\u0430\u043a\u0440\u044b\u0442\u043e\u043c \u0431\u0435\u0442\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0430 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443\\\u0442\u0435\u0441\u0442\u0435\u0440\u0430\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0440\u0443\u043a\u0430\u043c\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-278304","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278304"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278304\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}