2012年11月24日土曜日

Android SDK のインストール

引き続き、サブの ノートPC で生活中です。

Android 端末とやり取りするために、 Android SDK をインストールしよかと思ったのだが
その再の手順がややこしかったのと

 java をアップデートしたら再度変更しなくちゃいけないので

手順をメモっておきます。

参考にしたのは下記ページ
まず java をインストールするとあるが、既にインストール済みなので
java.exe のパスだけ確認→おk。


次に、  Android SDK 本体をここからダウンロード
参考ページに「zip 版を落せ」とあるし、何より 「Download the SDK」から 64bit 版が落とせない(※)ので zip 版をダウンロード。

承認画面64bit 選択と、ダウンロードボタン灰色ま…(゜ω゜)ハァ?

Android SDK の zip を解凍し、出てきた android-sdk-windows 以下にある
SDK Manager.exe を起動…

…一瞬 DOS 窓が開くが何も起きず。

なので、コマンドプロンプトから tool にある android.bat を直接起動。
下記エラーが出た。


'C:\Windows\system32\java.exe' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。
無効なパスの指定です
ERROR: SWT folder '' does not exist.
Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
参考ページの内容とは違うが…orz
まあ java.exe が見付かってないことには間違いなさそうなので
tools\lib\find_java.bat の内容を変更
*** tools/lib/find_java.bat.org 2012-11-24 18:59:59.673352500 +0900
--- tools/lib/find_java.bat 2012-11-24 18:59:01.113271700 +0900
***************
*** 23,35 ****

rem Check we have a valid Java.exe in the path. The return code will
rem be 0 if the command worked or 1 if the exec failed (program not found).
! for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
if not defined java_exe goto :CheckFailed

:SearchJavaW
rem Check if we can find a javaw.exe at the same location than java.exe.
rem If that doesn't work, just fall back on the java.exe we just found.
! for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF

--- 23,37 ----

rem Check we have a valid Java.exe in the path. The return code will
rem be 0 if the command worked or 1 if the exec failed (program not found).
! rem for /f %%a in ('%~dps0\find_java.exe -s') do set java_exe=%%a
! set java_exe="C:\Program Files\Java\jdk1.7.0_05\bin\java.exe"
if not defined java_exe goto :CheckFailed

:SearchJavaW
rem Check if we can find a javaw.exe at the same location than java.exe.
rem If that doesn't work, just fall back on the java.exe we just found.
! rem for /f %%a in ('%~dps0\find_java.exe -s -w') do set javaw_exe=%%a
! set javaw_exe="C:\Program Files\Java\jdk1.7.0_05\bin\javaw.exe"
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF
…で、無事起動。

java のバージョンが変わると find_java.bat で直接記述したパスが変更されるので
起動しなくなったらここをチェック!!


EXCEL での正規表現置換

エクセルで、"No" の後の数字を一括で A1 セルで指定した内容に置換したくて REGEXREPLACE(B10,"(No)[0-9]+","$1"&A1) と書いたらエラーになった。なんで?  "...