问题
How can I change the MAC address via Objective-C? Looking for a simple solution. I already have a shell script (Bash) that can do it if that helps. How would I open that from my Cocoa application? Thanks.
回答1:
You can run external commands using NSTask.
However, it's likely that changing the MAC address requires superuser privileges so you will have to look into authorization as well.
来源:https://stackoverflow.com/questions/4825332/change-mac-address-cocoa-objective-c