IOS関連
4030 ワード
1.コマンドラインのファイルの表示/非表示
defaults write com.apple.finder AppleShowAllFiles -bool true defaults write com.apple.finder AppleShowAllFiles -bool false
2.buglyシンボルテーブルの構成 dSYMファイルを取得し、プロジェクトを棚に上げてパッケージングするとき、archiveのファイル、「Finderを使用してパス~/Library/Developer/Xcode/Archives/、日付ディレクトリが見えます.ディレクトリの下にxcarchiveという接尾辞のファイルがあります.このファイルを選択し、右クリックメニューで「パッケージ内容を表示」を選択します.を参照してください.ディレクトリ内のXXX.app.dsYMファイルをコピーしたdsYMsディレクトリが表示されます.後で分析して使用します.XCode構成が設定されていないため生成されます.Build Settings---->Debug information format----DWARF with dSYM Fileを選択すると、パッケージ化時にdsYMファイル が生成されます. command+Bプロジェクトは、xxx.appが存在するファイルディレクトリを開き、dsymファイルをそのディレクトリの下 にコピーする.端末java-jar/Users/wmh/bin/buglySymboliOS.jar-i/Users/wmh/desktop/dsym/GS_を開くMobile.app.dSYM-o fuhaobiao.zip java-jar【このブロックはjavaパッケージパスです】-i【dSYMファイルパス】-o【生成されたファイル名】 シンボルテーブルファイル をアップロードする
3.gitの無視ファイル
Xcode
gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
Build generated
build/DerivedData/
Various settings
*.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata/
Other
*.moved-aside *.xcuserstate
Obj-C/Swift specific
*.hmap *.ipa *.dSYM.zip *.dSYM
CocoaPods
We recommend against adding the Pods directory to your .gitignore. However
you should judge for yourself, the pros and cons are mentioned at:
https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
Pods/
Carthage
Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts
Carthage/Build
fastlane
It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
screenshots whenever they are needed.
For more information about the recommended setup visit:
https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output
Code Injection
After new code Injection tools there's a generated folder/iOSInjectionProject
https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
4.pchファイルの作成 otherでpctファイル を選択 BuildSetting-->PrecompilePrefixHeader-->YES BuildSetting-->PrefixHeader-->$(SRCROOT)/AAAAAA/BBBBBB.pch
5.新しいpodインポートコマンドライン
pod update --verbose --no-repo-update
6.KVOの実現原理
KVOはruntimeメカニズムに基づいて実現される
プログラムが実行されると、システムは動的にpのサブクラスを作成します.このとき、pのisaポインタを印刷することができます.このときisaポインタは新しく作成したサブクラスを指しています.そのサブクラスでは属性ageのsetメソッドを書き換えています.このsetメソッドでは、まず親クラスのsetAgeメソッドを呼び出し、
7.通知センターに時間のかかる操作を実行させる方法
通知がプライマリ・スレッドで送信された場合、実行方法もプライマリ・スレッドであり、時間のかかる操作を実行することはできません.通知がサブスレッドで送信された場合、実行方法もサブスレッドにあり、時間のかかる操作を実行できます.
8.IOS 10権限
NSPhoto LibraryUsageDescription Appにアクセスするには、アルバムNSCameraUsageDescription Appにアクセスするには、カメラNSMicrophoneUsageDescription Appにアクセスするには、マイクNSLocationUsageDescription Appにアクセスするには、位置NSLocationWhenInUseUsageDescription Appにアクセスするには、あなたの同意が必要です.使用中にアクセス先N s L o c a t ionAlwaysUsageDescription Appに同意する必要があります.常にアクセス先N s C a l e ndarsUsageDescription Appに同意する必要があります.カレンダーにアクセスするには、NSRemindersUsageDescription Appに同意する必要があります.注意事項NSMotionUsageDescription Appにアクセスするには同意が必要です.スポーツとフィットネスにアクセスできるN s H a l thUpdateUsageDescription Appにアクセスするには同意が必要です.S S S H a l thShareUsageDescription Appにアクセスするには同意が必要です.S N s B u t o o t h P e r i p h P e r alUsageDescription Appにアクセスするには同意が必要です.Bluetooth NSAppleMusicUsageDescription Appにアクセスするには同意が必要です.メディアリポジトリにアクセスするには同意が必要です.
defaults write com.apple.finder AppleShowAllFiles -bool true defaults write com.apple.finder AppleShowAllFiles -bool false
2.buglyシンボルテーブルの構成
3.gitの無視ファイル
Xcode
gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
Build generated
build/DerivedData/
Various settings
*.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata/
Other
*.moved-aside *.xcuserstate
Obj-C/Swift specific
*.hmap *.ipa *.dSYM.zip *.dSYM
CocoaPods
We recommend against adding the Pods directory to your .gitignore. However
you should judge for yourself, the pros and cons are mentioned at:
https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
Pods/
Carthage
Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts
Carthage/Build
fastlane
It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
screenshots whenever they are needed.
For more information about the recommended setup visit:
https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
fastlane/report.xml fastlane/Preview.html fastlane/screenshots fastlane/test_output
Code Injection
After new code Injection tools there's a generated folder/iOSInjectionProject
https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
4.pchファイルの作成
5.新しいpodインポートコマンドライン
pod update --verbose --no-repo-update
6.KVOの実現原理
KVOはruntimeメカニズムに基づいて実現される
[p addObserver:self forKeyPath:@"age" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:nil];
プログラムが実行されると、システムは動的にpのサブクラスを作成します.このとき、pのisaポインタを印刷することができます.このときisaポインタは新しく作成したサブクラスを指しています.そのサブクラスでは属性ageのsetメソッドを書き換えています.このsetメソッドでは、まず親クラスのsetAgeメソッドを呼び出し、
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
というメソッドを呼び出すように通知します.7.通知センターに時間のかかる操作を実行させる方法
通知がプライマリ・スレッドで送信された場合、実行方法もプライマリ・スレッドであり、時間のかかる操作を実行することはできません.通知がサブスレッドで送信された場合、実行方法もサブスレッドにあり、時間のかかる操作を実行できます.
8.IOS 10権限
NSPhoto LibraryUsageDescription Appにアクセスするには、アルバムNSCameraUsageDescription Appにアクセスするには、カメラNSMicrophoneUsageDescription Appにアクセスするには、マイクNSLocationUsageDescription Appにアクセスするには、位置NSLocationWhenInUseUsageDescription Appにアクセスするには、あなたの同意が必要です.使用中にアクセス先N s L o c a t ionAlwaysUsageDescription Appに同意する必要があります.常にアクセス先N s C a l e ndarsUsageDescription Appに同意する必要があります.カレンダーにアクセスするには、NSRemindersUsageDescription Appに同意する必要があります.注意事項NSMotionUsageDescription Appにアクセスするには同意が必要です.スポーツとフィットネスにアクセスできるN s H a l thUpdateUsageDescription Appにアクセスするには同意が必要です.S S S H a l thShareUsageDescription Appにアクセスするには同意が必要です.S N s B u t o o t h P e r i p h P e r alUsageDescription Appにアクセスするには同意が必要です.Bluetooth NSAppleMusicUsageDescription Appにアクセスするには同意が必要です.メディアリポジトリにアクセスするには同意が必要です.