2016年9月15日木曜日

El Capitanアップグレード方法

El Capitanにアップグレードしてみました。

最新のXcodeがインストールできないためです。

アップグレード方法

アップルストアからインストールできます。

変化したこと


  • 日本語が自動的に変換されてしまう。
  • Genymotion、ヴァーチャルボックスが動かない。
  • セキュリティの設定が変更されている?
  • Soundflowerが動かない

最新バーションをインストールする。
https://github.com/mattingalls/Soundflower/releases
インストール前にアンインストールスクリプトが同伴されているのでスクリプトエディタの実行ボタンを押して使用します。
画面収録時のLadioCastの設定見本

データの引き継ぎ

アプリとファイルは引き継がれてそのまま使用できます。

2016年9月8日木曜日

upload to app storeが非表示

Xcodeのアカウント設定を修正したところ「upload to app store」ボタンが使えなくなってしまいました。
distribution requires enrollment in the apple developer program

開発者プログラムの再認証が必要なようです。
今までは無料で使えていたのですが。。開発者プログラムを更新しないと再認証できない。

GooglePlayGameServiceをXCodeビルドする際のメモ

GooglePlayGameServiceをXCodeビルドする際のメモ

1,cocoapodsのインストール

cd プロジェクト(xcodeprojのあるところ)
sudo gem install cocoapods
pod install
以下ログ
Setting up CocoaPods master repo
CocoaPods 1.1.0.beta.2 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.1.0.beta.2

Setup completed
Analyzing dependencies
Downloading dependencies
Installing GoogleAppUtilities (1.1.1)
Installing GoogleAuthUtilities (2.0.1)
Installing GoogleNetworkingUtilities (1.2.1)
Installing GooglePlayGames (5.1.1)
Installing GooglePlusOpenSource (1.7.1)
Installing GoogleSignIn (4.0.0)
Installing GoogleSymbolUtilities (1.1.1)
Installing GoogleUtilities (1.3.1)
Generating Pods project
Integrating client project
https://developers.google.com/identity/sign-in/ios/start-integrating
[!] Please close any current Xcode sessions and use `Unity-iPhone.xcworkspace` for this project from now on.

以下XCodeの修正

2. XCodeにフレームワーク追加

      AddressBook.framework
      AssetsLibrary.framework
      CoreData.framework
      CoreTelephony.framework
      CoreText.framework
      Security.framework
      libc++.dylib
      libz.dylib
拡張子が変更されています。
dylib >> tbd ios9mod

3. XCodeにフレームワーク追加 other

      GoogleOpenSource.framework
      GoogleSignId.bundle
      GoogleSignId.framework
      gpg.bundle
      gpg.framework
ダウンロードリンク
https://developers.google.com/games/services/downloads/sdks
https://developers.google.com/identity/sign-in/ios/sdk/
https://developers.google.com/+/mobile/ios/upgrading-sdk

4. Other Linker Flags に値を追加

  -ObjC

5、Enable BitcodeをNoにする

6、インポート文の修正

importを以下のようにする
<GoogleSignIn/GIDSignIn.h>
<GoogleSignIn/...>
4か所あります。

以下エラーと修正情報

・Unknown type name '__declspec'
NORETURN 削除 エラー箇所の行頭を削除

GoogleOpenSource.framework/GoogleOpenSource(GTLDateTime.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
・clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build Settings>Build Options>Enable Bitcode =noにする

・Could not launch “app name XXX”
process launch failed: failed to get the task for process -1
Build Settings>Build Options>Provisioning Profileを設定

・Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CocoaPodsを使用しているプロジェクトは”.xcodeproj”でなく”.xcworkspace”から開きます。

・[super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
行を削除
プッシュ通知とバックグラウンドの設定。

プッシュ通知用のプロファイルを作成。

そこからキーチェーンで証明書を右クリックして書き出ししてパスワード付きのp12を作る。開発用と製品用の二つが必要。
作成したp12をグーグル開発コンソールのゲームサービスに登録する。
オブジェクトC用のソースをUnityに貼り付ける。

info.plistの設定

  <key>NSCameraUsageDescription</key>
    <string>マルチプレイに使用します</string>

2016年9月6日火曜日

Xcode7へアップグレード後に幾つかのエラー

Xcode7へアップグレード後に幾つかのエラーが発生。

対処方法まとめ


Unknown type name '__declspec'
NORETURN 削除 エラー箇所の行頭を削除

linker command failed with exit code 1 (use -v to see invocation)
Build Settings>Build Options>Enable Bitcode =noにする

Could not launch “app name XXX”
process launch failed: failed to get the task for process -1
Build Settings>Build Options>Provisioning Profileを設定

2016年9月5日月曜日

GooglePlayGAMEServce iOS向けの設定

GooglePlayGAMEServce iOS向けの設定
iTuneConnect側
GPGS側
アプリIDが必要なため。iOSアプリを登録しないとテストできません。

2016年3月10日木曜日

外部ファイルの読み取り。mp3 ogg

 外部ファイル(プロジェクトのリソース以外のファイル)を読み取りたいのですが、
byte配列からオーディオクリップに変換することはできないようです。
winとmacなら外部ファイル(pngやjpg)からスプライトを作成はできます。
再ビルドせずにファイルの差し替えができるのはテキストと画像だけのです。

2016年3月1日火曜日

Unity外部ファイルの読み取り mac win用

Unityでresourceフォルダ以外の外部ファイルを読み取るサンプルです。
今回はSystem.IO周りで実装しています。
ResourceLoadだと実行ファイル作成後のファイル追加ができません。
WWWクラスだと絶対パスが必要になります。

//exe Appファイルの場所を取得
string stCurrentDir = System.IO.Directory.GetCurrentDirectory();
        Debug.Log (stCurrentDir);

        System.IO.StreamReader cReader = (
            new System.IO.StreamReader(stCurrentDir+@"/ファイル名.csv"System.Text.Encoding.UTF8)
            );
        
        string text = string.Empty;
        while (cReader.Peek() >= 0) {
            string stBuffer = cReader.ReadLine();
            text += stBuffer + System.Environment.NewLine;
        }
        cReader.Close();
        
    
        GameObject go =GameObject.Find ("結果表示するTextオブジェクト");
        go.GetComponent<Text> ().text =text;

画像やテキストの読み取りはできますが音声(MP3やogg)を読み取ることはできないようです。※正確にはaudioclipに変換できない。