小编E. *_*ini的帖子

如何在不启动Xcode的情况下运行iPhone模拟器?

在我运行Snow Leopard的旧Mac上,我可以将"ios"输入聚光灯下,它会自动启动iPhone/iPad模拟器.

我必须得到一台运行Lion的新机器.我已经为Lion安装了Xcode,我已经从首选项面板安装了开发人员工具选项.

但是"ios"选项不再存在:(现在唯一的办法似乎是运行Xcode,创建一个空项目,然后使用run选项启动模拟器.

我搜索并搜索了intertubes和facewebs,但没有任何帮助.

有谁知道如何在Lion上只运行模拟器?

更新:这是对@ike_love线程的回应.答案无法保证在所有Yosemite机器上工作.

在此输入图像描述

xcode ios-simulator osx-lion

224
推荐指数
15
解决办法
14万
查看次数

架构 arm64 的未定义符号:Xcode 12

我在添加 3rd 方框架后尝试构建一个项目,但是在添加框架后我无法编译该项目,我收到架构 arm64 的未定义符号:尝试在设备上编译时出错,但我可以在模拟器上编译. 我已经尝试了在 stackoverflow 上找到的所有其他解决方案。任何帮助表示赞赏!

这是我尝试过的:

  • 在排除架构中添加了值为arm64 的Any iOS Simulator SDK 。
  • 我确实在其他链接器标志中有 $(inherited)
  • 将启用位码设置为否

我尝试过的所有解决方案都不适合我。

Undefined symbols for architecture arm64:
      "_OBJC_CLASS_$_*", referenced from:
          objc-class-ref in frameworkName.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

ios swift xcode12

13
推荐指数
1
解决办法
1万
查看次数

使用Jasmine测试时如何模拟MatChipInput

我已经设置了一个堆栈闪电弹,并基本显示了问题所在。

基本上,当我尝试在包含MatChipList的MatFormField上触发事件时,出现了以下错误

 Cannot read property 'stateChanges' of undefined at MatChipInput._onInput
Run Code Online (Sandbox Code Playgroud)

我尝试用MatInput的替代模拟覆盖MatChip模块。我也尝试覆盖该指令。

有人有智慧的话吗?

谢谢

的HTML

 <h1>Welcome to app!!</h1>

 <div>
  <mat-form-field>
   <mat-chip-list #chipList>
    <mat-chip *ngFor="let contrib of contributors; let idx=index;" [removable]="removable" (removed)="removeContributor(idx)">
     {{contrib.fullName}}
    </mat-chip>
    <input  id="contributor-input"
        placeholder="contributor-input"
        #contributorInput
        [formControl]="contributorCtrl"
        [matAutocomplete]="auto"
        [matChipInputFor]="chipList"
        [matChipInputSeparatorKeyCodes]="separatorKeysCodes"
        [matChipInputAddOnBlur]="addOnBlur">
  </mat-chip-list>
 </mat-form-field>
</div>
Run Code Online (Sandbox Code Playgroud)

TS

import { Component, Input } from '@angular/core';
import { COMMA, ENTER } from '@angular/cdk/keycodes';
import { FormControl } from '@angular/forms';
import { Observable } from 'rxjs';
import { map, startWith } from 'rxjs/operators'; …
Run Code Online (Sandbox Code Playgroud)

unit-testing jasmine angular-material angular

5
推荐指数
1
解决办法
117
查看次数

如何使用茉莉花间谍模拟变量?

我正在尝试测试登录组件。我可以模拟除字符串变量之外的所有内容。这该怎么做?

@Component({
   selector: 'app-login',
   templateUrl: './login.component.html',
   styleUrls: ['./login.component.scss'])

   export class LoginComponent {
   username: string;
   password: string;
   loginSpinner: boolean;

   constructor(public authService: AuthService, public router: Router) {
   }

   login() {
     this.loginSpinner = true;
     this.authService.login(this.username, this.password).subscribe(() => {
     this.loginSpinner = false;
     if (this.authService.isLoggedIn) {
     // Get the redirect URL from our auth service
     // If no redirect has been set, use the default
     const redirect = this.authService.redirectUrl ? this.authService.redirectUrl : '/';

     // Redirect the user
     this.router.navigate([redirect]);
    }
  }, () => {
  // also …
Run Code Online (Sandbox Code Playgroud)

jasmine typescript angular

1
推荐指数
3
解决办法
1万
查看次数