オブジェクトファイルのシンボルテーブルをダンプする
ipaファイルのチェック
展開
ipaファイルはzip形式で圧縮されている。拡張子をzipに変更するかuzipコマンドで直接展開することで中身を参照することができる。
例
|
1 |
$ unzip MyApp.ipa |
チェック
展開したPayloadの中をotoolでチェックする
|
1 |
$ cd Payload |
|
1 2 3 4 5 6 7 8 9 |
$ otool -hv MyApp.app/MyApp MyApp.app/MyApp (architecture armv7): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC ARM V7 0x00 EXECUTE 76 7180 NOUNDEFS DYLDLINK TWOLEVEL BINDS_TO_WEAK PIE MyApp.app/MyApp (architecture arm64): Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 ARM64 ALL 0x00 EXECUTE 76 7904 NOUNDEFS DYLDLINK TWOLEVEL BINDS_TO_WEAK PIE |
[git] コミットログを検索する
1. コミットメッセージから検索する
|
1 |
git log --grep <word> |
実行例
|
1 |
$ git log --grep "#1234" |
実行例 : 全ブランチ
|
1 |
$ git log --all --grep "GPIO" |
実行例 : 大小文字区別なし
|
1 |
$ git log -i --grep "code" |
実行例 : 正規表現
|
1 |
$ git log -E --grep "c..e" |
2. 修正差分(追加/削除行)で検索する
|
1 |
$ git log -S"ErrorLog" |
4. オーサー(オリジナルの作成者)で検索する
|
1 |
git log --author <username> |
※ 部分一致可
※ author : 元々の編集作業を行ったユーザー。cherry-pick や rebaseの元(オリジナル)となるコミットを作ったユーザー。
4. コミッター(最終更新者)で検索する
|
1 |
git log --committer <username> |
※ 部分一致可
※ committer : コミットを作ったユーザー。編集作業をコミットとして反映したユーザー。
5. 例
git commitでコミットを作ったときは author = committer となる。git commit --amendでコミットを作った(書き換えた)ときは author はそのまま。 committer は書き換えられる。git cherry-pickやgit rebaseでコミットを作ったときは author は元のコミットを踏襲する。 committer は書き換えられる。
tig warning: “status-untracked-dirs”
症状
tigにおいて以下の警告(warning)が表示される。
|
1 2 |
tig warning: /usr/local/etc/tigrc:90: status-untracked-dirs has been renamed to status-show-untracked-dirs tig warning: Errors while loading /usr/local/etc/tigrc. |
Provisioning Profileの最新版へのアップデート
ipaファイルを作成する準備として Provisioning Profileを最新版へアップデートする方法
Xcode => Preferences…
左欄のアカウントを選択
右下の View Details… ボタンを押す
Provisioning Profile の右の [Download]ボタンを押す
Androidブロードキャストアドレス取得
|
1 2 3 4 5 6 7 8 9 10 11 12 |
InetAddress getBroadcastAddress() throws IOException { WifiManager wifi = (WifiManager)this.context.getSystemService(Context.WIFI_SERVICE); DhcpInfo dhcp = wifi.getDhcpInfo(); // handle null somehow int broadcast = (dhcp.ipAddress & dhcp.netmask) | ~dhcp.netmask; byte[] quads = new byte[4]; for (int k = 0; k < 4; k++) quads[k] = (byte) ((broadcast >> k * 8) & 0xFF); return InetAddress.getByAddress(quads); } |
ACPI スリープモード
| S0 | 通常稼働時 |
|---|---|
| S1 | CPUがクロックオフ |
| S2 | CPUに給電中止 |
| S3 | メモリ以外の給電停止。いわゆるスリープ |
| S4 | メモリの内容をHDDに写し電源断。いわゆるハイバネーションや休止状態 |
| S5 | OSをシャットダウンして電源断 |
- ACPI
- Advanced Configuration and Power Interface
1997年 インテル、東芝、マイクロソフト
[git] コミット範囲の指定方法
コミット範囲を指定してコミットログを出力する例
|
1 |
$ git log 69bac23..87ded2d |
注意
コミット 69bac23 は、範囲に含まれ『ない』
実機ビルドで “Could not locate device support files.” エラー
SwiftのSingletonパターン
宣言コード
|
1 2 3 4 |
class SomeSingletonClass: NSObject { private init() { 省略 } static let sharedInstance = SomeSingletonClass() } |
参照コード
|
1 |
var someSingletonInstance : SomeSingletonClass = SomeSingletonClass.sharedInstance |
- イニシャライザをprivate修飾してクラスの外部から参照できないようにする。
structを使うのは古いコーディングスタイル。代わりにstatic let構文を使う。static func getSharedInstance()メソッドを使うのは、さらに古いコーディングスタイル。
