mac about obtaining mobile phone information terminal commands


iOS real machine commands (automated testing)

Get the UDID of the device

idevice_id --list #Display the udid of the currently connected device
instruments -s devices #List all devices, including real devices, emulators, and mac
ideviceinfo You can find the udid in the returned data
idevice_id -l
Apple mobile safari opens the URL http:/ You can see it at /fir.im/udid

install an app

ideviceinstaller -i apppath Install the app under apppath
ideviceinstaller -u [udid] -i [xxx.ipa] # xxx.ipa is the local path of the application

uninstall app

ideviceinstaller -u [udid] -U [bundleId]

View the apps installed on the device

ideviceinstaller -u [udid] -l # View the third-party applications installed on the device
ideviceinstaller -u [udid] -l -o list_user # Same as above, view the third-party applications installed on the device
ideviceinstaller -u [udid] -l -o list_system # View The system application installed by the device
ideviceinstaller -u [udid] -l -o list_all # View all applications installed by the device

Get device information

ideviceinfo -u [udid] # Obtain device information
ideviceinfo -u [udid] -k DeviceName # Obtain device name with the command idevicename
idevicename # Same as above
ideviceinfo -u [udid] -k ProductVersion # Obtain device version 10.3.3
ideviceinfo -u [udid ] -k ProductType # Get the device type iPhone 8, 1
ideviceinfo -u [udid] -k ProductName # Get the device system name

Other system file information

ideviceinfo # Get all the information of the device
idevicesyslog # Get the device log
idevicecrashreport -e test # Get the device crashlog, test is a folder that needs to be created
idevicediagnostics # Manage device status - restart, shutdown, sleep, etc.
ios-deploy common command
ios-deploy -c # View Currently linked device
ios-deploy --[xxx.app] # Install APP
ios-deploy --id [udid] --uninstall_only --bundle_id [bundleId] # Uninstall application
ios-deploy --id [udid] --list_bundle_id # View all applications
ios-deploy --id [udid] --exists --bundle_id # Check whether the application is installed

List the apps installed on the device:

ideviceinstaller -l can list all the apps installed by users on the phone

run an app

idevicedebug run 'APP_BUNDLE_ID' can directly launch an app. Of course, this app must be built on your phone through the development certificate.

Get the device version of the phone:

Ideviceinfo -k ProductVersion

Get the device name of the phone:

ideviceinfo -k ProductType

Get all information of mobile phone:

ideviceinfo

Get the model of the phone:

ideviceinfo -k ProductType


screenshot:

idevicescreenshot

Video:

xrecord --quicktime --list
xrecord --quicktime --name="iPhone" --out="/Users/blah/video/iphone.mp4" --force
phone shutdown : idevicediagnostics shutdown # shutdown device
restart phone : idevicediagnostics restart # restart device
sleep (screen off): idevicediagnostics sleep # Similar to disconnecting adb. (disconnects from host)
 

Guess you like

Origin blog.csdn.net/qq_30273575/article/details/132300469