1 工程創(chuàng)建和配置
簽名配置問題1
- 由于項目是從uniapp離線打包工程來的,所以有些配置是已經(jīng)存在的白对。創(chuàng)建工程時盆昙,Signing & Capabilities下的Signing報錯:
HBuilder has conflicting provisioning settings.
HBuilder is automatically signed, but provisioning profile a7e03077-46db-4b91-b0c4-20fd613c1e14 has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor, or switch to manual signing in the Signing & Capabilities editor.
或者
HBuilder is automatically signed for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set the code signing identity value to "Apple Development" in the build settings editor, or switch to manual signing in the Signing & Capabilities editor.
處理:
找到工程的xcodeproj文件(比如app-demo-ios. xcodeproj)诊县,右鍵點擊“顯示包內(nèi)容”绊茧,找到project.pbxproj文件,打開并搜索PROVISIONING_PROFILE谦纱,注釋掉或者刪除掉看成,保存并退出。問題即可解決跨嘉。
簽名配置問題2
MAMapKit_3D_Demo has conflicting provisioning settings.
MAMapKit_3D_Demo is automatically signed, but code signing identity iPhone Distribution: AutoNavi Software Co., Ltd. has been manually specified. Set the code signing identity value to "Apple Development" in the build settings editor, or switch to manual signing in the Signing & Capabilities editor.
- 處理:
按照錯誤提示川慌,在Build Settings 中設(shè)置profile(包括Release和Debug)都為"Apple Development" 即可。
簽名配置問題3
(1)下載了某個demo工程祠乃,但是本地跑的時候梦重,報錯:
Unable to log in with account "xxxxx@xx.com".
Sign in to try again.
No profiles for 'com.amap.MAMapKit-3D-Demo.hh' were found
Xcode couldn't find any iOS App Development provisioning profiles matching 'com.amap.MAMapKit-3D-Demo.hh'.
按照上面參考的進(jìn)行處理:將project.pbxproj中的如下4條語句(OC和Swifit各兩套,每套包括debug和release)刪掉:
PROVISIONING_PROFILE_SPECIFIER = "";
- 右上角xcode --> preferences --> accounts
看到該賬號下提示:
Your session has expired. Please log in.
但是重新登錄沒用亮瓷。
(2) 該問題出現(xiàn)的第二種場景為:給已有的工程添加新的手機(jī)設(shè)備進(jìn)行調(diào)試琴拧,但是報錯,錯誤信息基本和第一種場景一樣嘱支。
- 新手機(jī)devices安裝ipa
The operation couldn’t be completed. Unable to log in with account 'xxxxx@xx.com'. The login details for account 'xxxxx@xx.com' were rejected.
Provisioning profile "iOS Team Provisioning Profile: com.app.demo" doesn't include the currently selected device "iPhone (6)" (identifier 89df990fbb855f2xxxxxxxxxxxxxxxx).
參考:
https://blog.csdn.net/aoiz62081/article/details/102110547
https://blog.csdn.net/chenftli/article/details/88593052
http://www.reibang.com/p/c6d752f8fcac該問題未解決蚓胸。
資源文件缺少導(dǎo)致編譯失敗
Unable to install “app-demo-ios”
“app-demo-ios” does not contain a valid Info.plist, so it cannot be installed on hh2的iPhone
(“CFBundleExecutable” is not specified)
Build input file cannot be found: '/Users/hh/Documents/ios-pro/iOSSDK-3.2.16/app-demo-ios/Application/dclogo@3x.png'
- 原因:即上面的dclogo@3x.png文件找不到挣饥,應(yīng)該是遷移過來時,引用復(fù)制了沛膳,但是實際文件復(fù)制到扔枫。
- 處理:直接刪除即可。
添加framework問題
在TARGETS的General下添加framework時锹安,需要注意Embed狀態(tài)短荐。
注意:添加framework時,Embed需要設(shè)置為Do Not Embed狀態(tài)叹哭。在TARGETS的Build Phases下的Link Binary With Libraries添加framework時忍宋,直接添加即可(Embed狀態(tài)默認(rèn)為Do Not Embed)。
2 開發(fā)問題
oc loadView
說明:loadView用來創(chuàng)建UIViewController的风罩,調(diào)用時機(jī)在UIViewController被使用且該VC的view為nil的時候糠排。所以loadView的調(diào)用后,才會調(diào)用viewDidLoad泊交。
ios更新升級跳轉(zhuǎn)appstore
獲取iTunes id
- 處理:代碼中通過如下bundle id獲取對應(yīng)的itunes id:
NSString *urlStr = @"http://itunes.apple.com/lookup?bundleId=com.app.demo";
- 獲取返回的結(jié)果中找到trackId乳讥,即iTunes ID柱查。
trackId = 9990000000;
- 注意:通過iTunes ID獲取到的返回值也是基本一致的廓俭。
NSString *urlStr = @"http://itunes.apple.com/lookup?id= 9990000000";
說明:登錄App Store Connect,找到對應(yīng)的APP應(yīng)用唉工,查看APP信息研乒,也能看到其iTunes ID(即APP ID)。
iPhone在設(shè)備上啟用網(wǎng)頁檢查器
iOS跳轉(zhuǎn)到位置服務(wù)
- 參考:
http://www.reibang.com/p/0aa1d86867da
https://www.zhihu.com/question/22547247/answer/101986288
http://www.reibang.com/p/0200b6cce1a7
ios應(yīng)用配置定位權(quán)限但是設(shè)置里沒有顯示
參考:
http://www.reibang.com/p/1b94a0647971
https://ask.dcloud.net.cn/question/86633
接入微信支付庫:編譯報錯
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_PayResp", referenced from:
objc-class-ref in libwxpay.a(PGWXPay.o)
"_OBJC_CLASS_$_PayReq", referenced from:
objc-class-ref in libwxpay.a(PGWXPay.o)
處理:根據(jù)uniapp離線APP官方文檔淋硝。
微信支付雹熬,如下3個庫是綁定使用的:
liblibPayment.a、libwxpay.a谣膳、libWeChatSDK_pay.a參考:
https://blog.csdn.net/qq_25862091/article/details/80264946
https://blog.csdn.net/weixin_30541591/article/details/88784678
Undefined symbols for architecture arm64:
- 參考:
http://www.reibang.com/p/7402d0b948db
http://www.reibang.com/p/d9b3c5a845a2
https://blog.csdn.net/zuoyou1314/article/details/46638073
Xcode緩存是什么
- 隨著開發(fā)工作的與日俱增竿报,Xcode的緩存也會越來越多,所以定期清理一下緩存還是很有必要的继谚。特別是Macbook磁盤容量不夠的情況下烈菌,清理緩存帶來的效果尤為顯著。
比如:
~/Library/Developer/Xcode/Archives
~/Library/Developer/Xcode/DerivedData
說明:第一個為Archive打ipa包的歷史記錄花履,第二個為模擬器運行程序產(chǎn)生的數(shù)據(jù)芽世。
oc系統(tǒng)定位
參考:
https://www.cnblogs.com/sundaysgarden/articles/10318100.html
http://www.reibang.com/p/fa5220bc6677oc系統(tǒng)定位獲取不到
參考:
https://blog.csdn.net/Jayant_Y/article/details/52021813
看日志,信息如下:
2022-03-09 08:30:20.484257+0800 app-demo-ios[4711:1526967] A location manager (0x108f0caa0) was created on a dispatch queue executing on a thread other than the main thread. It is the developer's responsibility to ensure that there is a run loop running on the thread on which the location manager object is allocated. In particular, creating location managers in arbitrary dispatch queues (not attached to the main queue) is not supported and will result in callbacks not being received.
說明:需要在主線程觸發(fā)獲取定位操作,特別是CLLocationManager一定要在主線程里創(chuàng)建诡壁,在其他線程不支持且不會返回回調(diào)济瓢。
獲取定位日志:
使用有一次性定位:這個時間間隔有點久。
2022-03-09 08:50:07.678619+0800 app-demo-ios[4785:1537452] getCurrenLocation.enable:1
2022-03-09 08:50:17.682124+0800 app-demo-ios[4785:1537452] didUpdateLocations locations.count:1, lo:<+28.21871726,+113.15477040> +/- 65.00m (speed -1.00 mps / course -1.00) @ 2022/3/9 中國標(biāo)準(zhǔn)時間 上午8:50:14
2022-03-09 08:50:17.682456+0800 app-demo-ios[4785:1537452] setCurrentLocation:113.1547703983427,28.21871725630077
使用多次定位:這個時間間隔非常短妹卿。只要在獲取到定位的回調(diào)里停止定位即可旺矾。
2022-03-09 08:54:35.627507+0800 app-demo-ios[4802:1540059] getCurrenLocation.enable:1
2022-03-09 08:54:35.644677+0800 app-demo-ios[4802:1540059] didUpdateLocations locations.count:1, lo:<+28.21869956,+113.15483123> +/- 65.00m (speed -1.00 mps / course -1.00) @ 2022/3/9 中國標(biāo)準(zhǔn)時間 上午8:52:51
:35.644746+0800 app-demo-ios[4802:1540059] setCurrentLocation:113.1548312250047,28.21869955594153
2022-03-09 08:54:35.653389+0800 app-demo-ios[4802:1540059] didUpdateLocations locations.count:1, lo:<+28.21869956,+113.15483123> +/- 65.00m (speed -1.00 mps / course -1.00) @ 2022/3/9 中國標(biāo)準(zhǔn)時間 上午8:53:00
2022-03-09 08:54:35.653436+0800 app-demo-ios[4802:1540059] setCurrentLocation:113.1548312250047,28.21869955594153
__weak typeof
iOS開屏視頻設(shè)置/ iOS應(yīng)用啟動動畫
uni.chooseFile iOS
說明:這里用到了Native.js插件陪每,然后通過拷貝到沙盒目錄再對文件路徑進(jìn)行處理即可护桦。
微信文件上傳ios實現(xiàn)
微信文件獲取ios
iOS像微信那樣獲取APP內(nèi)部的文件
參考:
https://www.freesion.com/article/1072318981/
https://www.cnblogs.com/wj033/p/6351232.html
UIDocument
getTopViewController
UIDocumentPickerViewController
參考:
https://blog.csdn.net/u014084081/article/details/94563298
https://blog.csdn.net/Lu_Ca/article/details/109490842?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1.pc_relevant_default&utm_relevant_index=1如上,獲取iPhone文件中的文件:
2022-04-06 21:14:13.841263+0800 app-demo-ios[6427:2247924] sy.appL documentPicker: url:file:///private/var/mobile/Containers/Data/Application/65F30A07-0B32-45F3-BA73-86DFDBA4149F/tmp/com.app.demo-Inbox/fileuploadtext.txt
拷貝文件失敗:
2022-04-06 22:18:02.363673+0800 app-demo-ios[441:25968] sy.app: copyFileToSanbox fail: filePth:file:///private/var/mobile/Containers/Data/Application/4B978759-D78A-406D-8583-6318C4AF0E9F/tmp/com.app.demo-Inbox/fileuploadtext.txt, toPath:/var/mobile/Containers/Data/Application/4B978759-D78A-406D-8583-6318C4AF0E9F/Documents/fileuploadtext.txt, error:Error Domain=NSCocoaErrorDomain Code=260 "未能打開文件“fileuploadtext.txt”辰狡,因為它不存在。" UserInfo={NSFilePath=file:///private/var/mobile/Containers/Data/Application/4B978759-D78A-406D-8583-6318C4AF0E9F/tmp/com.app.demo-Inbox/fileuploadtext.txt, NSUnderlyingError=0x280612790 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
- 處理:需要處理文件路徑前的file:///
這里需要判斷并去掉犁钟。
error:Error Domain=NSCocoaErrorDomain Code=260 "未能打開文件“fileuploadtext.txt”隶垮,因為它不存在。"
NSFilePath=file:///private/var/mobile/Containers/Data/Application/BAFA56AA-712D-49EE-948D-3281699C2C83/tmp/com.app.demo-Inbox/fileuploadtext.txt, NSUnderlyingError=0x281fec2a0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory
@avaiable
- 參考:
http://www.reibang.com/p/d35bc67e6e04?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes
UIPopoverPresentationController
- 參考:
http://www.reibang.com/p/bcc2f6ca4708
http://www.reibang.com/p/422dd88b25b1
http://www.reibang.com/p/3cf49696fcb8
oc獲取文件屬性
- 文件屬性:日志:
Printing description of attrs:
{
NSFileCreationDate = "2022-04-06 13:08:23 +0000";
NSFileExtendedAttributes = {
"com.apple.lastuseddate#PS" = {length = 16, bytes = 0x7b51546200000000f560ab2800000000};
};
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 501;
NSFileGroupOwnerAccountName = mobile;
NSFileModificationDate = "2022-04-06 13:08:23 +0000";
NSFileOwnerAccountID = 501;
NSFileOwnerAccountName = mobile;
NSFilePosixPermissions = 384;
NSFileProtectionKey = NSFileProtectionCompleteUntilFirstUserAuthentication;
NSFileReferenceCount = 1;
NSFileSize = 16;
NSFileSystemFileNumber = 50664303;
NSFileSystemNumber = 16777224;
NSFileType = NSFileTypeRegular;
}
oc字符串過濾器:NSPredicate
- 參考:
https://www.cnblogs.com/self-epoch/p/16061696.html
https://blog.csdn.net/zhang522802884/article/details/76889748
UIButton圖片文字位置
- 參考:
http://www.reibang.com/p/0a56837cdbb8
https://www.likecs.com/show-305743093.html
https://blog.csdn.net/SHJSir/article/details/74474687
UIButton改變圖片大小
startAccessingSecurityScopedResource
DocumentTypes
- 參考:
https://blog.csdn.net/youshaoduo/article/details/79402931
https://developer.apple.com/library/archive/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259
ios的encodeurl和decodeurl
NSURLSession下載
- 參考:
http://www.reibang.com/p/18a6062f2ebb
http://www.reibang.com/p/3b74517f6a2b
http://www.reibang.com/p/5a07352e9473
NSURLSessionDownloadTask下載文件大小為0
- 參考:
暫時沒問題雕崩,問題出在uni.downlown和uni.saveFile代碼邏輯里魁索。
colorWithRed宏寫法
NSDateFormatter
sortUsingComparator
sortUsingComparator比較NSDate
UItableView不顯示hightlight
ios劉海屏和非劉海屏獲取狀態(tài)欄高度
- 參考:
https://codeleading.com/article/39572614575/
http://www.reibang.com/p/f79970b3e03b
http://www.reibang.com/p/17a49d30e0e4
oc預(yù)覽文件
- 參考:
https://www.cnblogs.com/lrr0618/p/13470086.html
http://www.reibang.com/p/998e045b930f?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
oc hitTest
CGRectContainsRect
OC擴(kuò)大按鈕的點擊范圍
處理:
使用pointInSide需要用UIView的bounds,而不是frame盼铁。參考:
https://www.cnblogs.com/itlover2013/p/15174495.html
https://blog.csdn.net/eastWind1101/article/details/110790935
https://blog.csdn.net/sinat_36521092/article/details/81350845?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-2.pc_relevant_default&utm_relevant_index=5
Docment Types配置
- 參考:
http://www.reibang.com/p/2edfacf2cd1e
https://blog.csdn.net/chugang6852/article/details/100757134
http://www.reibang.com/p/68d8b7f174a9
UIviewcontroller設(shè)置透明背景顯示黑色
UIModalPresentationOverFullScreen和UIModalPresentationFullScreen
- 參考:
https://blog.csdn.net/victor_barnett/article/details/51791580
https://www.thinbug.com/q/29022149
http://www.tilaile.com/question/21143
OC類型問題
Passing 'const NSString * _Nonnull __strong' to parameter of type 'NSString * _Nonnull __strong' discards qualifiers
- 兩種正確的寫法:
const static NSString *TableID = @"table";
static NSString * const TableIDCall = @"call";
oc random
一句話總結(jié):
粗蔚。
騰訊OCR:導(dǎo)入framework問題
Undefined symbol: _OBJC_CLASS_$_MLDictionaryFeatureProvider
Undefined symbol: _OBJC_CLASS_$_MLMultiArray
Undefined symbol: _OBJC_CLASS_$_MLModel
- 原因:和OcrDemo工程對比了一下,發(fā)現(xiàn)是CoreML.framework庫未導(dǎo)入導(dǎo)致的饶火。這是一個系統(tǒng)庫鹏控。
- 處理:導(dǎo)入該庫,編譯正常肤寝。
獲取本地文件地址
- 獲取本地文件地址当辐,然后傳給前端,報錯:
2022-08-15 17:56:54.690875+0800 app-demo-ios[1069:210438] <Weex>[error]DCImageComponent.mm:556, Error downloading image: /var/mobile/Containers/Data/Application/21FBD746-1859-4569-AC2A-90A593647A21/Library/Caches/OcrFiles/image_1660557414.jpg, detail:不支持的URL
- 處理:需要在地址前加file://前綴
3 Pod
mac安裝cocoapods失敗
- 安裝cocoapods鲤看,版本1.9.3
sudo gem install cocoapods -v 1.9.3
- 報錯:
hh@hhdeMacBook-Pro-2 NoteBook % sudo gem install cocoapods -v 1.9.3
Fetching thread_safe-0.3.6.gem
Fetching i18n-0.9.5.gem
Fetching tzinfo-1.2.9.gem
Fetching ffi-1.15.5.gem
Fetching ethon-0.15.0.gem
Fetching activesupport-4.2.11.3.gem
Fetching cocoapods-core-1.9.3.gem
Fetching claide-1.1.0.gem
Fetching cocoapods-stats-1.1.0.gem
Fetching molinillo-0.6.6.gem
Fetching ruby-macho-1.4.0.gem
Fetching cocoapods-1.9.3.gem
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.9
Successfully installed i18n-0.9.5
Successfully installed activesupport-4.2.11.3
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220303-25236-1dhr2lh.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib
--enable-system-libffi
--disable-system-libffi
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:in `block in try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:in `try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:672:in `try_ldflags'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1832:in `pkg_config'
from extconf.rb:9:in `system_libffi_usable?'
from extconf.rb:42:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/gem_make.out
mac安裝ruby
參考:
http://www.reibang.com/p/bbe6d6860881安裝ruby報錯:
hh@hhdeMacBook-Pro-2 NoteBook % brew install rbenv
Error: Can't create update lock in /usr/local/var/homebrew/locks!
Fix permissions by running:
sudo chown -R $(whoami) /usr/local/var/homebrew
Warning: You are using macOS 11.6.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Discourse, Twitter or IRC. You are responsible for resolving any issues you
experience while you are running this pre-release version.
Error: The following directories are not writable by your user:
/usr/local/etc/bash_completion.d
/usr/local/lib/pkgconfig
/usr/local/share/aclocal
/usr/local/share/info
/usr/local/share/locale
/usr/local/share/man/man8
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew/locks
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/etc/bash_completion.d /usr/local/lib/pkgconfig /usr/local/share/aclocal /usr/local/share/info /usr/local/share/locale /usr/local/share/man/man8 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew/locks
And make sure that your user has write permission.
chmod u+w /usr/local/etc/bash_completion.d /usr/local/lib/pkgconfig /usr/local/share/aclocal /usr/local/share/info /usr/local/share/locale /usr/local/share/man/man8 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew/locks
- 加sudo執(zhí)行命令缘揪,報錯:
hh@hhdeMacBook-Pro-2 NoteBook % sudo brew install rbenv
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
注意:ruby自帶:
hh@hhdeMacBook-Pro-2 NoteBook % ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]ruby安裝cocoapods
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
參考:
http://www.reibang.com/p/9c9f8d4867eb
http://www.reibang.com/p/21afa0ae67dc原因:根據(jù)上面參考資料可知,版本太低導(dǎo)致义桂,而cocoapods版本1.9.3需要比較高的ruby版本找筝。目前本級ruby版本太低了,所以降級使用cocoapods版本1.8.3
處理:執(zhí)行如下命令慷吊,成功:
sudo gem install cocoapods -v 1.8.3
YYModel:pod失敗
Installing YYModel (1.0.4)
[!] Error installing YYModel
[!] /usr/bin/git clone https://github.com/ibireme/YYModel.git /var/folders/xf/xsz954hn761_n1wvrw3wpl7m0000gn/T/d20220810-20357-1io0n3z --template= --single-branch --depth 1 --branch 1.0.4
Cloning into '/var/folders/xf/xsz954hn761_n1wvrw3wpl7m0000gn/T/d20220810-20357-1io0n3z'...
error: RPC failed; curl 16 Error in the HTTP2 framing layer
fatal: error reading section header 'shallow-info'
- 問題:該問題未解決袖裕。暫時不引入YYModel。
- 參考:
https://gitee.com/mirrors/YYModel?utm_source=alading&utm_campaign=repo
gitignore
- .gitignore文件是在git上傳時過濾不需要提交的文件的溉瓶。示例如下:
#CocoaPods
Pods/
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
# Mac OS X Finder and whatnot
.DS_Store
## Build generated
build/
- 參考:
https://blog.csdn.net/weixin_45318845/article/details/120740012
https://www.51sjk.com/b20b282346/
http://www.reibang.com/p/863743b5b993
4 調(diào)試急鳄,打包,上架
ios開發(fā)證書生成p12( ios導(dǎo)出p12)
- 參考:
https://blog.csdn.net/tieshuxianrezhang/article/details/72835963
https://blog.csdn.net/qq_36487644/article/details/103212391
https://www.cnblogs.com/ywkpl/p/9110702.html
iOS開發(fā)/發(fā)布證書導(dǎo)出證書描述文件
- 參考:
http://www.reibang.com/p/431ed0536754
https://blog.csdn.net/weixin_39683734/article/details/111530447
ios開發(fā)組團(tuán)隊添加賬號
說明:
在iOS開發(fā)組團(tuán)隊添加賬號之后嚷闭,Apple會給開發(fā)者發(fā)送確認(rèn)郵件(郵件主題為You're invited to join a development team.)攒岛,首先需要點擊確認(rèn)(這個會進(jìn)入蘋果開發(fā)者網(wǎng)站進(jìn)行驗證/確認(rèn)),其次開發(fā)組團(tuán)隊需要對該加入的賬號授予相應(yīng)的權(quán)限胞锰,不然開發(fā)者賬號不會顯示加入的開發(fā)組團(tuán)隊(Accounts--Team)灾锯。
iOS真機(jī)調(diào)試,運行報錯:
Showing Recent Messages
The network connection was lost.
//還有一句錯誤未復(fù)制到嗅榕。
- 說明:
調(diào)試真機(jī)未包含在開發(fā)組團(tuán)隊的設(shè)備管理列表中顺饮。
修改工程文件夾路徑名:
error: Build input file cannot be found: '/Users/hh/Documents/ios-pro/iOSSDK-3.2.16/app-demo-ios/HBuilder-Hello/HBuilder-Hello-Prefix.pch' (in target 'app-demo-ios' from project 'app-demo-ios')
- 處理:
修改HBuilder-Hello-Info.plist和HBuilder-Hello-Prefix.pch
打ipa包:Archive執(zhí)行報錯:
Showing Recent Messages
Undefined symbol: _OBJC_CLASS_$_UMZid
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
ld: warning: Could not find or use auto-linked framework 'AVFAudio'
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_UMZid", referenced from:
objc-class-ref in UMCommon(UMConfigure.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
團(tuán)隊開發(fā)賬戶導(dǎo)出ipa
執(zhí)行命令吵聪,報錯:
xcodebuild -exportArchive -exportFormat ipa -archivePath ./app-demo-ios\ 2021-12-7,\ 3.20\ PM.xcarchive ./test.ipa
xcodebuild: error: invalid option '-exportFormat'
參考:
https://blog.csdn.net/zhangxiweicaochen/article/details/72730355
http://www.reibang.com/p/29fc7d1bbb57執(zhí)行:
xcodebuild -exportArchive :exportOptionsPlist -archivePath ./app-demo-ios\ 2021-12-7,\ 3.20\ PM.xcarchive ./test.ipa
xcodebuild: error: The flag -exportOptionsPlist is required when specifying -exportArchive.
參考:
https://magicalboy.com/xcodebuild-usage
https://blog.csdn.net/hdwhappy/article/details/60767078xcodebuild -exportArchive生成ipa
參考:
http://www.reibang.com/p/e04c3b7f57f6執(zhí)行,報錯:
xcodebuild -exportArchive app-demo-ios\ 2021-12-7,\ 3.20\ PM.xcarchive -exportPath test.ipa
xcodebuild: error: The flag -exportOptionsPlist is required when specifying -exportArchive.
xcodebuild: error: The flag -archivePath is required when specifying -exportArchive.
- 重新執(zhí)行兼雄,報錯:
xcodebuild -exportArchive -archivePath app-demo-ios\ 2021-12-7,\ 3.20\ PM.xcarchive -exportPath test.ipa
xcodebuild: error: The flag -exportOptionsPlist is required when specifying -exportArchive.
原因:需要導(dǎo)出exportOptionsPlist吟逝,導(dǎo)出一份plist文件
參考:
https://jingyan.baidu.com/article/11c17a2cdcb4c9f446e39dbe.html結(jié)論:
在執(zhí)行,然后彈出ipa輸出包彈框赦肋,然后發(fā)布ipa時選擇第4個块攒,開發(fā)者選項(
),再點擊下一步(選自動佃乘,不要選手動)囱井,就可以導(dǎo)出了。
導(dǎo)出之后趣避,就有ipa包庞呕,然后使用iTools安裝,成功程帕。
換一個新手機(jī)住练,運行xcode,彈框:需要注冊設(shè)備:
Device "“win10”的 iPhone" isn't registered in your developer account.
The device must be registered in order to be included in a provisioning profile.
Showing Recent Messages
Provisioning profile "iOS Team Provisioning Profile: com.app.demo" doesn't include the currently selected device "“win10”的 iPhone" (identifier e05f0b5d290c73bf9f00ca6a8fbceffe4066adad).
- 說明:這個是Xcode注冊設(shè)備到蘋果開發(fā)賬號愁拭,直接點確認(rèn)即可讲逛。
- 參考:
https://zhuanlan.zhihu.com/p/72103102
http://www.reibang.com/p/f31116a76ea9
xcode 版本和手機(jī)系統(tǒng)不匹配(需要升級xcode,目前手機(jī)系統(tǒng)新的iPhone都在iOS14.8以上敛苇,iOS15以上)妆绞。
iPhonesm is not available.
Please reconnect the device.
iOS包ipa安裝失敗
無法安裝“應(yīng)用內(nèi)部版”
無法安裝此App顺呕,因為無法驗證其完整性枫攀。
注意:該問題是iOS開發(fā)調(diào)試設(shè)備時經(jīng)常會遇到的問題。
說明:uuid已添加到蘋果開發(fā)者賬號后臺但仍然無法安裝此app因為無法驗證其完整性
原因:uuid(UDID)需要先注冊添加(通過Xcode來注冊最可靠)株茶,再打ipa包提供安裝来涨。
參考:
https://zhidao.baidu.com/question/1903176824428431820.html
https://blog.csdn.net/wangyajuncsd/article/details/115533339
https://zhidao.baidu.com/question/2210488255906357948.html
http://www.reibang.com/p/a3eb50c22117?ivk_sa=1025922x
真機(jī)調(diào)試問題:
Failed to prepare device for development.
This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. You may also need to restart your mac and device in order to correctly detect compatibility.
- 處理:重啟手機(jī)。
- 參考:
http://www.reibang.com/p/798785608df8
Xcode 運行報錯
錯誤信息:
hh2的iPhone is not available.
Please reconnect the device.
查看 Xcode -- Window -- Device And Simulator
有如下報錯信息:
Failed to prepare device for development.
If you are certain that Xcode supports development on this device, try disconnecting and reconnecting the device.
- 查看具體報錯信息:
NSLocalizedFailure = "This operation can fail if the version of the OS on the device is newer than the version of Xcode that is running.";
結(jié)論:iOS版本和Xcode版本不匹配導(dǎo)致的启盛。
兩種方案:一是更新xcode蹦掐,一是使用模擬器。
第三種投機(jī)取巧方案:拷貝xcode需要支持的iOS版本到xcode對應(yīng)的路徑下僵闯,具體參考如下:
http://www.reibang.com/p/09f67a4cb039參考:
http://www.reibang.com/p/09f67a4cb039
http://www.reibang.com/p/e519550056a0
蘋果開發(fā)者官網(wǎng)發(fā)布應(yīng)用(ios應(yīng)用上架)
具體見iOS Archive打包ipa以及上架Apple Store
(1) 參考:
http://www.reibang.com/p/b4f284de459e
https://www.yubaibai.com.cn/article/5612211.html
https://zhuanlan.zhihu.com/p/104987262
官方文檔:
http://help.apple.com/xcode/mac/current/#/devba7f53ad4
https://help.apple.com/app-store-connect/#/dev34e9bbb5a
官方文檔:App 審核:
https://developer.apple.com/app-store/review/
(2) Xcode Archive頁面
參考:
http://www.reibang.com/p/9eb133053a64
(3) ios應(yīng)用上架錯誤
具體見iOS Archive打包ipa以及上架Apple Store
(4) 怎么進(jìn)入iTunes connect
- 說明:目前沒有iTunes connect了卧抗,iOS APP發(fā)布直接走App Store Connect。
- 參考:
https://jingyan.baidu.com/article/7f766daff39bcb4101e1d093.html
(5) Xcode下載問題:
我們未能完成您的購買鳖粟。
可用的磁盤空間不足社裆,無法安裝此產(chǎn)品。
處理:從APPleStore下載Xcode向图,一定要磁盤容量留出超過45G才行泳秀。
(6) 刪除testflight提交的版本
說明:暫時沒有辦法刪除已經(jīng)發(fā)布上傳test flight所提交的版本标沪。如果testflight所提交的版本有問題,可以重新發(fā)布上傳嗜傅,而在審核的時候選擇正確的構(gòu)建版本即可金句。
參考:
http://www.reibang.com/p/02daf21ad3df
https://tieba.baidu.com/p/7203316769
(7) testflight的app怎么發(fā)布到appstore
說明:由于testflight里的app版本,需要進(jìn)行驗證完才能顯示出來吕嘀。所以appstore connect里在選擇的構(gòu)建版本一定是要testflight已經(jīng)驗證完的版本违寞。
(8) iTunes connect
(9) Xcode archive發(fā)布應(yīng)用
注意:
發(fā)布應(yīng)用需要在Edit scheme里修改Build Configuraiton模式為
release(調(diào)試一般為debug)
(10)Xcode13發(fā)布應(yīng)用到App Store
- 說明:發(fā)布應(yīng)用到APP Store一律走App Store Connect。
- 參考:
http://www.reibang.com/p/767ab0f5c8e9
https://www.cnblogs.com/edensyd/p/9441890.html
Apple Store Connect協(xié)議條款
Review the updated Paid Applications Schedule.
In order to update your existing apps, create new in-app purchases, and submit new apps to the App Store, the user with the Legal role (Account Holder) must review and accept the Paid Applications Schedule (Schedule 2 to the Apple Developer Program License Agreement) in the Agreements, Tax, and Banking module.
To accept this agreement, they must have already accepted the latest version of the Apple Developer Program License Agreement in their account on the developer website.
說明:Apple Store Connect這里有個協(xié)議需要同意才能發(fā)布等操作偶房。但是這里只能是賬戶持有者(Account Holder)才能處理坞靶,其他角色沒有這個權(quán)限。
ios發(fā)布找不到構(gòu)建版本
- 問題描述:
1) ios發(fā)布到testflight但是看不到
2)applestore connect找不到構(gòu)建版本
applestore connect顯示信息:
從多種工具中選取一種來上傳您的構(gòu)建版本蝴悉。查看上傳工具
參考:
https://blog.csdn.net/huanghaiyan_123/article/details/48193863
http://www.reibang.com/p/1611c48a3d71處理:根據(jù)蘋果審核構(gòu)建版本的郵件彰阴,可知,需要在Info.plist中添加NSCameraUsageDescription這個key拍冠。
說明:如果ios發(fā)布(Archive上傳成功尿这,但不一定就能發(fā)布),一段時間(驗證時間)內(nèi)仍然在applestore connect找不到構(gòu)建版本庆杜,就需要找郵件或者其他途徑看看是不是有報錯信息射众。然后根據(jù)報錯信息(如上為照相機(jī)權(quán)限未申請)修改代碼再重新發(fā)布。
上架問題:
App Store Connect Operation Error
ERROR ITMS-90101: "This bundle does not support one or more of the devices supported by the previous app version. Your app update must continue to support all devices previously supported. You declare supported devices in Xcode with the Targeted Device Family build setting. Refer to QA1623 for additional information: https://developer.apple.com/library/ios/#qa/qa1623/_index.html"
處理:
去掉iPad選項晃财,導(dǎo)致的問題叨橱。同時修改如下配置(去掉iPad)
"@platforms":["android","iPhone","iPad"]注意:這里是uniapp離線工程,上面的配置是uniapp工程里的manifest.json配置文件的參數(shù)断盛。
參考:
https://blog.csdn.net/qq_15023917/article/details/100733524
applestore審核
您的 App 包含 NSUserTrackingUsageDescription罗洗,這表示您將會請求追蹤用戶。要在 App 產(chǎn)品頁上發(fā)布此信息钢猛,您必須注明哪些數(shù)據(jù)類型會追蹤用戶伙菜。如果此描述有誤,請更新您的 App 二進(jìn)制文件命迈,并將新的構(gòu)建版本上傳到 App Store Connect贩绕。
- 參考:
https://blog.csdn.net/gwh111/article/details/121178288
https://www.cnblogs.com/e0yu/p/14785158.html
https://ask.dcloud.net.cn/article/36107
Apple Connect:Register an App ID
這個是為新建APP填寫套裝ID用的。
套裝ID如果找不到對應(yīng)的APPID壶愤,可以通過鏈接跳轉(zhuǎn)到注冊頁面淑倾。處理:
Description:簡要填寫APP信息
Bundle ID:選擇Explicit(默認(rèn)),填寫報名
Capabilities:復(fù)選:
(1)用戶版本
Access WiFi Information
Associated Domains
Data Protection:選擇Complete Protection
In-App Purchase(默認(rèn)選擇征椒,用戶不可選)
Push Notifications
Sign In with Apple
(2)內(nèi)部版
Associated Domains
Inter-App Audio
In-App Purchase(默認(rèn)選擇娇哆,用戶不可選)
Push Notifications
Sign In with Apple
(3)注意:除了In-App Purchase(默認(rèn)選擇,用戶不可選)之外,其他的都可以重新選擇
Apple Connect:新建App
- 處理:
平臺:選擇iOS
名稱:填寫APP名稱
主要語言:選擇簡體中文
套裝ID:從上面Register an ID里選擇一個AppID
SKU:這個自定義即可
用戶訪問權(quán)限:選擇“完全訪問權(quán)限”
5 推送
ios申請推送服務(wù)
- 參考:
http://t.zoukankan.com/panshengneng-p-3954916.html
https://www.likecs.com/show-204351632.html
http://www.reibang.com/p/def6a1c9d3a6
http://www.reibang.com/p/2df93cce5139
推送證書
Apple Push Notification service SSL Certificates
To configure push notifications for this App ID, a Client SSL Certificate that allows your notification server to connect to the Apple Push Notification Service is required. Each App ID requires its own Client SSL Certificate. Manage and generate your certificates below.
Development SSL Certificate
Create an additional certificate to use for this App ID.
Create Certificate
Production SSL Certificate
Create an additional certificate to use for this App ID.
Create Certificate
生成APNs后端推送證書
創(chuàng)建證書:
Certificates, Identifiers & Profiles
All Certificates
Create a New Certificate
Certificate Type
Apple Push Notification service SSL (Sandbox)
Upload a Certificate Signing Request
To manually generate a Certificate, you need a Certificate Signing Request (CSR) file from your Mac.
Learn more