简体   繁体   English

xcodebuild:配置文件不包括设备

[英]xcodebuild: Provisioning profile doesn't include device

Problem:问题:

  • Run with Xcode10.3 or vscode with flutter are fine.使用Xcode10.3vscode with flutter Xcode10.3运行都可以。
  • Run with xcodebuild command failed: Provisioning profile doesn't include the currently selected device "[MyPhone]".使用xcodebuild command运行失败: Provisioning profile不包括当前selected device “[MyPhone]”。 (in target 'Runner') (在目标“跑步者”中)

On Device在设备上

Use Xcode run on device are fine .Use xcodebuild command in terminal failed: run on device are fine使用 Xcode run on device are fine没问题。在终端中使用xcodebuild命令失败:

xcodebuild -configuration Debug -target Runner -arch armv6 -sdk iphoneos xcodebuild -configuration Debug -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')

Is there a way to find out what kind of command Xcode run when debug on device.有没有办法找出在设备上调试时 Xcode 运行的命令类型。

On Simulator在模拟器上

Use Xcode run on simulator iPhone 7(iOS12.4) are fine .使用 Xcode run on simulator iPhone 7(iOS12.4) are fine But use xcodebuild command in terminal failed:但是在终端中使用xcodebuild命令失败:

xcodebuild -configuration Debug -target Runner -sdk iphonesimulator xcodebuild -configuration Debug -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')

Update更新

-arch armv6 should be -arch armV7 when on device. -arch armV7 -arch armv6在设备上应该是-arch armV7

xcodebuild -configuration Debug -target Runner -arch armv7 -sdk iphoneos xcodebuild -configuration Debug -target Runner -arch armv7 -sdk iphoneos

after clean or maybe mistake delete more files清理或可能错误后删除更多文件

Run with Xcode works.使用 Xcode 运行。 Run with above command:使用上面的命令运行:

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

Update 2更新 2

This problem is caused by iPhone is locked when using xcodebuild .此问题是由于 iPhone 在使用xcodebuild时被locked造成的。 Make sure device is plugging and unlocked and run with xcodebuild are works.确保设备已pluggingunlocked并使用xcodebuild运行正常。

DTDeviceKit: deviceType from [PhoneUUID] was NULL. DTDeviceKit:来自 [PhoneUUID] 的 deviceType 为 NULL。

Update 3更新 3

With cleaning all:全部清洁:

  • delete all iPhone Developer certificate in keychain.删除钥匙串中的所有iPhone Developer certificate
  • delete all iPhone Developer certificate in apple account.删除苹果账户中的所有iPhone Developer certificate
  • delete all profiles in folder ~/Library/MobileDevice/Provisioning Profiles .删除文件夹~/Library/MobileDevice/Provisioning Profiles所有配置~/Library/MobileDevice/Provisioning Profiles
  • using Xcode/ref/myAccount/"Download Manual Profiles" to download all profile and after this there's a new auto generated certificate with name "YourNameOnMac(YourMacName)".使用 Xcode/ref/myAccount/"Download Manual Profiles" 下载所有配置文件,然后有一个名为“YourNameOnMac(YourMacName)”的新的自动生成的证书。

Result:结果:

  • Run with Xcode works.使用 Xcode 运行。
  • Run the project through CI (codemagic confic with manual sign config: .p12 + profile ) works.通过 CI (codemagic confic with manual sign config: .p12 + profile ) 运行项目。
  • Run with command still failed(I update armv7 to arm64 )用命令还是失败了(我更新运行armv7arm64

xcodebuild -configuration Debug -target Runner -arch arm64 -sdk iphoneos xcodebuild -configuration Debug -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')

Update 4.更新 4。

  • Uncheck Automatic manage signing to see if it related to Team only profile problem, still failed.取消选中Automatic manage signing以查看它是否与仅Team配置文件问题有关,仍然失败。
  • But run flutter with vscode & run it in Xcode both works.但是使用vscode运行flutter并在Xcode运行它都可以。

Given this question's age, I'm curious if this issue is still relevant.鉴于这个问题的年龄,我很好奇这个问题是否仍然相关。 While I'm unable to replicate this behavior, I suggest trying the solution on this Stack Overflow post and see if it works for your setup.虽然我无法复制这种行为,但我建议在此 Stack Overflow 帖子中尝试解决方案,看看它是否适用于您的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM