{"id":272,"date":"2010-05-13T21:53:26","date_gmt":"2010-05-13T12:53:26","guid":{"rendered":"http:\/\/www.key-p.com\/blog\/staff\/?p=272"},"modified":"2018-10-18T15:20:28","modified_gmt":"2018-10-18T06:20:28","slug":"adobe-air2-0-nativeprocess%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f-for-mac","status":"publish","type":"post","link":"https:\/\/www.key-p.com\/blog\/staff\/archives\/272","title":{"rendered":"Adobe AIR2.0  NativeProcess\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f for Mac"},"content":{"rendered":"<p>\n\u3053\u3093\u306b\u3061\u306f\u3001\u77e2\u91ce\u3067\u3059\u3002<br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\nAIR2.0\u304b\u3089\u30ed\u30fc\u30ab\u30eb\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b\u3063\u3066\u3053\u3068\u3067\u3001<br \/>\nMac\u306e\u300cditto\u300d\u30b3\u30de\u30f3\u30c9\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u5727\u7e2e\u3067\u304d\u308b\u304b\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u203b ditto\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u5727\u7e2e\u3059\u308b\u3068\u3001Mac\u306e\u30d5\u30a1\u30a4\u30eb\u60c5\u5831\u3067\u3042\u308b\u30ea\u30bd\u30fc\u30b9\u30d5\u30a9\u30fc\u30af\u3092\u542b\u3093\u3060\u5f62\u3067\u5727\u7e2e\u3067\u304d\u308b\u3093\u3067\u3059\u3002<br \/>\n\u3000<!--more--><br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n\u4ee5\u4e0b\u3092\u53c2\u8003\u306b<br \/>\n<a href=\"http:\/\/un-q.net\/2010\/02\/air20_bata_2_nativeproce_cs4.html\" target=\"_blank\">AIR2.0 Bata 2 \u3067NativeProcess\u3064\u304b\u3063\u3066\u307f\u308b\u3002Flash CS4\u3064\u304b\u3063\u3066\u3002<\/a><br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n\u30cf\u30de\u3063\u305f\u3053\u3068\u3000<span style=\"color:#CC0000;font-weight:bold;\">\u30ea\u30ea\u30fc\u30b9\u30d3\u30eb\u30c9\u3067\u30a8\u30e9\u30fc\u7d9a\u51fa<\/span><br \/>\napplication.xml\u306e\u8ffd\u8a18\u3068\u3001\u30cd\u30a4\u30c6\u30a3\u30d6\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u304c\u5fc5\u9808\u306a\u3053\u3068\u3092\u77e5\u3089\u305a\u3001<br \/>\n\u666e\u901a\u306b\u30ea\u30ea\u30fc\u30b9\u30d3\u30eb\u30c9\u3057\u3066\u3082\u5168\u304f\u52d5\u304b\u305a\u3067\u3001\u304b\u306a\u308a\u683c\u95d8\u3057\u307e\u3057\u305f\u3002<br \/>\n\u30cd\u30a4\u30c6\u30a3\u30d6\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u306fWin\u306a\u3089exe\u3000Mac\u306a\u3089dmg\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u306a\u3044\u3068\u99c4\u76ee\u306a\u3093\u3067\u3059\u306d\u3047\u3002<br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n\u3068\u308a\u3042\u3048\u305a\u3001adt\u30b3\u30de\u30f3\u30c9\u3092\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<span style=\"font-weight:bold;font-size:1.2em;\">1.AIR2.0\u306esdk\u5185\u306ebin\u306b\u30b3\u30de\u30f3\u30c9\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30b7\u30a7\u30eb\u306b\u30d1\u30b9\u3092\u901a\u3057\u307e\u3059\u3002<\/span><br \/>\n\u79c1\u306f\u3001zsh\u306a\u3093\u3067\u3001.zsrenv\u306b<br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n[code]<br \/>\nexport PATH=~\/Applications\/Adobe\\ Flash\\ Builder\\ 4\/sdks\/4.0.0\/bin<br \/>\n[\/code]<br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<span style=\"font-weight:bold;font-size:1.2em;\">2.\u30bf\u30fc\u30df\u30ca\u30eb\u518d\u8d77\u52d5\u3059\u308b\u3068\u3001\u300cadt\u300d\u30b3\u30de\u30f3\u30c9\u304c\u5229\u7528\u53ef\u80fd\u306b\uff01<\/span><br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<span style=\"font-weight:bold;font-size:1.2em;\">3.\u5727\u7e2e\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7528\u610f <\/span><br \/>\nsrc\/archive.sh<br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<pre class=\"lang:default decode:true \" title=\"archive.sh\">\n#!\/bin\/sh\nditto -c -k \"$@\"\n<\/pre>\n<div style=\"margin-bottom:20px;\"><\/div>\n<span style=\"font-weight:bold;font-size:1.2em;\">4.NativeProcessTest.mxml<\/span><br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<pre class=\"lang:default decode:true \" title=\"NativeProcessTest.mxml\">\n< ?xml version=\"1.0\" encoding=\"utf-8\"?>\n<mx :WindowedApplication xmlns:mx=\"http:\/\/www.adobe.com\/2006\/mxml\" layout=\"vertical\" horizontalAlign=\"left\" creationComplete=\"init()\">\n\t<\/mx><mx :Script>\n\t\t< ![CDATA[\n\t\t\timport flash.desktop.*;\n\t\t\timport mx.controls.Alert;\n\t\t\tprivate var process:NativeProcess;\n\t\t\t\n\t\t\tprivate function init():void{}\n\t\t\t\n\t\t\tpublic function dittoCommnd():void{\n\t\t\t\tif (NativeProcess.isSupported){\n\t\t\t\t\t\/\/\u3000\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u60c5\u5831\u8a2d\u5b9a\n\t\t\t\t\tvar info:NativeProcessStartupInfo = new NativeProcessStartupInfo();\n\t\t\t\t\t\/\/ \u5b9f\u884c\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6307\u5b9a \u76f8\u5bfe\u30d1\u30b9\u306e\u5834\u5408\u3001fla\u306e\u3042\u308b\u30d5\u30a9\u30eb\u30c0\u304b\u3089\u306e\u30d1\u30b9\n\t\t\t\t\tvar shFile:File = File.applicationDirectory.resolvePath(\"archive.sh\");\n\t\t\t\t\tinfo.executable = shFile;\n\t\t\t\t\t\n\t\t\t\t\t\/\/ \u5b9f\u884c\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u6e21\u3059\u5f15\u6570\n\t\t\t\t\tvar args:Vector.<String> = new Vector.<string>();\n\t\t\t\t\t\/\/\u7b2c1\u5f15\u6570\n\t\t\t\t\targs.push(\"\/Users\/test\/Pictures\/hoge\"); \/\/\u5727\u7e2e\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u9054\n\t\t\t\t\t\/\/\u7b2c2\u5f15\u6570\n\t\t\t\t\targs.push(\"\/Users\/test\/Desktop\/hoge.zip\"); \/\/ \u5727\u7e2e\u5f8c\u306e\u30d5\u30a1\u30a4\u30eb\u540d\n\t\t\t\t\tinfo.arguments = args;\n\t\t\t\t\t\n\t\t\t\t\tprocess = new NativeProcess();\n\t\t\t\t\tprocess.addEventListener(NativeProcessExitEvent.EXIT, onComplateHandler);\n\t\t\t\t\tprocess.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);\n\t\t\t\t\tprocess.addEventListener(ProgressEvent.STANDARD_ERROR_DATA, onErrorData);\n\t\t\t\t\t\n\t\t\t\t\tprocess.start(info);\n\t\t\t\t}else{\n\t\t\t\t\tAlert.show(\"NativeProcess not supported.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic function onComplateHandler(event:NativeProcessExitEvent):void {\n\t\t\t\toutPutTextArea.text = \"Process exited with \" + event.exitCode;\n\t\t\t\tAlert.show(\"Archive complete\");\n\t\t\t}\n\n\t\t\tpublic function onOutputData(event:ProgressEvent):void{\n\t\t\t\ttrace(\"Got: \", process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable));\n\t\t\t\toutPutTextArea.text = process.standardOutput.readUTFBytes(process.standardOutput.bytesAvailable) + outPutTextArea.text;\n\t\t\t}\n\t\t\t\n\t\t\tprivate function onErrorData(event:Event):void{\n\t\t\t\tAlert.show(\"ERROR\");\n\t\t\t\tvar bytes = event.currentTarget.standardOutput;\n\t\t\t\toutPutTextArea.text = bytes.readUTFBytes(bytes.bytesAvailable).toString();\n\t\t\t}\n\t\t\t\n\t\t]]>\n\t<\/string><\/mx>\n\t<mx :HBox width=\"100%\">\n\t\t<mx :Button label=\"\u5727\u7e2e\" click=\"dittoCommnd()\"><\/mx>\n\t<\/mx>\n\t<mx :TextInput width=\"100%\" height=\"100%\" editable=\"false\" id=\"outPutTextArea\"><\/mx>\n \n<\/pre>\n<div style=\"margin-bottom:20px;\"><\/div>\n<br \/>\n<span style=\"font-weight:bold;font-size:1.2em;\">5.NativeProcessTest-app.xml<\/span><br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<pre class=\"lang:default decode:true \" title=\"NativeProcessTest-app.xml\">\n< ?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<application xmlns=\"http:\/\/ns.adobe.com\/air\/application\/2.0beta2\">\n\/\/ \u4ee5\u4e0b\u306e\u3088\u3046\u306bextendedDesktop desktop\u3063\u3066\u3057\u306a\u3044\u3068\u30ea\u30ea\u30fc\u30b9\u30d3\u30eb\u30c9\u3067\u304d\u307e\u305b\u3093\n<supportedprofiles>extendedDesktop desktop<\/supportedprofiles>\n\t<id>NativeProcessTest<\/id>\n\t<filename>NativeProcessTest<\/filename>\n\t<name>NativeProcessTest<\/name>\n\t<version>v1<\/version>\n\t<initialwindow>\n\t\t<!-- The main SWF or HTML file of the application. Required. -->\n\t\t<!-- Note: In Flash Builder, the SWF reference is set automatically. -->\n\t\t<content>[\u3053\u306e\u5024\u306f Flash Builder \u306e\u51fa\u529b\u30d5\u30a1\u30a4\u30eb app.xml \u306b\u4e0a\u66f8\u304d\u3055\u308c\u307e\u3059\u3002]<\/content>\n\t\t\n\t\t<!-- The title of the main window. Optional. -->\n\t\t<!-- <title> -->\n\n\t\t<!-- The type of system chrome to use (either \"standard\" or \"none\"). Optional. Default standard. -->\n\t\t<!-- <systemChrome> -->\n\n\t\t<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->\n\t\t<!-- <transparent> -->\n\n\t\t<!-- Whether the window is initially visible. Optional. Default false. -->\n\t\t<!-- <visible> -->\n\n\t\t<!-- Whether the user can minimize the window. Optional. Default true. -->\n\t\t<!-- <minimizable> -->\n\n\t\t<!-- Whether the user can maximize the window. Optional. Default true. -->\n\t\t<!-- <maximizable> -->\n\n\t\t<!-- Whether the user can resize the window. Optional. Default true. -->\n\t\t<!-- <resizable> -->\n\n\t\t<!-- The window's initial width in pixels. Optional. -->\n\t\t<!-- <width> -->\n\n\t\t<!-- The window's initial height in pixels. Optional. -->\n\t\t<!-- <height> -->\n\n\t\t<!-- The window's initial x position. Optional. -->\n\t\t<!-- <x> -->\n\n\t\t<!-- The window's initial y position. Optional. -->\n\t\t<!-- <y> -->\n\n\t\t<!-- The window's minimum size, specified as a width\/height pair in pixels, such as \"400 200\". Optional. -->\n\t\t<!-- <minSize> -->\n\n\t\t<!-- The window's initial maximum size, specified as a width\/height pair in pixels, such as \"1600 1200\". Optional. -->\n\t\t<!-- <maxSize> -->\n\t<\/initialwindow>\n\n<\/application>\n<\/pre>\n<div style=\"margin-bottom:20px;\"><\/div>\n<br \/>\n<span style=\"font-weight:bold;font-size:1.2em;\">6.\u30ea\u30ea\u30fc\u30b9\u30d3\u30eb\u30c9<\/span><br \/>\n\u666e\u901a\u306b\u30ad\u30fc\u30b9\u30c8\u30a2\u3092\u4ed5\u69d8\u3057\u3066\u30ea\u30ea\u30fc\u30b9\u30d3\u30eb\u30c9\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002 <br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<br \/>\n<span style=\"font-weight:bold;font-size:1.2em;\">7.\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u30d1\u30c3\u30b1\u30fc\u30b8\u5316(dmg\u4f5c\u6210)<\/span><br \/>\n\u30bf\u30fc\u30df\u30ca\u30eb\u3088\u308a\u3001\u30ea\u30ea\u30fc\u30b9\u30d3\u30eb\u30c9\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u6240\u307e\u3067\u79fb\u52d5\u3057\u3001\u4ee5\u4e0b\u3001adt\u30b3\u30de\u30f3\u30c9\u5b9f\u884c<br \/>\n<div style=\"margin-bottom:20px;\"><\/div>\n<pre class=\"lang:default decode:true \" title=\"\">\n  adt -package -target native NativeProcessTest.dmg NativeProcessTest.air\n<\/pre>\n<div style=\"margin-bottom:40px;\"><\/div>\n<br \/>\nNativeProcess.mxml\u300022\u30fb23\u884c\u76ee\u3042\u305f\u308a<br \/>\n<pre class=\"lang:default decode:true \" title=\"NativeProcess.mxml\">\n\/\/\u7b2c1\u5f15\u6570\nargs.push(\"\/Users\/test\/Pictures\/hoge\"); \/\/\u5727\u7e2e\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u9054\n\/\/\u7b2c2\u5f15\u6570\nargs.push(\"\/Users\/test\/Desktop\/hoge.zip\"); \/\/ \u5727\u7e2e\u5f8c\u306e\u30d5\u30a1\u30a4\u30eb\u540d\n<\/pre>\n<div style=\"margin-bottom:20px;\"><\/div>\n\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3067\u30ed\u30fc\u30ab\u30eb\u306e\u30d1\u30b9\u3092\u3068\u308b\u3068\u3092\u5727\u7e2e\u30bd\u30d5\u30c8\u304c\u3067\u304d\u305d\u3046\u306a\u611f\u3058\u3067\u3059\uff01<br \/>\n<br \/>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u77e2\u91ce\u3067\u3059\u3002 AIR2.0\u304b\u3089\u30ed\u30fc\u30ab\u30eb\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b\u3063\u3066 &hellip; <a href=\"https:\/\/www.key-p.com\/blog\/staff\/archives\/272\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,10],"tags":[],"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/272"}],"collection":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/comments?post=272"}],"version-history":[{"count":19,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/272\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/posts\/272\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/media?parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/categories?post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.key-p.com\/blog\/staff\/wp-json\/wp\/v2\/tags?post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}