开发者

Can I start the iPhone simulator without "Build and Run"?

开发者 https://www.devze.com 2023-02-11 04:52 出处:网络
I want to delete an app in the simulator before I 开发者_开发知识库\"build and run\". How can I start the simulator so I can do the deletion? If I start it by \"build and run\" I get a long log output

I want to delete an app in the simulator before I 开发者_开发知识库"build and run". How can I start the simulator so I can do the deletion? If I start it by "build and run" I get a long log output that takes a while because of a bug I'm trying to fix. I'd like to avoid that.


The simulator is just an application, and as such you can run it like any other application.

To open it in Spotlight, search for Simulator.

To run the simulator straight from terminal, prepend these locations with the open command.

Xcode 7.x, 8.x, 9.x, 10.x, 11.x, 12.x, and 13.x

In Xcode 7.x - 13.x, the iPhone Simulator has moved again: /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app.

Xcode 6.x

In Xcode 6.x, the iPhone Simulator has moved yet again, and now resides here: /Applications/Xcode.app/Contents/Developer/Applications/iOS Simulator.app.


Xcode 4.x, 5.x

In Xcode 4.x (through 4.5 on Mountain Lion) and Xcode 5.0.x on Mavericks, it lives here: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/

In my version of Xcode (4.5.2), I find it quite convenient to use the Open Developer Tool menu from either the dock icon or the Xcode menu:

Can I start the iPhone simulator without "Build and Run"?


Xcode 3.x

In Xcode 3.x, it lives here:

/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app


In some future version of Xcode, it will probably move again, it's a squirrelly little app.


From Terminal you can use:

open -a iPhone\ Simulator
open -a iOS\ Simulator
open -a Simulator

This all depends on the application name of the simulator, this can change with each iteration of Xcode.


Since XCode 4.3 the location has changed, the simulator can now be found at:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/


To pick a specific simulator you can first open the Simulator application

Can I start the iPhone simulator without "Build and Run"?

Then right click on the icon, and select from the devices.

Can I start the iPhone simulator without "Build and Run"?


To follow up on that the new command from @jimbojw to create a shortcut with the new Xcode (installing through preferences) is:

ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app

Which will create a shortcut in the applications folder for you.


Use Spotlight.

But only the last simulator will be opened. If you used iPad Air 2 last time, Spotlight will open it. If you wanna open iPhone 6s this time, that's a problem.

Can I start the iPhone simulator without "Build and Run"?


First, add the iOS Simulator to Applications:

ln -s /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app /Applications/iPhone\ Simulator.app

From there you can open it in Finder or drag it to the launch bar.

Source: http://www.bram.us/2010/05/05/xcode-iphone-simulator-location/


This is an older question, but if you simply want to run the simulator from the Xcode 4.5 UI, you can do: Xcode > Open Developer Tool > iOS Simulator.


The easiest way is start the simulator from the Xcode, and then on the dock, Ctrl + Click on the icon and select Keep in Dock

Can I start the iPhone simulator without "Build and Run"?


Without opening Xcode:

open /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app/


For Xcode 7.2

open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator.app

sudo ./Simulator

And adding this path in your profile is the best way.

0

精彩评论

暂无评论...
验证码 换一张
取 消