-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
Athar Reza edited this page Nov 1, 2025
·
1 revision
Get up and running with AgriSense iOS development in just 5 minutes!
Before starting, ensure you have:
- ✅ macOS 13.0+ installed
- ✅ Xcode 15.0+ installed
- ✅ Git installed
- ✅ GitHub account (for cloning)
Don't have these? → See Installation Guide
# Clone the repository
git clone https://github.com/Athar891/AgrisenseiOS.git
# Navigate to directory
cd AgrisenseiOS# Open project
open Agrisense.xcodeprojWait for Xcode to:
- Load project
- Index files
- Resolve Swift packages (automatic)
-
Get Firebase Config:
- Visit Firebase Console
- Use existing project or create new one
- Download
GoogleService-Info.plist
-
Add to Project:
# Copy to Agrisense folder cp ~/Downloads/GoogleService-Info.plist ./Agrisense/
-
Verify in Xcode:
- File should appear in Agrisense folder
- Target membership: Agrisense ✅
Create Secrets.swift in Agrisense/Models/:
import Foundation
enum Secrets {
static let weatherAPIKey = "YOUR_KEY_HERE" // Get from openweathermap.org
static let geminiAPIKey = "YOUR_KEY_HERE" // Get from ai.google.dev
static let cloudinaryCloudName = "YOUR_CLOUD_NAME"
static let cloudinaryUploadPreset = "YOUR_PRESET"
}Quick API Keys (Optional for first run):
- Weather: openweathermap.org (Free tier)
- Gemini AI: ai.google.dev (Free tier)
- Cloudinary: cloudinary.com (Free tier)
- Select target: Agrisense
- Select device: iPhone 14 Pro (or any simulator)
- Press
⌘R(Command + R) - Wait for build... ⏳
- App launches! 🎉
- Splash Screen - AgriSense logo
- Welcome Screen - App introduction
- Sign In/Sign Up - Authentication screen
Email: test@agrisense.com
Password: TestPassword123!
Or use Google Sign-In for faster setup.
- Weather information
- Market prices
- Quick actions
- Tap microphone icon
- Say "Krishi AI" to activate
- Ask a question about farming
- Tap "Add Crop" button
- Fill in crop details
- View your crop portfolio
- Browse products
- Add to cart
- Checkout flow
# Create feature branch
git checkout -b feature/my-new-feature
# Make your changes in Xcode
# Build and test
⌘B # Build
⌘R # Run
⌘U # Test
# Commit changes
git add .
git commit -m "Add: my new feature"
# Push to GitHub
git push origin feature/my-new-feature# Run unit tests
⌘U
# Or via command line
xcodebuild test \
-project Agrisense.xcodeproj \
-scheme Agrisense \
-destination 'platform=iOS Simulator,name=iPhone 14 Pro'// Agrisense/Models/AppState.swift
@Published var isDarkMode = true // Change to true for dark mode// Agrisense/CoreKit/LocalizationManager.swift
@Published var currentLanguage = "hi" // "hi" for Hindi, "en" for English// Agrisense/Services/EnhancedTTSService.swift
utterance.rate = 0.6 // Speed (0.0 - 1.0)
utterance.pitchMultiplier = 1.2 // Pitch (0.5 - 2.0)-
Create SwiftUI View:
// Agrisense/Views/MyNewView.swift import SwiftUI struct MyNewView: View { var body: some View { Text("Hello, AgriSense!") } }
-
Add to Navigation:
// In parent view NavigationLink("Go to My View") { MyNewView() }
// Agrisense/Models/MyModel.swift
import Foundation
struct MyModel: Identifiable, Codable {
let id: String
var name: String
var createdAt: Date
}// Agrisense/Services/MyService.swift
import Foundation
class MyService: ObservableObject {
@Published var data: [MyModel] = []
func fetchData() async throws {
// Fetch logic here
}
}- Connect iPhone via USB
- Trust Computer (on device)
-
Enable Developer Mode:
- Settings → Privacy & Security → Developer Mode → ON
- Select Device in Xcode
-
Build & Run (
⌘R)
- Xcode will register device automatically
- May need to verify in Settings → General → VPN & Device Management
# Clean build folder
⌘⇧K
# Clear derived data
rm -rf ~/Library/Developer/Xcode/DerivedData/*
# Rebuild
⌘B# In Xcode menu
File → Packages → Reset Package Caches
File → Packages → Resolve Package Versions# Reset simulator
xcrun simctl erase all
# Restart simulator
killall Simulator- Check
GoogleService-Info.plistis present - Verify bundle ID matches Firebase config
- Check internet connection
- Look for errors in console
- Project Architecture - Understand the codebase
- Code Structure - File organization
- Design Patterns - Coding patterns used
- Live AI Assistant - Krishi AI deep dive
- Crop Management - Crop system details
- Marketplace - E-commerce implementation
- Contributing Guide - How to contribute
- Coding Standards - Code style guide
- Testing Guide - Writing tests
⌘B Build
⌘R Run
⌘. Stop
⌘U Test
⌘⇧K Clean
⌘⇧Y Show/Hide Console
⌘⇧O Quick Open
⌘⌥J Jump to Definition
⌘/ Comment/Uncomment
po variableName Print object in console
p variableName Print value
expr variableName = value Modify at runtime
⌘K Toggle keyboard
⌘→ Rotate right
⌘← Rotate left
⌘⇧H Home button
⌘⇧H (2x) App switcher
Time: ~10 minutes
Steps:
-
Open DashboardView.swift
# Quick open in Xcode ⌘⇧O → Type "DashboardView" → Enter
-
Add Banner at Top
var body: some View { VStack { // Add this Text("👋 Hello, Farmer!") .font(.largeTitle) .padding() .background(Color.green.opacity(0.2)) .cornerRadius(10) // Existing content... } }
-
Build & Run (
⌘R) -
See Your Changes! 🎉
Bonus: Make it personalized:
Text("👋 Hello, \(userManager.currentUser?.name ?? "Farmer")!")- 📖 Full Documentation - Complete wiki
- 🐛 Troubleshooting - Common issues
- ❓ FAQ - Frequently asked questions
- 💬 GitHub Issues - Report bugs
- 💬 Join discussions
- 🤝 Connect with contributors
- 📧 Email: support@agrisense.app
Before moving forward, ensure:
- Project builds successfully
- App runs on simulator
- Firebase connected
- Can create test account
- All main tabs accessible
- No console errors (warnings OK)
Ready to dive deeper? → Project Architecture
Want to contribute? → Contributing Guide
Need setup help? → Installation Guide
Happy Coding! 🚀
Made with ❤️ for AgriSense