iOS使用相關(guān)技術(shù)要點

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.

簽名配置問題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'.
  • 參考:
    http://www.reibang.com/p/a3f652634152

  • 按照上面參考的進(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).

資源文件缺少導(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泊交。

  • 參考:
    https://blog.csdn.net/wxs0124/article/details/80077143

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)。

  • 參考:
    https://www.it1352.com/1936946.html

iPhone在設(shè)備上啟用網(wǎng)頁檢查器

iOS跳轉(zhuǎn)到位置服務(wù)

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)

Undefined symbols for architecture arm64:

Xcode緩存是什么

  • 隨著開發(fā)工作的與日俱增竿报,Xcode的緩存也會越來越多,所以定期清理一下緩存還是很有必要的继谚。特別是Macbook磁盤容量不夠的情況下烈菌,清理緩存帶來的效果尤為顯著。
    比如:
~/Library/Developer/Xcode/Archives
~/Library/Developer/Xcode/DerivedData

說明:第一個為Archive打ipa包的歷史記錄花履,第二個為模擬器運行程序產(chǎn)生的數(shù)據(jù)芽世。

oc系統(tǒng)定位

看日志,信息如下:

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

微信文件上傳ios實現(xiàn)

微信文件獲取ios

UIDocument

getTopViewController

UIDocumentPickerViewController

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

UIPopoverPresentationController

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

UIButton圖片文字位置

UIButton改變圖片大小

startAccessingSecurityScopedResource

DocumentTypes

ios的encodeurl和decodeurl

NSURLSession下載

NSURLSessionDownloadTask下載文件大小為0

  • 參考:
    暫時沒問題雕崩,問題出在uni.downlown和uni.saveFile代碼邏輯里魁索。

colorWithRed宏寫法

NSDateFormatter

sortUsingComparator

sortUsingComparator比較NSDate

UItableView不顯示hightlight

ios劉海屏和非劉海屏獲取狀態(tài)欄高度

oc預(yù)覽文件

oc hitTest

CGRectContainsRect

OC擴(kuò)大按鈕的點擊范圍

Docment Types配置

UIviewcontroller設(shè)置透明背景顯示黑色

UIModalPresentationOverFullScreen和UIModalPresentationFullScreen

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

騰訊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
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

  • 參考:
    http://www.reibang.com/p/586edc5c57a7

ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.
 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'

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/

4 調(diào)試急鳄,打包,上架

ios開發(fā)證書生成p12( ios導(dǎo)出p12)

iOS開發(fā)/發(fā)布證書導(dǎo)出證書描述文件

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)灾锯。

  • 參考:
    http://www.reibang.com/p/3afe646a8250

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

xcodebuild -exportArchive -exportFormat ipa -archivePath ./app-demo-ios\ 2021-12-7,\ 3.20\ PM.xcarchive ./test.ipa
xcodebuild: error: invalid option '-exportFormat'
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.
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é)論:
    \color{#FF0000}{Product--Archive}執(zhí)行,然后彈出ipa輸出包彈框赦肋,然后發(fā)布ipa時選擇第4個块攒,開發(fā)者選項(\color{#FF0000}{Development}),再點擊下一步(選自動佃乘,不要選手動)囱井,就可以導(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 版本和手機(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顺呕,因為無法驗證其完整性枫攀。

真機(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.

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.";

蘋果開發(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

(5) Xcode下載問題:

我們未能完成您的購買鳖粟。

可用的磁盤空間不足社裆,無法安裝此產(chǎn)品。

處理:從APPleStore下載Xcode向图,一定要磁盤容量留出超過45G才行泳秀。

(6) 刪除testflight提交的版本

(7) testflight的app怎么發(fā)布到appstore

  • 說明:由于testflight里的app版本,需要進(jìn)行驗證完才能顯示出來吕嘀。所以appstore connect里在選擇的構(gòu)建版本一定是要testflight已經(jīng)驗證完的版本违寞。

  • 參考:
    http://www.reibang.com/p/52871d77f30f

(8) iTunes connect

(9) Xcode archive發(fā)布應(yīng)用

(10)Xcode13發(fā)布應(yīng)用到App Store

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)限。

  • 參考:
    https://www.pianshen.com/article/33581174442/

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贩绕。

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ù)

推送證書

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

6 其他

騰訊云:IM通訊

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末迂尝,一起剝皮案震驚了整個濱河市脱茉,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌垄开,老刑警劉巖琴许,帶你破解...
    沈念sama閱讀 217,509評論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異溉躲,居然都是意外死亡榜田,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,806評論 3 394
  • 文/潘曉璐 我一進(jìn)店門锻梳,熙熙樓的掌柜王于貴愁眉苦臉地迎上來箭券,“玉大人,你說我怎么就攤上這事疑枯”缈椋” “怎么了?”我有些...
    開封第一講書人閱讀 163,875評論 0 354
  • 文/不壞的土叔 我叫張陵荆永,是天一觀的道長废亭。 經(jīng)常有香客問我,道長具钥,這世上最難降的妖魔是什么豆村? 我笑而不...
    開封第一講書人閱讀 58,441評論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮骂删,結(jié)果婚禮上掌动,老公的妹妹穿的比我還像新娘。我一直安慰自己宁玫,他們只是感情好粗恢,可當(dāng)我...
    茶點故事閱讀 67,488評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著撬统,像睡著了一般适滓。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上恋追,一...
    開封第一講書人閱讀 51,365評論 1 302
  • 那天,我揣著相機(jī)與錄音罚屋,去河邊找鬼苦囱。 笑死,一個胖子當(dāng)著我的面吹牛脾猛,可吹牛的內(nèi)容都是我干的撕彤。 我是一名探鬼主播,決...
    沈念sama閱讀 40,190評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼羹铅!你這毒婦竟也來了蚀狰?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,062評論 0 276
  • 序言:老撾萬榮一對情侶失蹤职员,失蹤者是張志新(化名)和其女友劉穎麻蹋,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體焊切,經(jīng)...
    沈念sama閱讀 45,500評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡扮授,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,706評論 3 335
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了专肪。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片刹勃。...
    茶點故事閱讀 39,834評論 1 347
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖嚎尤,靈堂內(nèi)的尸體忽然破棺而出荔仁,到底是詐尸還是另有隱情,我是刑警寧澤芽死,帶...
    沈念sama閱讀 35,559評論 5 345
  • 正文 年R本政府宣布咕晋,位于F島的核電站,受9級特大地震影響收奔,放射性物質(zhì)發(fā)生泄漏掌呜。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,167評論 3 328
  • 文/蒙蒙 一坪哄、第九天 我趴在偏房一處隱蔽的房頂上張望质蕉。 院中可真熱鬧,春花似錦翩肌、人聲如沸模暗。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,779評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽兑宇。三九已至,卻和暖如春粱坤,著一層夾襖步出監(jiān)牢的瞬間隶糕,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,912評論 1 269
  • 我被黑心中介騙來泰國打工站玄, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留枚驻,地道東北人。 一個月前我還...
    沈念sama閱讀 47,958評論 2 370
  • 正文 我出身青樓株旷,卻偏偏與公主長得像再登,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,779評論 2 354

推薦閱讀更多精彩內(nèi)容