Before cloning this repository, ensure you have the following prerequisites installed:
-
Git: Install Git by following the instructions on the official Git website.
- Verify the installation:
git --version
- Verify the installation:
-
Golang: Ensure Golang is installed and properly set up. Refer to the Golang Installation Instructions section above.
-
Homebrew (for macOS users): Install Homebrew by following the instructions on the Homebrew website.
- Verify the installation:
brew --version
- Verify the installation:
Once the prerequisites are installed, you can proceed to clone the repository:
git clone https://github.com/DineshKuppan/devices-cli.git
cd devices-cliTo install Golang, follow these steps:
- Download the latest version of Go from the official website.
- Follow the installation instructions for your operating system.
- Verify the installation by running:
go version
- Install
libimobiledevicetools using Homebrew:brew install libimobiledevice
- Verify the installation:
idevice_id -l ideviceinfo -u <device_udid>
- Install Android Platform Tools:
brew install --cask android-platform-tools
- Add the Android Platform Tools to your PATH:
Replace
export PATH=$PATH:/path/to/android/platform-tools
/path/to/android/platform-toolswith the actual installation path. - Verify the installation:
adb devices
- Open the Settings app on your iOS device.
- Navigate to Privacy & Security > Developer Mode.
- Enable Developer Mode and restart your device if prompted.
- Open the Settings app on your Android device.
- Navigate to About Phone (or About Device, depending on your device).
- Locate the Build Number and tap it 7 times to enable Developer Options. You may need to enter your device's PIN or password.
- For detailed instructions specific to your device, refer to this guide on XDA Developers.
- Go back to Settings and open Developer Options.
- Enable USB Debugging.
For example, the connected device id will be displayed with UUID and use ideviceinfo command to fetch info about the devices
To learn further information about the commands available for library libimobiledevice, please visit this link Link
idevice_id -l
ideviceinfo -u 00000000-0000000XXXXXXXXXTo fetch connected device model details and sdk version
adb -s <device_serial_id> shell getprop ro.product.model
adb -s <device_serial_id> shell getprop ro.build.version.releasePixel 7a
15To build and run the devices-cli binary, follow these steps:
- Build the binary using the
go buildcommand:go build -o devices
- Run the binary:
./devices
This will execute the devices-cli tool and display the list of connected devices.
List of connected Android & IOS devices...
Connected Devices: iOS
- iOS Device: 00000000-0000000XXXXXXXXX
Connected Devices: Android
- Android Device: <actual_device_serial_id>This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub Issues page. Provide as much detail as possible, including steps to reproduce the issue and any relevant logs or screenshots.