appiumの環境構築

Posted on 2017年11月16日(木) in appium • Tagged with android, ios, appium

Unitynのアプリの自動操作はC#のスクリプトを書いていたが、appiumを試してみる.

個人での開発においては自動テストによる信頼性の担保がなければ規模の大きいゲームは作れないと確信したので...

クライアントはpythonを想定.

  1. python-clientをインストールする

    pip install Appium-Python-Client
    // だめだった場合は以下
    sudo -H pip3 install Appium-Python-Client
    
  2. node.jsのインストール. nodeはこれでしか現状使わないので公式から落とす

  3. appiumのインストール

    npm install -g appium
    

Androidで使う場合は以下も忘れずに.

  1. Android-SDKのインストール
  2. ANDROID_HOMEを設定する.

Continue reading

Very Simple Ads Monetization & Mediationに細かな修正を加える

Posted on 2017年10月19日(木) in unity • Tagged with Unity, Android, iOS, admob, adcolony

動画広告を表示するのにVery Simple AdsというAssetを購入し、使用している.

https://www.assetstore.unity3d.com/jp/#!/content/57517

基本的にこれを入れてやればいいが、以下の2点の対応のために修正を加えた.

  1. adcolonyの動画広告視聴前後に、ダイアログが表示される
  2. admobの動画広告視聴完了時に、エラーが頻発する

ので、以下の対応を行った。

  1. AAAdcolonyの200行目くらいの箇所を以下のように修正する
AdColony.AdOptions adOptions = new AdColony.AdOptions ();
// 以下2つをfalseに変更
adOptions.ShowPrePopup = false;
adOptions.ShowPostPopup = false;
  1. Admobのエラー回避

https://github.com/googleads/googleads-mobile-unity/issues/509

↑のissueと同様に、OnAdRewardが呼ばれた直後にOnAdCloseが呼ばれていた.

そのため、OnAdRewardが呼ばれたらflagを立てて、OnAdCloseが呼ばれても大丈夫なように対応した.


Continue reading

msgpack-cliでcustom serializationをする

Posted on 2017年09月13日(水) in unity • Tagged with Unity, Android, iOS, msgpack

何かEnumをSerializeするときにErrorが起きたので以下のように対応した.

これが正しい対応かどうかはかなり怪しいが一旦はこれで対応していく.

以下を参照し、作成した.

https://github.com/msgpack/msgpack-cli/wiki/Custom-serialization

  1. CustomSerializationを作る
public class TargetTypeSerializer : MessagePackSerializer<TargetType>
{

    protected TargetTypeSerializer (SerializationContext ownerContext) : base (ownerContext)
    {
    }

    #region implemented abstract members of MessagePackSerializer

    protected override void PackToCore (MsgPack.Packer packer, TargetType objectTree)
    {
        packer.Pack ((int)objectTree);
    }

    protected override TargetType UnpackFromCore (MsgPack.Unpacker unpacker)
    {
        var ...

Continue reading

Unity Cloud BuildでFirebaseSDKを組み込んだアプリをビルドする

Posted on 2017年08月07日(月) in unity • Tagged with Unity, Android, iOS

FirebaseのiOS版はcocoapodsを使用して各Framework等をインストールしている.

ただ残念なことにUnity Cloud Buildはcocoapodsに対応していない(マジかよ...

なので、自分で依存FrameworkをPlugins/iOS以下に入れる必要がある.

以下のブログを参考にしたが、FirebaseのドキュメントにリンクされているSDKが3.16で、最新版が4.0.4だったので自分で対応することにした.

以下の記事を参考にしながら対応していきました!

http://blog.livedoor.jp/abars/archives/52394874.html

環境

自分の環境は以下

  • Unity5.6.1p3
  • Xcode8.3.3

対応手順

  1. 自分のローカルPCにcocoapodsを入れる

  2. Unity Firebaseを入れたUnity Projectでiosをビルドする

  3. 出力したProjectのPods以下をplugins/iosにコピーする.(自分はPlugins/iOS/FireaseDependenciesにコピーした)

    コピーするのは以下の画像の選択されているもの.

screenshot
  1. 配置したProtobuf以下のファイルのcompile flagsに以下を設定する
-fno-objc-arc -fobjc-exceptions

※ objc-exceptionsに関してはこれで正しいかはよくわかってないです。

  1. google/protobuf以下にあるimportのpathが解決できないみたいのなので以下のようにして置き換えます.

    pathは適宜書き換えて対応してください ...


Continue reading

Anti-Cheat Toolkitを使ってるとREAD_PHONE_STATEが勝手につく

Posted on 2017年08月05日(土) in unity • Tagged with Unity, Android

以下のAssetを使っているとREAD_PHONE_STATEが勝手につく.

https://www.assetstore.unity3d.com/jp/#!/content/10395

設定画面からACTK_PREVENT_READ_PHONE_STATEにチェックを入れるのを忘れないこと.

ただし、使用すると一部機能が使えなくなる.自分はつかってないから切った。


Continue reading

Error: Error while saving blame file, build will continue... というError対応

Posted on 2017年08月04日(金) in articles • Tagged with Unity, Android

Unity5.6.1p3でFirebase-SDKを入れてビルドしようとしたとき以下のようなErrorに遭遇した

Error: Error while saving blame file, build will continue
Error: ???????????????"uses-sdk"????????????????????????????????????"tools:overrideLibrary"????????????"tools"???????????????????????????????????????

Console上でも文字化けされていたので、貼り付けミスということではない

解決は以下のURLにある通り、mainのmanifestにxmlns:tools="http://schemas.android.com/tools"を追加した.

https://groups.google.com/forum/#!topic/android-group-japan/o5LeY0nIGjc


Continue reading

Cordovaでandroidにアプリをinstallする

Posted on 2014年05月24日(土) in articles • Tagged with chrome, android, cordova

環境設定

手順はhttps://github.com/MobileChromeApps/mobile-chrome-apps/blob/master/README.mdにある。

  • androidSDKをインストールする。
  • .bash_profileにsdk/toolsとsdk/platform-toolsにpathを通す
  • brew install antでantを入れる。入らなかったらbrew updateしてから再度行う
  • npm install -g cca
  • cca checkenvで怒られないことを確認

Projectの作成

以下のコマンドを実行する

cca create APP_NAME

実行

作成したプロジェクトディレクトリで以下を実行

cca run android

これでアプリがdeviceにインストールされる。

プロジェクトの構造

以下のような形になっている。

.
├── config.xml
├── hooks ...

Continue reading