Error while capturing iOS Device screen on macOS - swift

I am trying to capture the iOS device's Screen In macOS. While capturing the mirrored iOS device screen we have had an issue:
STEPS
Get connect iPhone with a USB cable to your MacBook.
let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.externalUnknown], mediaType:.muxed, position: .unspecified)
let device = discoverySession.devices
Preview connected device
start to record the device session
Expected: A file to be found at the given file URL. This is the case on my Intel-based Mac.
Actual: On Apple Silicon, no file is written, and the Xcode console fills up with this error message:
CMIO_Unit_Convertor_VideoToolboxCompressor.cpp:1958:doCompressBuffer [0x14683c800] EXCEPTION ON ERROR -67447

Related

Flutter ios libCachedImage not showing

Image stored in local libcachedimage not showing on real iOS device, below is the path where image is stored.
/Users/user***/Library/Developer/CoreSimulator/Devices/B8056AB3-B020-4520-A44E-B3C6E1F4B239/data/Containers/Data/Application/4FCE98E8-BD21-4A35-A79E-0B08EE931BCC/Library/Caches/libCachedImageData/5fa3e7e0-77fa-11ed-a821-d7297da5f84d.jpg'
But it's working with iOS emulator not on real device.
Thanks.

Xcode 14 Canvas preview wrong for connected device

I had this error already in Xcode 13 but it still persists
in the current version.
When I connect my iPhone XS to preview my SwiftUI app in the canvas, it shows the iPhone 14 Pro layout. However, when I check on Devices and Simulators, it's correctly recognised as iPhone XS.
So when I design my layout, I always have to switch between the iPhone XS simulator for designing, and my real device for testing.
Does anybody know a way to show the correct device in the canvas?
I have the same issue and I found out that if you want to see the specific device type to canvas, you have to download the simulator for this device.
From the "Windows" tab, choose "Device and Simulators", and then Simulators. At the bottom left of the window, you can add new simulators.
Then choose your device type and download it.
Once you've added a new simulator, you can use PreviewDevice(rawValue: "Your Device Type").
For example:
I added a new iPhone 12 Simulator and use HomeScreen().previewDevice(PreviewDevice(rawValue: "iPhone 12"))
add simulator window
After that, I am able to see my screen as an iPhone 12.

Unable to play Gif image in iOS Keyboard extension with real device

Hi am developing a Emoji app with swift3 iOS 10. I have used a public library for playing the Gif files. It works perfectly in iOS simulators not in real device displaying an error message
Program ended with exit code: 9
I don't know what is wrong in it.
used this Library
My Code is
let testGifImage = UIImage.gifImageWithName("giphy")
cell.EmojiImage.image = testGifImage

Media Info displayed in simulator but doesn't display on real device

I have tried this code to show media info:
import MediaPlayer
let audioInfo = MPNowPlayingInfoCenter.defaultCenter()
audioInfo.nowPlayingInfo = [ MPMediaItemPropertyTitle: "Miley_Cyrus_", MPMediaItemPropertyArtist:"artistName"]
This is working fine on simulator as shown into image:
But this is not working correctly on real Device:
There is no media info displayed in real device as displayed into simulator. Am I missing something?
I have just found the solution for it
UIApplication.sharedApplication().beginReceivingRemoteControlEvents()
This is working fine.
Reference from HERE.

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.