Xcode를 시작하지 않고 iPhone 에뮬레이터를 실행하는 방법은 무엇입니까?
Snow Leopard를 실행하는 오래된 Mac에서 "ios"를 스포트라이트로 입력하면 iPhone / iPad 에뮬레이터 자체가 시작됩니다.
그 이후로 Lion을 운영하는 새로운 머신을 구입해야했습니다. Xcode for Lion을 설치했으며 환경 설정 패널에서 개발자 도구 옵션을 설치했습니다.
그러나 "ios"옵션은 더 이상 존재하지 않습니다. 이제 유일한 방법은 Xcode를 실행하고 빈 프로젝트를 만든 다음 run 옵션으로 에뮬레이터를 시작하는 것 같습니다.
intertubes와 facewebs를 검색하고 검색했지만 아무런 도움이되지 않습니다.
누구든지 Lion에서 에뮬레이터 만 실행하는 방법을 알고 있습니까?
업데이트 : 이것은 아래 @ike_love 스레드에 대한 응답입니다. 이 답변이 모든 요세미티 머신에서 작동하는 것은 아닙니다.
에 Xcode가 설치되어 있다고 가정하면 /Applications
명령 줄에서 iPhone 시뮬레이터를 시작할 수 있습니다.
$ open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
(Xcode 6+) :
$ open /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app
데스크탑에서 심볼릭 링크를 만들어이를보다 쉽게 만들 수 있습니다.
$ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app ~/Desktop
(Xcode 6+) :
$ ln -s /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app ~/Desktop
@JackHahoney에 의해 지적, 당신은 또한을 추가 할 수 있습니다 alias
당신에게 ~/.bash_profile
:
$ alias simulator='open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
(Xcode 6+) :
$ alias simulator='open /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app'
(Xcode 7+) :
$ alias simulator='open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app'
즉, 기억하기 쉬운 단어 하나를 사용하여 명령 줄에서 iPhone Simulator를 시작할 수 있습니다.
$ simulator
명령 줄을 다루지 않고 가장 쉬운 방법 :
- Xcode를 한 번 시작하십시오.
- iOS 시뮬레이터 실행
- iOS 시뮬레이터 아이콘을 드래그하여 고정시킵니다.
다음에 사용하려면 독에서 ios 시뮬레이터 아이콘을 클릭하십시오.
XCode 7+에서 현재 위치는
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
명령 행에서 실행
$ open -a Simulator
누군가를 돕는 희망
Automator 실행기를 만들면 스포트라이트를 통해 시작할 수 있습니다 .
- 열다
Automator.app
- 신청 유형을 선택하십시오
- 조치> 라이브러리> 유틸리티> 애플리케이션 실행을 선택하십시오.
- 시작할 수있는 애플리케이션 드롭 다운을 열고 기타를 선택하십시오.
Xcode.app
패키지 안에 있기 때문에 Simulator 앱을 직접 선택할 수 없습니다 . 따라서 별도의 Finder 창에서 해당 파일로 이동하여 파일 선택기 창으로 드래그해야합니다. Xcode 버전 (가장 오래된 것부터 최신 것까지)에 따라 다음 경로 중 하나에 있습니다./Applications/Xcode.app/Contents/Developer/iOS Simulator.app
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS Simulator.app
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
- 마지막 으로이 Automator 앱을 응용 프로그램 폴더에
iOS Simulator.app
방금 만든 Automator 앱에 대한 멋진 아이콘을 얻으려면 다음을 수행하십시오.
- 마우스 오른쪽 버튼을 클릭
iOS Simulator.app
하고 정보 입수를 선택하십시오. - 왼쪽 상단의 아이콘을 클릭하고
Cmd-C
복사하십시오. - Automator 앱을 마우스 오른쪽 버튼으로 클릭하고 정보 입수를 선택하십시오.
- 왼쪽 상단의 아이콘을 클릭하고
Cmd-V
붙여 넣기
이미지를 보는 것이 도움이 되나요?
편집하다
새로운 Xcode로 Xcode의 아이콘이 도크에 있으면 마우스 오른쪽 버튼으로 클릭하고 선택할 수있는 메뉴를 만들 수 Open Developer Tool
있으며 하위 메뉴 iOS Simulator
에서 Xcode를 열지 않고 시뮬레이터를 열 수 있습니다 .!
명령 줄에서 아무것도 할 필요가 없습니다.
그냥 스포트라이트를 사용하여 simulator.app를 실행하십시오.
다수의 답변에서 알 수 있듯이이 문제를 해결하는 방법에는 여러 가지가 있습니다. 그들 모두가 나의 주요 이슈가 무엇인지, 그리고 어쨌든 asker의 우선 순위 인 것까지도 다루지는 않습니다 : Spotlight에서 시작하는 능력.
다음은 나를 위해 잘 작동하며 모든 OS X 및 XCode 버전에서 작동 해야하는 솔루션입니다. OS X 10.11 및 XCode 7.3에서 테스트했습니다.
Initial setup does require launching XCode, but after that, you won't need to just to get to the Simulator.
Setup
- Launch XCode
- From the XCode menu, select Open Developer Tool > Simulator
- In the dock, control (or right) click on the Simulator icon
- Select Options > Show in Finder
- While holding down Command and Option, drag the Simulator icon to the applications directory. This creates an alias to it.
- If desired, rename the alias from "Simulator" to "iOS Simulator". Whatever you name it is what it will show up as in Spotlight.
Note: There are other ways to get to the location of the Simulator app (steps 1-4), such as using Go to Folder… in the Finder, but those require knowing the location of the Simulator to begin with. Since that has changed from version to version of XCode, this way should work regardless of these changes.
Use
- Launch Spotlight (command-space, etc.)
- Type "simulator" or "ios" (if you renamed the alias).
- If necessary, use the down arrow to scroll to the Simulator alias. Eventually, spotlight should learn and make the alias the top choice so you can skip this step.
- Hit return
Try below instruction for launching iphone simulator:
Goto Application Folder-->Xcode app-->right click to Show Package Contents-->now show files in xcode contents-->Developer-->Platforms-->iPhoneSimulator.platform-->Developer-->Applications--> now show iOS Simulator app click to launch iphone simulator...!
With Xcode 6 the location of the simulator has changed to:
/Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app
It can no longer be found here:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app
I hope this helps someone since I sometimes want to start the simulator from terminal.
The solutions above didn't work for me in ZSH. I needed to escape the dot in the iPhoneSimulator.platform. This works for me:
alias simulator="open /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app"
This could be even more resilient version:
alias simulator="open -a 'iOS Simulator'"
There's a far easier way:
- Hit
command
+space
, Spotlight Search will appear - Type in
iOS Simulator
and hitreturn
Done.
----- In follow up to @E. Maggini downvote---
Yes you can still easily access iOS Simulator
using Spotlight
.
In the terminal: For Xcode 9.x and above
$ open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
For Xcode-beta 9.x and above
$ open /Applications/Xcode-beta.app/Contents/Developer/Applications/Simulator.app
The easiest way is to use Spotlight Search. Just click CMD+Space and type in search Simulator. Just like this:
And in few seconds emulated device will be loaded:
To switch to another device you can use menu under Hardware -> Device
There are few different cool instruments you can use under Hardware menu, such as orientation change, gestures, buttons, FaceID, keyboard or audio inputs.
- Go into Finder.
- On the sidebar, click applications.
- Find Xcode in Applications.
- Right click Xcode by whatever settings you have (usually two finger click [not tap]).
- Click "Show Package Contents."
- Go into the Contents folder.
- Search simulator.
- Wait 30 secs for it to load.
- Scroll down and find iOS Simulator.
- You may drag this onto the dock for easier access.
I hope this helps!
I created an automator app based on @trojanfoe's answer so you can launch iOS Simulator directly from your Dock https://github.com/tsdexter/ios-simulator-expo-utilities/
From Terminal just run this command:
ios-sim start
Or,add this to your ~/.profile
to save yourself a few keystrokes:
alias ios="ios-sim start"
Not sure which version of Max OS X and Xcode this command became available. I'm running 10.10.3 and 6.3 respectively.
참고URL : https://stackoverflow.com/questions/10379622/how-to-run-iphone-emulator-without-starting-xcode
'Programing' 카테고리의 다른 글
우분투에 Java 7 설치 (0) | 2020.04.23 |
---|---|
파일이있는 디렉토리를 삭제 하시겠습니까? (0) | 2020.04.23 |
탐색 표시 줄에서 "뒤로"버튼의 제목을 변경하는 방법 (0) | 2020.04.23 |
'크기 조정'이벤트의 '종료'를 기다린 다음 작업을 수행하는 방법은 무엇입니까? (0) | 2020.04.23 |
APK 파일이 디스크에 없습니다 (0) | 2020.04.23 |