「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfrastructure.osscons.jp]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。

-[[戻る>Androidのデバッグ]]

*目次 [#b03509d4]
#contents

*概要 [#ad776c9b]
-最も人気のあるAndroidエミュレータ
-Google Playも使用可能。
-開発にも利用できるが、
--デプロイに時間がかかりすぎて利用断念。
--あと、VSからデバック実行ができないらしい。

*プロキシ系 [#cefbdd8a]
Proxycapで対応可能。

**プロキシ環境 [#sc8c8747]
プロキシ環境では、Proxycapが必要になる。

-【Windows編】Proxycapを入れて設定すれば、~
ProxyありネットワークでもBlueStacksを使える - いろいろやってみるにっき~
http://shigeo-t.hatenablog.com/entry/2014/07/01/105947

-「HD-Network.exe」とあるが、Bluestacks 3 では、以下であるもよう。
--HD-Agent.exe(ProgramFiles (x86) 以下)
--HD-Player.exe(ProgramFiles (x86) 以下)
--Bluestacks.exe(ProgramData 以下)

**[[HTTP Debug Proxy>#r0063abf]] [#j5a0e2ce]

*画面サイズ [#v2ad061d]
**環境設定 [#wd569adb]
環境設定だと、アスペクト比が固定である模様。

-BlueStacks で画面サイズや解像度を変更する方法 | Lonely Mobiler~
https://loumo.jp/wp/archive/20171105120058/

**レジストリ [#lcffbf8b]
レジストリ設定を行えば、画面のアスペクト比を変更可能な模様(未検証)。

-Appmethod 無償版~
http://ht-deko.com/AppMethod/freeplan/bluestacks.html
-BlueStacksの画面サイズを変更する方法。:PCdeAndroidGame~
http://pcdeandroid.blog.fc2.com/blog-entry-36.html

*キャプチャ [#r4d6e8b0]
**HTTP Debug Proxy [#r0063abf]
-HTTP Debug Proxy(Fiddler)を使用する場合も、Proxycapを使用すれば良い。

-Fiddlerのエンドポイントは以下の通り。
--IPアドレス : 127.0.0.1
--ポート番号 : 8888

-なお、全EXEを対象とすると、通信がループするので、EXEの対象を明示する必要がある。
>[[上記>#sc8c8747]]のEXEを指定することでシステム通信はキャプチャできたが、~
各APK(Android application package)の通信のキャプチャが上手く行っていない...。

-参考
--fiddler - How can I monitor HTTP traffic from BlueStacks? - Stack Overflow~
https://stackoverflow.com/questions/20347664/how-can-i-monitor-http-traffic-from-bluestacks
---Step-by-Step: Using BlueStacks AppPlayer From Behind a Proxy~
http://www.proxycap.com/bluestacks.html

**LAN Analyzer [#n40c849d]
[[HTTP Debug Proxy>#r0063abf]]でのキャプチャが上手く行かない場合、~
LAN Analyzer - Wireshark の [Follow TCP/IP Stream]でHTTPを確認できる(HTTPSは不可)。

*Visual Studio [#o65ef424]
Visual StudioがDebug時に使用するエミュレータとしても使用できる模様。
-以下は、Xamarinプロジェクトから実行した例。
-なお、Cordovaプロジェクトからも同様に~
Google Androidエミュレータとして実行可能だった。

**Bluestacksの起動 [#f717484a]
-Bluestacksを起動する。
-adb devicesコマンドを実行し、以下のように、~
-[[adb devicesコマンド>Androidのデバッグ#sca44553]]を実行し、以下のように、~
emulator-5554(=Bluestacks)が表示されることを確認する。
 C:\Users\xxxx\AppData\Local\Android\sdk\platform-tools>adb devices
 List of devices attached
 C:\Users\xxxx\AppData\Local\Android\sdk\platform-tools>adb devices
 List of devices attached
 emulator-5554   device

**ビルド出力 [#ga39c4d8]
emulator-5554にデプロイされる(以下はビルド出力)。

 1>------ ビルド開始: プロジェクト:OtrCdvTpl, 構成:Debug Android ------
 1>  ------ ソース パッケージ ディレクトリからパッケージが正しくグローバルにインストールされていることを確認しています: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac
 1>  ------ ソースの package.json の名前: vs-tac
 1>  ------ ソースの package.json のバージョン: 1.0.42
 1>  ------ パッケージは既に正しいバージョンでグローバルにインストールされています。
 1>  ------ Cordova ツール 6.1.1 は既にインストールされています。
 1>  ------ Build Settings:
 1>  ------ Build Settings:
 1>  ------    platformConfigurationBldDir: C:\・・・\bld\Android\Debug
 1>  ------    platformConfigurationBinDir: C:\・・・\bin\Android\Debug
 1>  ------    buildCommand: build
 1>  ------    platform: Android
 1>  ------    cordovaPlatform: android
 1>  ------    configuration: Debug
 1>  ------    cordovaConfiguration: Debug
 1>  ------    projectName: OtrCdvTpl
 1>  ------    projectSourceDir: C:\・・・
 1>  ------    npmInstallDir: C:\Users\xxx\AppData\Roaming\npm
 1>  ------    buildTarget: AndroidEmulator
 1>  ------    language: ja-JP
 1>  ------ プラットフォーム android は既に存在しています
 1>  ------ ネイティブ ファイルを C:\・・・\res\native\android から platforms\android にコピーしています
 1>  ------ C:\・・・\res\native\android\ant.properties を platforms\android\ant.properties にコピーしました
 1>  ------ platforms\android へのネイティブ ファイルのコピーが完了しました
 1>  ------ プラグインを更新しています
 1>  ------ 現在インストールされているプラグイン: cordova-plugin-customurlscheme@4.3.0,cordova-plugin-inappbrowser@1.7.1,cordova-plugin-whitelist@1.3.2
 1>  ------ 現在インストールされている依存プラグイン:
 1>  ------ 現在構成されているプラグイン:
 1>  ------ 準備中のプラットフォーム: android
 1>  Executing "before_prepare"  hook for all plugins.
 1>  Executing "before_build"  hook for all plugins.
 1>  Searching PlatformJson files for differences between project vs. platform installed plugins
 1>  No differences found between project and android platform. Continuing...
 1>  Generating config.xml from defaults for platform "android"
 1>  Found "merges" for android platform. Copying over existing "www" files.
 1>  Wrote out Android application name to "OtrCdvTpl"
 1>  Wrote out Android package name to "io.cordova.myappc103c4"
 1>  Deleted C:\・・・\platforms\android\res\drawable-hdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-hdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-ldpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-mdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-xhdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-ldpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-mdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-hdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-ldpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-mdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-xhdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-xhdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-xxhdpi\icon.png
 1>  copying image from C:\・・・\res\icons\android\icon-36-ldpi.png to C:\・・・\platforms\android\res\drawable-ldpi\icon.png
 1>  copying image from C:\・・・\res\icons\android\icon-48-mdpi.png to C:\・・・\platforms\android\res\drawable-mdpi\icon.png
 1>  copying image from C:\・・・\res\icons\android\icon-72-hdpi.png to C:\・・・\platforms\android\res\drawable-hdpi\icon.png
 1>  copying image from C:\・・・\res\icons\android\icon-96-xhdpi.png to C:\・・・\platforms\android\res\drawable-xhdpi\icon.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-hdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-hdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-ldpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-mdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-land-xhdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-ldpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-mdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-hdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-ldpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-mdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-port-xhdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-xhdpi\screen.png
 1>  Deleted C:\・・・\platforms\android\res\drawable-xxhdpi\screen.png
 1>  splash screens: ・・・
 1>  copying image from C:\・・・\res\screens\android\screen-hdpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-hdpi\screen.png
 1>  copying image from C:\・・・\res\screens\android\screen-ldpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-ldpi\screen.png
 1>  copying image from C:\・・・\res\screens\android\screen-mdpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-mdpi\screen.png
 1>  copying image from C:\・・・\res\screens\android\screen-xhdpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-xhdpi\screen.png
 1>  copying image from C:\・・・\res\screens\android\screen-hdpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-hdpi\screen.png
 1>  copying image from C:\・・・\res\screens\android\screen-ldpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-ldpi\screen.png
 1>  copying image from C:\・・・\res\screens\android\screen-mdpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-mdpi\screen.png
 1>  copying image from C:\・・・\res\screens\android\screen-xhdpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-xhdpi\screen.png
 1>  updated project successfully
 1>  Executing "after_prepare"  hook for all plugins.
 1>  ------ C:\・・・\bin\Android\Debug\VSBuildInfo.xml を platforms\android\assets\www\VSBuildInfo.xml にコピーしました
 1>  ------ ビルド中のプラットフォーム: android
 1>  Debug
 1>  ------ ビルドの構成オプション: --debug
 1>  Executing "before_compile"  hook for all plugins.
 1>  ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
 1>  JAVA_HOME=C:\Program Files (x86)\java\jdk1.8.0_131
 1>  Reading build config file: C:\・・・\build.json
 1>  :preBuild UP-TO-DATE
 1>  :preDebugBuild UP-TO-DATE
 1>  :checkDebugManifest
 1>  :CordovaLib:preBuild UP-TO-DATE
 1>  :CordovaLib:preDebugBuild UP-TO-DATE
 1>  :CordovaLib:compileDebugNdk UP-TO-DATE
 1>  :CordovaLib:compileLint
 1>  :CordovaLib:copyDebugLint UP-TO-DATE
 1>  :CordovaLib:mergeDebugProguardFiles UP-TO-DATE
 1>  :CordovaLib:packageDebugRenderscript UP-TO-DATE
 1>  :CordovaLib:checkDebugManifest
 1>  :CordovaLib:prepareDebugDependencies
 1>  :CordovaLib:compileDebugRenderscript UP-TO-DATE
 1>  :CordovaLib:generateDebugResValues UP-TO-DATE
 1>  :CordovaLib:generateDebugResources UP-TO-DATE
 1>  :CordovaLib:packageDebugResources UP-TO-DATE
 1>  :CordovaLib:compileDebugAidl UP-TO-DATE
 1>  :CordovaLib:generateDebugBuildConfig UP-TO-DATE
 1>  :CordovaLib:generateDebugAssets UP-TO-DATE
 1>  :CordovaLib:mergeDebugAssets UP-TO-DATE
 1>  :CordovaLib:processDebugManifest UP-TO-DATE
 1>  :CordovaLib:processDebugResources UP-TO-DATE
 1>  :CordovaLib:generateDebugSources UP-TO-DATE
 1>  :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
 1>  :CordovaLib:processDebugJavaRes UP-TO-DATE
 1>  :CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
 1>  :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
 1>  :CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
 1>  :CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
 1>  :CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
 1>  :CordovaLib:bundleDebug UP-TO-DATE
 1>  :prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
 1>  :prepareDebugDependencies
 1>  :compileDebugAidl UP-TO-DATE
 1>  :compileDebugRenderscript UP-TO-DATE
 1>  :generateDebugBuildConfig UP-TO-DATE
 1>  :generateDebugAssets UP-TO-DATE
 1>  :mergeDebugAssets UP-TO-DATE
 1>  :generateDebugResValues UP-TO-DATE
 1>  :generateDebugResources UP-TO-DATE
 1>  :mergeDebugResources UP-TO-DATE
 1>  :processDebugManifest UP-TO-DATE
 1>  :processDebugResources UP-TO-DATE
 1>  :generateDebugSources UP-TO-DATE
 1>  :compileDebugJavaWithJavac UP-TO-DATE
 1>  :compileDebugNdk UP-TO-DATE
 1>  :compileDebugSources UP-TO-DATE
 1>  :transformClassesWithDexForDebug UP-TO-DATE
 1>  :mergeDebugJniLibFolders UP-TO-DATE
 1>  :transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
 1>  :processDebugJavaRes UP-TO-DATE
 1>  :transformResourcesWithMergeJavaResForDebug UP-TO-DATE
 1>  :validateDebugSigning
 1>  :packageDebug UP-TO-DATE
 1>  :zipalignDebug UP-TO-DATE
 1>  :assembleDebug UP-TO-DATE
 1>  :cdvBuildDebug UP-TO-DATE
 1>
 1>  BUILD SUCCESSFUL
 1>
 1>  Total time: 22.144 secs
 1>  Built the following apk(s):
 1>  	C:/・・・/platforms/android/build/outputs/apk/android-debug.apk
 1>  Executing "after_compile"  hook for all plugins.
 1>  Executing "after_build"  hook for all plugins.
 1>  ------ プロジェクトにコピーしています: Android
 1>  ------ platforms\android\build\outputs\apk\android-debug-unaligned.apk を C:\・・・\bin\Android\Debug\android-debug-unaligned.apk にコピーしました
 1>  ------ platforms\android\build\outputs\apk\android-debug.apk を C:\・・・\bin\Android\Debug\android-debug.apk にコピーしました
 1>  ------ コンパイル済みのファイルのコピーが完了しました: Android
 2>------ 配置開始: プロジェクト:OtrCdvTpl, 構成:Debug Android ------
 2>Starting launch process ・・・
 2>  ------ Cordova ・・・€・Executing "before_run"  hook for all plugins.
 2>  Executing "before_prepare"  hook for all plugins.
 2>  Searching PlatformJson files for differences between project vs. platform installed plugins
 2>  No differences found between project and android platform. Continuing...
 2>  Generating config.xml from defaults for platform "android"
 2>  Found "merges" for android platform. Copying over existing "www" files.
 2>  Wrote out Android application name to "OtrCdvTpl"
 2>  Wrote out Android package name to "io.cordova.myappc103c4"
 2>  Deleted C:\・・・\platforms\android\res\drawable-hdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-hdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-ldpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-mdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-xhdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-ldpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-mdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-hdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-ldpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-mdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-xhdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-xhdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-xxhdpi\icon.png
 2>  copying image from C:\・・・\res\icons\android\icon-36-ldpi.png to C:\・・・\platforms\android\res\drawable-ldpi\icon.png
 2>  copying image from C:\・・・\res\icons\android\icon-48-mdpi.png to C:\・・・\platforms\android\res\drawable-mdpi\icon.png
 2>  copying image from C:\・・・\res\icons\android\icon-72-hdpi.png to C:\・・・\platforms\android\res\drawable-hdpi\icon.png
 2>  copying image from C:\・・・\res\icons\android\icon-96-xhdpi.png to C:\・・・\platforms\android\res\drawable-xhdpi\icon.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-hdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-hdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-ldpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-mdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-land-xhdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-ldpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-mdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-hdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-ldpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-mdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-port-xhdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-xhdpi\screen.png
 2>  Deleted C:\・・・\platforms\android\res\drawable-xxhdpi\screen.png
 2>  splash screens: ・・・
 2>  copying image from C:\・・・\res\screens\android\screen-hdpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-hdpi\screen.png
 2>  copying image from C:\・・・\res\screens\android\screen-ldpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-ldpi\screen.png
 2>  copying image from C:\・・・\res\screens\android\screen-mdpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-mdpi\screen.png
 2>  copying image from C:\・・・\res\screens\android\screen-xhdpi-landscape.png to C:\・・・\platforms\android\res\drawable-land-xhdpi\screen.png
 2>  copying image from C:\・・・\res\screens\android\screen-hdpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-hdpi\screen.png
 2>  copying image from C:\・・・\res\screens\android\screen-ldpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-ldpi\screen.png
 2>  copying image from C:\・・・\res\screens\android\screen-mdpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-mdpi\screen.png
 2>  copying image from C:\・・・\res\screens\android\screen-xhdpi-portrait.png to C:\・・・\platforms\android\res\drawable-port-xhdpi\screen.png
 2>  updated project successfully
 2>  Executing "after_prepare"  hook for all plugins.
 2>  ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
 2>  JAVA_HOME=C:\Program Files (x86)\java\jdk1.8.0_131
 2>  Running command "cat /proc/cpuinfo" on emulator-5554...
 2>  Reading build config file: C:\・・・\build.json
 2>  Skipping build...
 2>  Built the following apk(s): 
 2>  	C:/・・・/platforms/android/build/outputs/apk/android-debug.apk
 2>  Running command "ps" on emulator-5554...
 ・・・ここが非常に遅い・・・
 2>  .Running command "ps" on emulator-5554...
 2>  Using apk: C:/・・・/platforms/android/build/outputs/apk/android-debug.apk
 2>  Installing app on emulator...
 2>  Installing apk C:/・・・/platforms/android/build/outputs/apk/android-debug.apk on emulator-5554...
 2>  INSTALL SUCCESS
 2>  Unlocking screen...
 2>  Running command "input keyevent 82" on emulator-5554...
 2>  Starting application "io.cordova.myappc103c4/.MainActivity" on emulator-5554...
 2>  Running command "am start -W -a android.intent.action.MAIN -nio.cordova.myappc103c4/.MainActivity" on emulator-5554...
 2>  LAUNCH SUCCESS
 2>  Executing "after_run"  hook for all plugins.
 2>  
 ========== ビルド: 1 正常終了、0 失敗、0 更新不要、0 スキップ ==========
 ========== 配置: 1 正常終了、0 失敗、0 スキップ ==========

**参考 [#j6f2474e]
-Xamarin から BlueStacks を使って実行する | Moonmile Solutions Blog~
http://www.moonmile.net/blog/archives/5446
-Run Visual Studio 2015 solution of Android App on BlueStacks App Player - YouTube~
https://www.youtube.com/watch?v=SzNCUvNjc5o
--Android-er: Run Visual Studio 2015 solution of Xamarin-Android App on BlueStacks App Player~
http://android-er.blogspot.jp/2015/09/run-visual-studio-2015-solution-of.html

*参考 [#k638308a]
-BlueStacks 3 – 最新かつ最も優れたアンドロイド用エミュレータ~
https://www.bluestacks.com/ja/bluestacksgaming-platform-bgp-android-emulator.html
-ProxyCap - Proxifier and SSH Tunneler for Windows/Mac OS X~
http://www.proxycap.com

**アンインストール [#h06a4357]
-【BlueStacks2】Android アプリのアンインストール &~
Google アカウントの削除をする方法 - りんごびと~
http://www.ringo-bito.com/entry/bluestacks-Apps-uninstallation
-BlueStacks(ブルースタックス)を完全にアンインストールする方法。~
http://androidlover.net/android-emulator/bluestacks/uninstall-bluestacks.html

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS