我在通过Nativescript在我的iPhone上构建运行应用程序(特别是HelloWorld模板)时遇到了问题。 Android构建/运行完美无瑕,但让iOS对应的工作一直是个噩梦。作为背景,我正在运行最新版本的macOS(High Sierra)和最新版本的XCode。问题是每当我尝试构建时,我都被告知XCode 8需要一个teamid(请注意,我也使用XCode 9)。然后构建崩溃并产生下面列出的输出。我见过人们讨论手动将他们的teamid插入配置文件,但是因为我没有注册开发人员程序,所以我没有teamid。我是否必须注册99美元的程序才能在我的设备上运行某些东西?我确实在XCode中设置了开发证书,我尝试在Sidekick中进行临时配置配置文件但是我仍然遇到此错误。此外,有些人建议打开实际的应用程序XCode项目,但是我甚至无法打开它,因为它一旦点击就会立即崩溃XCode。这可能是什么问题?为什么它不像Android构建/运行过程那么简单?此外,模拟器也不起作用,它提供了自己的错误消息主机,但这不是一个好主意,因为我的计算机的硬件使模拟器极其缓慢和不可实现。因此,在我的设备上运行,如Android,将是最好的。输出如下:
jslarosmbp:HelloWorld Js$ tns run ios
Searching for devices...
Preparing project...
Project successfully prepared (iOS)
Building project...
Xcode 8 requires a team id to be specified when building for device.
You can specify the team id by setting the DEVELOPMENT_TEAM setting in build.xcconfig file located in App_Resources folder of your app, or by using the --teamId option when calling run, debug or livesync commands.
Xcode build...
2017-12-18 11:56:20.660 xcodebuild[3263:131976] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-13756/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/RuntimeSupport/MacroExpansion/XCMacroExpansionExtensions.mm:94
Details: Assertion failed: [value isKindOfClass:[NSString class]] || [value isKindOfClass:[NSArray class]]
Object: <DVTMacroDefinitionTable: 0x7fbf626a0a70>
Method: -_xc_setValue:forMacroName:conditionSet:errorHandler:
Thread: <NSThread: 0x7fbf60d175e0>{number = 1, name = main}
Hints:
Backtrace:
0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
1 _DVTAssertionHandler (in DVTFoundation)
2 _DVTAssertionFailureHandler (in DVTFoundation)
3 _DVTAssertionFailureHandler (in DVTFoundation)
4 -[DVTMacroDefinitionTable(XCMacroExpansionExtensions) _xc_setValue:forMacroName:conditionSet:errorHandler:] (in DevToolsCore)
5 -[DVTMacroDefinitionTable(XCMacroExpansionExtensions) _xc_setValue:forMacroName:errorHandler:] (in DevToolsCore)
6 __108-[DVTMacroDefinitionTable(XCMacroExpansionExtensions) xc_setMacroNamesAndValuesFromDictionary:errorHandler:]_block_invoke (in DevToolsCore)
7 -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] (in CoreFoundation)
8 -[DVTMacroDefinitionTable(XCMacroExpansionExtensions) xc_setMacroNamesAndValuesFromDictionary:errorHandler:] (in DevToolsCore)
9 +[DVTMacroDefinitionTable(XCProjectArchivingExtensions) xc_macroDefinitionTableFromDictionaryRepresentationForProjectArchiving:usingPropertyDefinitionsFromSpecificationDomain:] (in DevToolsCore)
10 -[PBXBuildStyle _setBuildSettings:] (in DevToolsCore)
11 -[PBXUnarchivingBinding readValueForObject:fromPListUnarchiver:] (in DevToolsCore)
12 -[PBXObject _unarchiveValuesForArchiveMask:fromPListUnarchiver:] (in DevToolsCore)
13 -[PBXObject readFromPListUnarchiver:] (in DevToolsCore)
14 -[PBXBuildStyle readFromPListUnarchiver:] (in DevToolsCore)
15 -[PBXPListUnarchiver _unarchiveObjectWithGlobalIDHexString:] (in DevToolsCore)
16 -[PBXPListUnarchiver _decodeMutableObjectArrayFromPListArray:] (in DevToolsCore)
17 -[PBXPListUnarchiver decodeMutableObjectArrayForKey:] (in DevToolsCore)
18 -[PBXUnarchivingBinding readValueForObject:fromPListUnarchiver:] (in DevToolsCore)
19 -[PBXObject _unarchiveValuesForArchiveMask:fromPListUnarchiver:] (in DevToolsCore)
20 -[PBXObject readFromPListUnarchiver:] (in DevToolsCore)
21 -[PBXPListUnarchiver _unarchiveObjectWithGlobalIDHexString:] (in DevToolsCore)
22 -[PBXPListUnarchiver decodeObjectForKey:] (in DevToolsCore)
23 -[PBXUnarchivingBinding readValueForObject:fromPListUnarchiver:] (in DevToolsCore)
24 -[PBXObject _unarchiveValuesForArchiveMask:fromPListUnarchiver:] (in DevToolsCore)
25 -[PBXObject readFromPListUnarchiver:] (in DevToolsCore)
26 -[PBXPListUnarchiver _unarchiveObjectWithGlobalIDHexString:] (in DevToolsCore)
27 -[PBXPListUnarchiver _decodeMutableObjectArrayFromPListArray:] (in DevToolsCore)
28 -[PBXPListUnarchiver decodeMutableObjectArrayForKey:] (in DevToolsCore)
29 -[PBXUnarchivingBinding readValueForObject:fromPListUnarchiver:] (in DevToolsCore)
30 -[PBXObject _unarchiveValuesForArchiveMask:fromPListUnarchiver:] (in DevToolsCore)
31 -[PBXObject readFromPListUnarchiver:] (in DevToolsCore)
32 -[PBXProject readFromPListUnarchiver:] (in DevToolsCore)
33 -[PBXPListUnarchiver _unarchiveObjectWithGlobalIDHexString:] (in DevToolsCore)
34 -[PBXPListUnarchiver decodeRootObject] (in DevToolsCore)
35 +[PBXProject projectWithFile:errorHandler:readOnly:] (in DevToolsCore)
36 -[Xcode3Project initWithFilePath:extension:workspace:options:error:] (in DevToolsCore)
37 __82+[IDEContainer _retainedContainerAtFilePath:fileDataType:workspace:options:error:]_block_invoke_2 (in IDEFoundation)
38 _dispatch_client_callout (in libdispatch.dylib)
39 _dispatch_queue_barrier_sync_invoke_and_complete (in libdispatch.dylib)
40 DVTDispatchBarrierSync (in DVTFoundation)
41 -[DVTDispatchLock performLockedBlock:] (in DVTFoundation)
42 __82+[IDEContainer _retainedContainerAtFilePath:fileDataType:workspace:options:error:]_block_invoke (in IDEFoundation)
43 __58-[DVTModelObjectGraph performBlockCoalescingModelChanges:]_block_invoke (in DVTFoundation)
44 -[DVTModelGraphTransactionScope performTransaction:] (in DVTFoundation)
45 -[DVTModelObjectGraph performBlockCoalescingModelChanges:] (in DVTFoundation)
46 +[IDEContainer _retainedContainerAtFilePath:fileDataType:workspace:options:error:] (in IDEFoundation)
47 +[IDEContainer retainedContainerAtFilePath:fileDataType:workspace:error:] (in IDEFoundation)
48 -[IDEWorkspace _configureWrappedWorkspaceWithError:] (in IDEFoundation)
49 __82+[IDEContainer _retainedContainerAtFilePath:fileDataType:workspace:options:error:]_block_invoke (in IDEFoundation)
50 +[IDEContainer _retainedContainerAtFilePath:fileDataType:workspace:options:error:] (in IDEFoundation)
51 +[IDEContainer retainedWrappedWorkspaceForContainerAtFilePath:fileDataType:error:] (in IDEFoundation)
52 -[Xcode3CommandLineBuildTool _resolveInputOptionsWithTimingSection:] (in Xcode3Core)
53 -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
54 0x000000010621c2af (in xcodebuild)
55 start (in libdyld.dylib)
Unable to apply changes on device: 5d3917082e289838a5b920f9c2xxf5c1f7804149. Error is: Command xcodebuild failed with exit code null.
任何可以详细说明的内容都将不胜感激。谢谢!
答案 0 :(得分:0)
您仍然可以在真实设备上进行测试,而无需注册付费会员资格,但仍需提供您的开发ID
请参阅以下链接:
https://developer.apple.com/support/compare-memberships/
http://www.idownloadblog.com/2015/12/24/how-to-create-a-free-apple-developer-account-xcode/
设置配置文件后,您可以使用
查看它们tns run ios --provision
他们使用
在iOS设备上部署您的应用程序tns run ios --provision <your-provision-id>
如果以上操作不起作用,您可以打开生成的iOS项目( platforms / ios / build 中的 xcodeproj 文件)然后通过XCode直接设置您的开发ID。