xcodebuild:配置配置文件不包含设备

时间:2019-08-10 01:58:48

标签: flutter xcodebuild provisioning xcode10.3

问题:

  • 使用Xcode10.3vscode with flutter运行就可以了。
  • 使用xcodebuild command运行失败: Provisioning profile不包括当前的selected device“ [MyPhone]”。 (在目标“亚军”中)

在设备上

使用Xcode run on device are fine。在终端中使用xcodebuild命令失败:

  

xcodebuild-配置调试-target Runner -arch armv6 -sdk iphoneos

Build settings from command line:
    ARCHS = armv6
    SDKROOT = iphoneos12.4


2019-08-10 08:52:54.739 xcodebuild[23765:932559]  DTDeviceKit: deviceType from 
1daca728d755****0[MyPhoneUUID] was NULL
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: Provisioning profile "iOS Team Provisioning Profile: com.xxxx.xxxx" 
doesn't include the currently selected device "[MyPhone]". (in target 'Runner')

Build system information
warning: None of the architectures in ARCHS (armv6) are valid for this target. 
Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to include at least
one value from VALID_ARCHS (arm64, arm64e, armv7, armv7s). (in target 'Runner')

Build system information
warning: ignoring duplicated output file: '[Project_Path]/build/ios/Debug-iphoneos/
Runner.app/Frameworks/Flutter.framework' in shell script build phase '[CP] Embed 
Pods Frameworks'. This warning represents an extremely serious project misconfiguration 
and will likely cause some shell scripts in your project to be skipped entirely, 
leading to other build failures or missing files in the build directory. This will
be a hard error in the future. (in target 'Runner')

有没有一种方法可以找出在设备上进行调试时Xcode运行哪种命令。

在模拟器上

使用Xcode run on simulator iPhone 7(iOS12.4) are fine。 但是在终端中使用xcodebuild命令失败:

  

xcodebuild-配置调试-target Runner -sdk iphonesimulator

Build settings from command line:
    SDKROOT = iphonesimulator12.4

note: Using new build system
note: Planning build
note: Using build description from disk
Build system information
error: Multiple commands produce '[Project_Path]/build/ios/Debug-iphonesimulator/
Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from 
 '[Project_Path]/ios/Flutter/Flutter.framework' to 
 '[Project_Path]/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script
 phase “[CP] Embed Pods Frameworks”

Build system information
warning: ignoring duplicated output file: '[Project_Path]/build/ios/
Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' in shell script build 
phase '[CP] Embed Pods Frameworks'. This warning represents an extremely serious 
project misconfiguration and will likely cause some shell scripts in your project to 
be skipped entirely, leading to other build failures or missing files in the build 
directory. This will be a hard error in the future. (in target 'Runner')

更新

在设备上

-arch armv6应该是-arch armV7

  

xcodebuild-配置调试-target Runner -arch armv7 -sdk iphoneos

清理后或可能会误删除更多文件

使用Xcode运行即可。 使用上面的命令运行:

Build settings from command line:
    ARCHS = armv7
    SDKROOT = iphoneos12.4

2019-08-10 13:09:30.105 xcodebuild[3131:1467212]  DTDeviceKit: deviceType from 
1daca728d755****0[MyPhoneUUID] was NULL
2019-08-10 13:09:30.147 xcodebuild[3131:1467213]  DTDeviceKit: deviceType from 
1daca728d755****0[MyPhoneUUID] was NULL
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: Provisioning profile "iOS Team Provisioning Profile: com.xxxx.xxx" doesn't 
include the currently selected device "[MyPhoneName]". (in target 'Runner')

更新2

此问题是由使用locked的iPhone是xcodebuild引起的。 确保设备为pluggingunlocked并与xcodebuild一起运行。

  

DTDeviceKit:[PhoneUUID]中的deviceType为NULL。

更新3

清洁全部:

  • 删除钥匙串中的所有iPhone Developer certificate
  • 删除苹果帐户中的所有iPhone Developer certificate
  • 删除文件夹~/Library/MobileDevice/Provisioning Profiles中的所有配置文件。
  • 使用Xcode / ref / myAccount /“下载手动配置文件”下载所有配置文件,此后将自动生成一个名称为“ YourNameOnMac(YourMacName)”的新证书。

结果:

  • 使用Xcode运行即可。
  • 通过CI(带有manual sign config: .p12 + profile的代码魔术符)运行项目。
  • 使用命令运行仍然失败(我将armv7更新为arm64
  

xcodebuild-配置调试-target Runner -arch arm64 -sdk iphoneos

Build settings from command line:
    ARCHS = arm64
    SDKROOT = iphoneos12.4

note: Using new build system
note: Planning build
note: Using build description from disk
Build system information
error: Provisioning profile "iOS Team Provisioning Profile: com.xxxx.xxx" doesn't 
include the currently selected device "[MyPhoneName]". (in target 'Runner')

Build system information
warning: ignoring duplicated output file: '[Project_Path]/build/ios/Debug-iphoneos/
Runner.app/Frameworks/Flutter.framework' in shell script build phase '[CP] Embed 
Pods Frameworks'. This warning represents an extremely serious project misconfiguration 
and will likely cause some shell scripts in your project to be skipped entirely, 
leading to other build failures or missing files in the build directory. This will
be a hard error in the future. (in target 'Runner')

更新4。

  • 取消选中Automatic manage signing以查看它是否仅与Team个配置文件问题有关。
  • 但是使用flutter运行vscode并在Xcode中运行都可以。

1 个答案:

答案 0 :(得分:0)

鉴于这个问题的年龄,我很好奇这个问题是否仍然相关。虽然我无法复制这种行为,但我建议您尝试使用 solution on this Stack Overflow post,看看它是否适用于您的设置。