Screencast of iPhone Simulator in Xcode 9 - iphone

I did an animation app with video and music, displayed full screen. Is it possible to capture a screencast of a running app in the simulator with Xcode 9?
Update: Did a research. Metal was not found on my machine, which is required. Thx Evgeny

No, there is no such Xcode feature.
But you can use QuickTime Player for Simulator screen capturing.
Another option is xcrun command line utility.

Related

No Sound on iPhone Simulator - xcode 10, Swift 4 [duplicate]

Somehow my iPhone Simulator is unable to play sounds. First an app I'm working on using AudioServicesPlaySystemSound() stopped working.. I spent a while debugging this but sound is still working on the iPhone when I run the app on the device. I get the same results with other iPhone apps such as the sample Crash Landing app.
I can't find a sound setting anywhere in the simulator or Xcode preferences. I've tried resetting the simulator through "Reset Content and Settings" menu item to no avail.
On your Mac, go to System Preferences > Sound > Sound Effects and then uncheck and recheck "Play user interface sound effects".
You need to re-activate your system sounds, see the end of this page.
I had no sound in the simulator, so I tested it with mobile safari and tried playing an mp3: No sound!
All the above tips didn't help. Eventually, I changed my INPUT source from the virtual soundflower device to Line-In, and the Simulator worked!
So, even if the app wasn't using input, it didn't work well with Soundflower.
I've seen this problem after my update from OSX10.5.7 to 10.6.2
And I made the following changes to make the simulater sing again:
Goto "Applications/Utilities" and run "Audio MIDI Setup", then change midi format from 48000 to 44100.
OpenAL not working on the simulator was fixed with the 2.1 SDK. Make sure Active SDK and Active Executable are set to 2.1.
By the way, make sure you're using the last version of CrashLanding (v1.8). Some nasty leaks in SoundEngine were fixed recently.
I've found sound to be very inconsistent in the simulator (2.1 SDK). Sometimes it works, sometimes it doesn't. Even when it does work, it's usually very choppy and distorted (when playing audio files such as mp3).
A few things to remember:
call AudioSessionInitialize as soon as your app finishes launching
set the kAudioSessionProperty_AudioCategory property for the session via AudioSessionSetProperty (with a value such as kAudioSessionCategory_MediaPlayback)
call AudioSessionSetActive(YES)
Of course when all else fails, just run it on your hardware!
EDIT: Now that the 2.2 SDK has been released, I haven't had any problems with sound in the simulator. They must have fixed the bugs! I highly recommend you upgrade to the 2.2 SDK.
if reactivating system sounds didn't work for you try this:
launch audio-midi-setup, then configure your "built in output" to use 44.100Hz, 2 channels, 24 bits. (from http://www.cocos2d-iphone.org/forum/topic/4159)
somehow after a few days, my iphone simulator now wants 48.000Hz, 2 channels, 24 bits.
just play with it for a bit and be warned that it might change randomly when plugging in headphones, going to standby, restarting, etc.
and here's a an off-topic hint: when you plug headphones into your iphone/ipad the buffer size might double (e.g. from 512bytes to 1024 bytes), make sure you don't rely on the buffersize you requested!
I'm encountering this issue while running a watchOS simulator. In my case, the following worked:
Close the simulator in which the sound doesn't work.
Open another watchOS simulator.
Close it and reopen the original one.
Here are two other possible reasons why sound might not play on simulator devices:
With Xcode 14.2 and simulators running iPadOS 16 / iOS 16, I noticed that sound was playing on iPad simulators, but not iPhone simulators. It turned out that this was related to the AVAudioSession.Category being set on the AVAudioSession. If the category is .ambient then sound plays on iPad but not iPhone simulators, if the category is .playback then it plays on both. Interestingly, this does not seems to be a issue for iOS 15, here .ambient category plays on iPhone simulators too.
If you are calling AVAudioPlayer.play(atTime: TimeInterval) then the TimeInterval you pass in must be later than the device's current time. Passing 0 will not work and just plays nothing. Even passing a value > 0 may play nothing, you need to add the time offset to the deviceCurrentTime on the player. See the associated documentation for an example. This applies to real devices too of course, not just simulators.

Why my Xcode4.5 doesnt have a iphoneretinasimulator with 4 inch?

I have downloaded xcode 4.5 from ios dev center.(dnt know is it the way).I got a dmg file.when i clicked on it to install it has only one xcode setup is there(nothing like samples,simulator folders which normally has).i inatalled it run my application .but when i got the simulator it has hardware options as ipad,ipad retina,iphone,iphone retina3.5,iphone retina 4 inch.only.the normal iphone simulator has the same screen reselution as 320,480.so the retina display has only the changed reselution screen.Is it correct.Can any body used this can guide me?
If you mean that there is no low resolution Simulator, thats right. If you want a smaller Simulator, you can type CMD-3.

External Accessory Framework...EADemo issue

Exploring External Accessory Framework to connect iOS device via bluetooth. I downloaded Apple's EADemo project here: http://developer.apple.com/library/ios/#samplecode/EADemo/Introduction/Intro.html
But how do I test it? I'm new to XCode and Objective-C, so assume nothing. I opened the project file. I have it set to iPhone 5.1 Simulator at the top left. I click on the 'Product' menu...then I click on 'Run'. That opens the iOS simulator and it says no accessories connected. How do I get it to detect other bluetooth devices? If I go to general settings in the iOS simulator, bluetooth is set to off. If I move the switch to 'On'...it just spins and spins and spins and does nothing.
Can anyone help?
Thanks!
Yeah, you can't test EADemo with the simulator. Only works with actual devices.

Setting Xcode's target to iPhone NOT iPad

I just upgraded to iPhone SDK 3.2 Beta 4. Since doing so, I have not been able to get the app to launch in the iPhone simulator - it keeps launching in the iPad simulator. I have tried option-clicking the drop-down menu in the top left-corner of Xcode and setting 'Active Executable' to iPhone simulator 3.1.3 but it keeps going back to iPad simulator instead.
What gives? I have no interest in my app running on the iPad and I don't want to test it in the 2X mode in the simulator.
Thanks,
You can't really launch an iPhone app in 3.2.x - sometimes it will pop up - but basically right now it is only for iPad development.
Update for release version of Simulator.
First of all, the title of this question doesn't match the description: Xcode target isn't the same as the simulator hardware device.
If you are writing an app targeting 3.2, it can run on both iPad (using OS 3.2) and lower OS versions on the iPhone. You do this by setting the Base SDK to iPhone Device 3.2, the Targeted Device Family to iPhone/iPad, and the iPhone OS Deployment Target to 3.1 (lower than 3.2).
The iPhone simulator has a menu option for Hardware->Device, which can be set to iPhone or iPad. However, you can only run a 3.2 SDK target in iPad mode, and a Universal app that supports iPad can only use the 3.2 SDK to build.
You can of course set the simulator to iPhone mode and launch your app from Springboard, but that will lose the debugger connection. Switching mode during installation of your app will cause it to crash.
So the short answer is still the same: you can't run a Universal iPad app in the iPhone mode simulator while debugging.
Upper-left corner of the IDE find a dropdown list of Simulator versions - flipped to 3.2 - try to put it back to 3.1.3
and relaunch your app.
This was driving me nuts too, but the answer is right here:
http://quatermain.tumblr.com/post/517122761/running-universal-ipad-iphone-apps-in-the-simulator
In short, tell Xcode to Build for the 3.2 SDK, then switch the build menu to the 3.1 SDK and tell Xcode to Run the app. Presto, the app starts in the iPhone simulator!
From Apple's documentation: "iPhone OS 3.2 does not support iPhone and iPod touch devices. It runs only on iPad." There's no way to target 3.2 for iPhone, so there's no Simulator. Ergo, you'll have to wait for iOS 4. Fortunately, that's only 4 days away now... of course it won't support the first generation of iPhone devices, but for all other iPhone users it's a free upgrade. Not sure about iPod Touches.
You should be able to change your target platform in your Project Settings.
Changing the target platform and device makes no difference. It always launches the iPad simulator.
If you switch the simulator to iPhone mode, the app just disappears.
This dev environment is a mess.
Short answer: You can change the hardware setting in the simulator. Hardware->Device
Go to Project
Set Active Executable
There are 2 options: Ipad Simulator 3.2 or Iphone Simulator 4.0.
If you choose the Iphone simulator, then it will launch Iphone simulator.
If you choose the Ipad simulator, then it will launch Ipad simulator.
I finally solved this problem myself.
First, install new version of xCode, which is xCode 4.
Then set project scheme to iphone simulator and run app in xCode several times.
And re-install xCode 3 and the problem will be gone away!

No iPad simulator in Xcode 3.2 beta 5

I installed Xcode 3.2 beta 5 and I could not find iPad Simulator. Where do I find it?
You are looking for the program iPhone Simulator.
If not, you can test your website in Safari on iPad using the iPhone Simulator (Hardware -> Device -> iPad).
Above is from Technical Note TN2262
If you can't find it via searchlight, than try looking in /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator
After you install the SDK successfully, Run Xcode and create a new project. Select iPad for product.
When you create an iPhone project for iPhone OS 3.2, you will see that every time you Build and Run it, it appears in the iPad simulator instead of the iPhone simulato
There is not much too see when you run the simulator without a project
Go to spotlight and search iOS Simulator. You run that and up pops an iPhone simulator, go to Hardware > Device and change it to an iPad
The iOS Simulator is in Mac HD > Developer > Platforms > iPhoneSimulator.platform > Developer > Applications > (here)
Nicely squirrelled away
Try creating an iPad project and ask to launch it in the simulator.
When running, go to the dock, right click on the icon and select "options".
In the "Options" menu is "Reveal in Finder", which will show you where the simulator currently lives.
Also be aware that the iPhone and iPad simulator are the same application, in the menu for the iPhone Simulator (the actual name of the app) you can select which device you want to simulate (though XCode will automatically switch this for you when you run in debug).
Perhaps this pertains,
From Xcode release notes found under the download selection:
Known Issues in Xcode 5 developer preview
Simulator
There is no iPad simulator support in this seed.