Direct Link
Direct Link
This is an old revision of the document!
With error message as: Failed to prepare device for develoment.
Settings→General→ VPN & Device Management
采用脚本的方式修改版本号。
// Read version and buildnumber from info.plist buildNumber=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}") shortVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}") // Updata buildnumber buildNumber=`date +"%y%m%d.%H%M"` buildNumber="$shortVersion.$buildNumber" // Update info.plist /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
if [ "${CONFIGURATION}" = "Release" ]; then fi
如果直接点击屏幕下方的Xcode图标,回弹出一个xcode的启动框,右边会列出你最近打开过的工程
如果想清除这些记录,就点击xcode的菜单栏,[File] → [Open Recent] → [Clear Menu],再次启动xcode就看不到先前打开过的工程了
Edit
~/Library/MobileDevice/Provisioning Profiles
三个占用空间最大的文件分别是: 1.iOS.simruntime 9.76 GB 2.tvOS.simruntime 5.39 GB 3.watchOS.simruntime 6.83 GB
iOS.simruntime日常使用删不得,tvOS.simruntime, watchOS.simruntime ,大部分开发者接触不到,可直接删除
/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS.simruntime
Xcode升级到Xcode12以后,在编译老工程时报错“iPad Air 2 cannot run xxx. xxx architectures (arm64) include none that iPad Air 2 can execute Intel 64-bit).”解决方法
如果使用真机进行编译或打包,需要将VALID_ARCHS设置为arm64,这样真机就可以正常编译了。如果使用模拟器编译或者打包的话,将arm64的设置删除掉就可以了,设置为空。 但是这样在模拟器合真机之间切换的话还是比较麻烦的。
In your project Build Settings
Architectures,set to Standard architectures - $(ARCHS_STANDARD) In Build Active Architectures Only,set Debug to Yes,Release to No let Excluded Architectures empty VALID_ARCHS, set to arm64 arm64e x86_64
https://help.apple.com/app-store-connect/#/devb1c185036
Upload your app binary files with the Transporter app The Transporter app for macOS is a simple and easy way to upload an app to App Store Connect for distribution on the App Store. In addition to uploading your build, you can upload your metadata packages, view delivery progress (including warnings, errors, and delivery logs), as well as a history of past deliveries.
You can download the Transporter app on the Mac App Store.
See the Transporter for macOS Help for more information.
evaluateJavaScript(_:in:in:completionHandler:)
Declaration
@MainActor func evaluateJavaScript( _ javaScript: String, in frame: WKFrameInfo? = nil, in contentWorld: WKContentWorld, completionHandler: ((Result<Any, Error>) -> Void)? = nil )
https://developer.apple.com/documentation/webkit/wkwebview/3656442-evaluatejavascript
webView.isOpaque = false webView.backgroundColor = UIColor.clear webView.scrollView.backgroundColor = UIColor.clear
webview内容下移20px
iOS 11: webView.scrollView.contentInsetAdjustmentBehavior = .never iOS 7-10: self.automaticallyAdjustsScrollViewInsets = false
webview可以向下拉动,出现一片空白
添加 webView.scrollView.isScrollEnabled = false
webview可两指缩放
设置代理: webView.scrollView.delegate = self 实现以下方法 // Not work func viewForZooming(in scrollView: UIScrollView) -> UIView? { return nil } // work func scrollViewWillBeginZooming(_ scrollView: UIScrollView, with view: UIView?) { scrollView.pinchGestureRecognizer?.isEnabled = false scrollView.panGestureRecognizer.isEnabled = false }
阻止input输入文字时页面视图放大
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Starting April 25, 2022, iOS, iPadOS, and watchOS apps submitted to the App Store must be built with Xcode 13, which includes the SDKs for iOS 15, iPadOS 15, and watchOS 8.
4月25日起,开发者向 App Store 提交的应用必须使用 Xcode 13 创建
App Store submission requirement starts April 25
Starting April 25, 2023, iOS, iPadOS, and watchOS apps submitted to the App Store must be built with Xcode 14.1 or later.
Xcode 14.2 最低要求 macOS Monterey 12.5
Xcode 13.4 最低要求 macOS Monterey 12
Xcode 13.2 最低要求 macOS Big Sur 11.3
Xcode 13 最低要求 macOS Big Sur 11.3
Minimum requirements and supported SDKs
App Store 中 选择build的时候发现有“Missing Compliance” 警告。
解决办法:在info.plist中, 加入App Uses Non-Exempt Encryption,值为NO,重新打包上传
在 Targets → Build Phases → Copy Bundle Resources 添加Assets.xcassets文件夹。