Syntax
Arguments
os
Platform to open. Optional.ios- Open in Xcodeandroid- Open in Android Studio
- If only one platform is installed, opens automatically
- If both are installed, you’ll be prompted to choose
Examples
Open Android project
nativephp/android/ in Android Studio.
Open iOS project
nativephp/ios/NativePHP.xcworkspace in Xcode.
Auto-detect and open
What it does
Android
- Checks that
nativephp/android/exists - Launches Android Studio with the project
- Opens in the default or running Android Studio instance
nativephp/android/build.gradle
iOS
- Checks that
nativephp/ios/exists - Opens the Xcode workspace (not project)
- Launches Xcode
nativephp/ios/NativePHP.xcworkspace
Requirements
Android
Android Studio must be installed:- macOS:
/Applications/Android Studio.app - Windows:
C:\Program Files\Android\Android Studio - Linux:
/opt/android-studioor via snap
iOS
Xcode must be installed (macOS only):- Install from App Store
- Or download from developer.apple.com
xcode-select --install if command-line tools are missing.
Use cases
Debug native code
Open the project to set breakpoints in Kotlin (Android) or Swift (iOS):Modify native configuration
Edit platform-specific files:- AndroidManifest.xml
- Info.plist
- Gradle build scripts
- Xcode project settings
Add native dependencies
Use the IDE to add libraries:- Android: Add to
build.gradle - iOS: Add via Swift Package Manager or CocoaPods
Run platform tools
Access IDE-specific tools:- Android: Logcat, Layout Inspector, Profiler
- iOS: Instruments, View Debugger, Console
Common workflows
First-time setup
Afternative:install, open to verify setup:
- Project loads without errors
- SDK versions are correct
- No missing dependencies
Fix native build errors
Ifnative:run fails with native errors:
- Check error messages in IDE
- Fix configuration issues
- Sync Gradle/rebuild project
- Run again from terminal
Configure signing
Open to verify/configure signing:- Android: Build > Generate Signed Bundle/APK
- iOS: Signing & Capabilities tab
Inspect UI
Debug UI issues:- Android: Layout Inspector (Tools > Layout Inspector)
- iOS: View Debugger (Debug > View Debugging)
Troubleshooting
”No platform projects found”
Run install first:Android Studio doesn’t open
Check installation:Xcode doesn’t open
Install Xcode from Mac App Store, then:Wrong project type opened
For iOS, ensure opening.xcworkspace not .xcodeproj:
Tips
macOS keyboard shortcut
Create an alias:Keep IDE open
Keep Android Studio/Xcode open while developing for faster iterations.Sync after changes
If you modify native files outside the IDE:- Android: File > Sync Project with Gradle Files
- iOS: Clean Build Folder (Cmd+Shift+K)
See also
- native:run - Build and run the app
- native:emulator - Launch an emulator