运行真实设备调试时,会发生以下问题。
Product > Scheme > Edit Scheme > Run > Executable to Ask On Launch
Product > Scheme > Edit Scheme > Run > Debug executable
,但这没用。rm -r ~/Library/MobileDevice/Provisioning\ Profiles/
也不起作用。rm -r ~/Library/Developer/CoreSimulator/Devices/
。没用。The process failed to exec
。也不适合我。Unable to bootstrap process with bundleID MY-APP-NAME
Unable to get valid task name port right for pid 635
The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified.
Bootstrap failed with error: <NSError: 0x280617810; domain:
BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Failed to start job">
Bootstrapping failed for <FBApplicationProcess: 0x16465a240;
MY-APP-NAME; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID MY-APP-BUNDLE-ID” UserInfo={NSLocalizedDescription=Unable to bootstrap process with bundleID MY-APP-NAME, BKSProcessExitReason=0, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x28061cb40 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={NSLocalizedFailureReason=The process failed to exec, NSLocalizedRecoverySuggestion=Consult /var/log/com.apple.xpc.launchd/launchd.log for more information,
NSLocalizedDescription=Unable to get valid task name port right for pid 635}}, BSErrorCodeDescription=bootstrap-failed}
FBSSystemService][0x1555] Error handling open request for MY-APP-NAME: <NSError: 0x281674420; domain: FBSOpenApplicationServiceErrorDomain; code: 1 (RequestDenied); reason: "The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified."> {
description = "The request to open "MY-APP-NAME" failed.";
failureReason = "The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified.";
userInfo = {
FBSOpenApplicationRequestID = <__NSCFNumber: 0xa56f4bb69cbc0302>;
}
underlyingError = <NSError: 0x281674450; domain: FBSOpenApplicationErrorDomain; code: 1 (Unspecified)> {
description = "The operation couldn’t be completed.
(FBSOpenApplicationErrorDomain error 1.)";
};
}
void dosomething(flag)
{
}
void forkingfunction(int size, int array[],char *outputfile)
{
int i,j,starting=1,temp=1,status;
for(i=0;i<size;i++,temp++)
{
pid_t pID = fork();
if (pID == 0) // child
{
printf("\nchild pid %d\n",getpid());
const int count = dosomething(flag);
if(flag==1)
{
_exit(EXIT_SUCCESS);
kill(pID,SIGKILL);
}
else
{
FILE *fp;
fp = fopen(outputfile, "a+");
if (fp == NULL)
{perror("Unable to open the output file:");}
for (i = 0; i < len; i++)
{
if (solution[i])
{
fprintf(fp," %u ",array[i]);
}
}
fprintf(fp,"=%d\n",sum);
}
_exit(EXIT_SUCCESS);
kill(pID,SIGKILL);
}
else if (pID < 0) // failed to fork
{
perror("Failed to fork:");
}
else
{
// wait(NULL);
if ((pID = wait(&status)) == -1)
{
perror("Error in wait:");
}
}
}
}
void readingfile(char *inputfile,char *outputfile)
{
FILE *myFile = fopen(input, "r");
if (myFile == NULL)
{
perror("Error: Failed to open file.");
}
//code to get number of lines
while ((c=getc(myFile)) != EOF)
{
//puts values of file in an array for processing
}
forkingfunction(size,array,output);
// close file
fclose(myFile);
}
int main(int argc, char **argv)
{
readingfile(inputfilename,outputfilename);
return 0;
}
答案 0 :(得分:1)
如果您在签名和功能标签下将团队设置为 个人团队 ,那么您在该处看不到任何错误。所以只剩下一件事。
答案 1 :(得分:0)
我还是想念一些信息...
1)如果尚未解锁设备,则Xcode显示“拒绝”。 2)为什么使用“ MY-APP-NAME”?您设置了应用名称吗? 3)您使用的是普通的Swift代码还是某种框架? 4)您是否购买了开发者帐户?您是否已使用证书/配置文件制作了所有内容?
无论如何,我建议不编写任何内容就创建一个普通的,原始的XCode项目。 添加您的开发者资料后,它应该可以正常工作。
答案 2 :(得分:0)
确保未将Debug设置为使用分发配置文件-应该将其设置为Development
答案 3 :(得分:0)
我通过删除所有与Xcode相关的证书解决了此问题。我删除了所有与Xcode相关的文件,目的是清除所有内容。
Keychain Access
Apple Worldwide Developer Relations Certification Authority
iPhone Developer: NAME (*****)
iOS Developer: NAME (NAME)
Xcode
,并删除所有可见的项目(我记得这个↓)
Xcode-Token
Xcode-AlternateDSID
iOS
,并删除所有可以看到的项目Developer
,并删除所有可以看到的项目