美文网首页selector
2022-04-26 xcode13 Info.plist同步错

2022-04-26 xcode13 Info.plist同步错

作者: 我是小胡胡123 | 来源:发表于2022-04-26 12:08 被阅读0次

https://mp.weixin.qq.com/s/mgGjBb9dt714c117xrYGfQ

  1. "Custom iOS Target Properties"的缺点
    首先,不支持搜索

其次,不支持“Open As Source Code”,不能直接编辑源码

最后,由于“Custom iOS Target Properties”并没有完全摆脱Info.plist文件,这导致属性分布在“Custom iOS Target Properties”和Info.plist两个地方,最终的Info.plist只有在打包时才会合并。在打包前查看或操作(比如用脚本)完整的Info.plist属性将变得困难。

  1. 如何恢复从前的Info.plist

这是Xcode13新增的配置,Xcode13打开老项目,这里默认是NO;
如果Xcode13新建项目,这里默认是YES。

当这个属性为YES时,Xcode会自动同步“Custom iOS Target Properties”和Info.plist文件,
并在打包时合并,如果我们需要手动管理Info.plist,设置为YES这会引起同步混乱

关闭Generate Info.plist


image.png

找一份老项目的Info.plist拷贝到当前新项目,然后修改称需要的。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>xxx</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIconName</key>
    <string>AppIcon</string>
    <key>CFBundleIcons</key>
    <dict/>
    <key>CFBundleIcons~ipad</key>
    <dict/>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>100</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>mqqopensdkapiV2</string>
    </array>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    <key>UIFileSharingEnabled</key>
    <false/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIPrerenderedIcon</key>
    <true/>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIRequiresFullScreen</key>
    <true/>
    <key>UIStatusBarHidden</key>
    <true/>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleDefault</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UIUserInterfaceStyle</key>
    <string>Light</string>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <true/>
</dict>
</plist>

相关文章

网友评论

    本文标题:2022-04-26 xcode13 Info.plist同步错

    本文链接:https://www.haomeiwen.com/subject/dkpcyrtx.html