Get UDID of the device connected to Mac Machine - macos

I have a cocoa application. I need to retrieve the UDID of the iPhone connected to machine using cable. Is there any way to programatically discover iOS devices connected to Mac OS X machine in cocoa application?

It isn't possible to get UDID programatically. Since iOS 5 Apple has removed access to UDID.
Kindly refer to the following where this has already been discussed.
Get UDID of IOS device programmatically?
UIDevice uniqueIdentifier Deprecated - What To Do Now?

In case you want it without programmatically,
Connect the iPhone to the Mac, open the iTunes, click this button marked with red
After that in the screen you're getting, click on the serial number in the area marked with red here, you'll get the UDID

Connect your device to Mac and open iTunes. Then click on the symbol of the device. It will show the UDID of the device.
And if you want to get UDID programmatically please refer this link.
How to get a unique device ID in Swift?

Related

Is it possible to add a mobile operator to Xcode iPhone simulator?

So I need to add a mobile operator to Xcode simulator. Currently it looks like this
And i want it to be like this
So my question is if there's a way to do it in the Xcode simulator and if so how?
The status icons you see depends on the model of the iPhone. According to this page, phones that use Face ID do not display the carrier in the status bar, and phones that use Touch ID do.
iPhone models with Face ID
iPhone models with Touch ID
So just go to File -> Open Simulator, and select a different simulator that uses Touch ID, such as iPhone SE.
Also,
If you can't see an icon, check Control Centre by swiping down from the top right-hand corner.
I don't think so that you can achieve exactly same that you posted in question but in iOS we have flexibility to change simulator status bar like battery level, time, WiFi state, cellular state.
this feature is called simctl you can Google more details about it.
to specifically change status bar use simctl status_bar
I dont think u can add mobile cause of similator doesn't have SIM card. operator.Similator can work as a real device as coding, but it does not contain all the features of the real device. Simulator is a program and other device.
If you want to do something for a feature that can only be on a real device try this with a real device like mobile operator operations
It's similar to taking a photo from the phone and uploading it to the app. The simulator does not have a camera feature, so if you try to open the camera in the simulator, the application will crash. You need to test this on a real device

How do I run my application from xcode on Apple Watch?

I am trying to run my first WatchKit application on Apple Watch (watchOS 7) from latest XCode (12.0).
I can select emulator as a destinantion, but I have no idea how to add my real watch to the list, so I can start testing on a real device.
I have iCloud account, and it seemed sufficient to run iPhone applications, but not Apple Watch.
How do I make it work?
Ok, I am not the sharpest tool in the shed.
Apart from assigning a proper Team to the Project, make sure you have your iPhone (to which the Apple Watch is paired) connected to your Mac via cable.
The "connect your iPhone using cable" was not thet obvious to me. I assumed it got the device from iCloud account.

"View Device Logs" option does not show all the logs in Xcode on one Mac

I noticed when I develop apps using different Macs(i.e. office-Mac and home-Mac), every time I plug the iDevice(iPhone, iPod...) with Mac, click the View Device Logs button under Window -> Devices and Simulators option, there are some (crash)logs in one Mac and others in another Mac. Or sometimes
My question is:
why this is the case?
How can I view all the logs in one Mac?
Is there another way to view/analyze (crash) logs of iDevices correctly and conveniently without using Xcode?
Here is my environement:
macOS: High Sierra(home-Mac), Sierra(office-Mac)
Xcode: 9.2, 8.3.3
iDevice: iPhone SE(iOS 10.3.3), iPod Touch 5th-Gen(iOS 8.2)
Many thanks in advance.

Wireless debugging icon not showing in my Xcode 9

I just download Xcode 9 and was going through wireless debugging tutorials . I went through this link Wireless debugging but could not make out why my wireless debugging icon is not showing. My device is iPhone 6s updated to iOS 11. and the debugging icon is missing . Snaphot . The icon is missing.
What I got from others tutorial, is the icon they are getting, which I am not getting. Like this in apple documents. .
Network icon is not showing because your device is not paired up to the MAC you are using. If it's not working by connecting to the same WiFi network. you can connect to same network via Bluetooth.
Turn on Bluetooth of your device.
Turn on Bluetooth of your MAC.
Pair up the MAC to the device Bluetooth.
You can see the network icon next to the device name in Xcode -> window -> Devices & Simulator -> select the device.
This worked for me. Hope this helps!
The following steps worked for me:
Connect the iPhone to your mac book
Wait until the device setup is completed
Make sure the mac book and your iPhone are connected to the same Wifi network
In Xcode, Open Window -> Devices and Simulators and see the device appearing under the list of Connected devices.
Select your device and check the "Connect via network" box
Disconnect the device from your mac.
The device will appear under the list of disconnected devices in the same window.
Right click on your device and select "Connect via IP Address"
Enter the IP address of your phone and click connect.
To get the IP address of your iPhone:
On your iPhone, go to Settings -> Wi-FI and tap on the connected wifi network.
You will be able to see the your iPhone's current IP address for the selected Wi-Fi network.
This is working for me without any issues. Hope it helps you too
After pairing the iPad with my mac over bluetooth I didn't got that network icon on the iPad on the device list. Then I start to check for install provisioning profile. And immediately Xcode automatically sync the profile and seems all good for me.
The iPad was new, and it didn't have the provisioning profile install on it.
To check the provisioning profile. Press command + shift + 2 to open the Devices and Simulators. Select the Device category. Under Device category there is the list of connected device. Just press the right button of the mouse or two finger tap on the device.
What worked for me was to un-pair the device, and then I tapped "Trust computer" on the iPhone and then the network globe reappeared.

Is there another Hardware specific Code / Number / anything which is able to replace UDID?

assume the following :
I created an ipad app on ios6 which uses the UDID of the ipad before the app can be installed. So the consumer types in his UDID and than he can install.
In IOS 7 the way I used to get the UDID is not supported anymore, so I search for something else to replace the UDID, if possible.
You may see this question which is somehow related how to find UDID in ios7 without
No there is none, as of iOS 7 you cant even use the MAC address. You should never identify a device but always a user.
You option could be some kind of registration server, where you app will generate a unique number which it will store in the keychain to persist the value.

Resources